diff --git a/botanjs/src/Components/Vim/Actions/DELETE.js b/botanjs/src/Components/Vim/Actions/DELETE.js index 86922c1..a5a7f6c 100644 --- a/botanjs/src/Components/Vim/Actions/DELETE.js +++ b/botanjs/src/Components/Vim/Actions/DELETE.js @@ -158,8 +158,7 @@ this.__nline = occurence( removed, "\n" ); - feeder.content = c.substring( 0, s ) + c.substring( e + 1 ); - if( feeder.content === "" ) feeder.content = "\n"; + feeder.content = c.substring( 0, s ) + c.substring( e + 1 ) + "\n"; // Try to keep the original panning if possible feeder.pan( undefined diff --git a/botanjs/src/Components/Vim/Actions/VISUAL.js b/botanjs/src/Components/Vim/Actions/VISUAL.js index d650abd..1d4071d 100644 --- a/botanjs/src/Components/Vim/Actions/VISUAL.js +++ b/botanjs/src/Components/Vim/Actions/VISUAL.js @@ -233,6 +233,18 @@ if( startLine.aPos < minAp ) { pstart = 0; + + if( this.__mode == MODE_LINE ) + { + cur.suppressEvent(); + + cur.lineEnd( true ); + nstart = cur.PStart; + + cur.moveTo( currAp, true ); + + cur.unsuppressEvent(); + } } // highlight from the end else if( maxAp < startLine.aPos ) @@ -309,7 +321,7 @@ // Sets the visual position // s-->e - if( 0 < posDiff ) + if( 0 <= posDiff ) { newPos = newPos + 1; } diff --git a/botanjs/src/Components/Vim/LineFeeder.js b/botanjs/src/Components/Vim/LineFeeder.js index 07a2bec..95b5ab4 100644 --- a/botanjs/src/Components/Vim/LineFeeder.js +++ b/botanjs/src/Components/Vim/LineFeeder.js @@ -217,7 +217,7 @@ if( tabs ) { - tabStat = "-" + ( X + tabs.length * line.tabWidth ); + tabStat = "-" + ( X + tabs.length * ( line.tabWidth - 1 ) ); } return ( line.lineNum + 1 ) + "," + X + tabStat;