@@ -365,7 +365,7 @@ Interface.prototype._refreshLine = function() {
365365 const lineRows = dispPos . rows ;
366366
367367 // cursor position
368- const cursorPos = this . _getCursorPos ( ) ;
368+ const cursorPos = this . getCursorPos ( ) ;
369369
370370 // First move to the bottom of the current line, based on cursor pos
371371 const prevRows = this . prevRows || 0 ;
@@ -481,7 +481,7 @@ Interface.prototype._insertString = function(c) {
481481 this . line += c ;
482482 this . cursor += c . length ;
483483
484- if ( this . _getCursorPos ( ) . cols === 0 ) {
484+ if ( this . getCursorPos ( ) . cols === 0 ) {
485485 this . _refreshLine ( ) ;
486486 } else {
487487 this . _writeToOutput ( c ) ;
@@ -760,7 +760,7 @@ Interface.prototype._getDisplayPos = function(str) {
760760
761761
762762// Returns current cursor's position and line
763- Interface . prototype . _getCursorPos = function ( ) {
763+ Interface . prototype . getCursorPos = function ( ) {
764764 const columns = this . columns ;
765765 const strBeforeCursor = this . _prompt + this . line . substring ( 0 , this . cursor ) ;
766766 const dispPos = this . _getDisplayPos (
@@ -777,21 +777,21 @@ Interface.prototype._getCursorPos = function() {
777777 }
778778 return { cols : cols , rows : rows } ;
779779} ;
780- Interface . prototype . getCursorPos = Interface . prototype . _getCursorPos ;
780+ Interface . prototype . _getCursorPos = Interface . prototype . getCursorPos ;
781781
782782
783783// This function moves cursor dx places to the right
784784// (-dx for left) and refreshes the line if it is needed
785785Interface . prototype . _moveCursor = function ( dx ) {
786786 const oldcursor = this . cursor ;
787- const oldPos = this . _getCursorPos ( ) ;
787+ const oldPos = this . getCursorPos ( ) ;
788788 this . cursor += dx ;
789789
790790 // bounds check
791791 if ( this . cursor < 0 ) this . cursor = 0 ;
792792 else if ( this . cursor > this . line . length ) this . cursor = this . line . length ;
793793
794- const newPos = this . _getCursorPos ( ) ;
794+ const newPos = this . getCursorPos ( ) ;
795795
796796 // Check if cursors are in the same line
797797 if ( oldPos . rows === newPos . rows ) {
0 commit comments