Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use `setLinewiseSelectionAnchor` for linewise visual mode.

  • Loading branch information...
commit 4f896803ea5d3d0fce80cf65ff5cff1155a431f2 1 parent 5e8525c
@sourrust sourrust authored
Showing with 8 additions and 8 deletions.
  1. +4 −4 build/jim-ace.development.js
  2. +4 −4 src/commands.coffee
View
8 build/jim-ace.development.js
@@ -1164,15 +1164,15 @@ map(['o'], OpenLine = (function() {
columnA -= 1;
columnL += 1;
}
+ selection.setSelectionAnchor(rowL, columnL);
} else {
if (isNaN(columnA)) {
_ref5 = jim.mode.anchor, rowA = _ref5[0], columnA = _ref5[1];
}
+ selection.selectionAnchor.column = columnL;
+ selection.selectionAnchor.row = rowL;
+ jim.mode.anchor = jim.adaptor.setLinewiseSelectionAnchor();
}
- if (rowL === rowA && columnL === columnA) {
- return;
- }
- selection.setSelectionAnchor(rowL, columnL);
return jim.adaptor.moveTo(rowA, columnA);
};
return OpenLine;
View
8 src/commands.coffee
@@ -109,12 +109,12 @@ map ['o'], class OpenLine extends Insert
if rowL < rowA or (rowL == rowA and columnL < columnA)
columnA -= 1
columnL += 1
+ selection.setSelectionAnchor(rowL, columnL)
else
[rowA, columnA] = jim.mode.anchor if isNaN columnA
- # Prevent the selection from looking like it exited when anchor and
- # lead are the same
- return if rowL is rowA and columnL is columnA
- selection.setSelectionAnchor(rowL, columnL)
+ selection.selectionAnchor.column = columnL
+ selection.selectionAnchor.row = rowL
+ jim.mode.anchor = jim.adaptor.setLinewiseSelectionAnchor()
jim.adaptor.moveTo(rowA, columnA)
# Create a new line above the cursor and insert there.
Please sign in to comment.
Something went wrong with that request. Please try again.