Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion keymap/vim.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@
}

function updateFatCursorMark(cm) {
if (!cm.state.fatCursorMarks) return;
clearFatCursorMark(cm);
var ranges = cm.listSelections(), result = []
for (var i = 0; i < ranges.length; i++) {
Expand All @@ -309,17 +310,20 @@
function clearFatCursorMark(cm) {
var marks = cm.state.fatCursorMarks;
if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear();
cm.state.fatCursorMarks = null;
}

function enableFatCursorMark(cm) {
cm.state.fatCursorMarks = [];
updateFatCursorMark(cm)
cm.on("cursorActivity", updateFatCursorMark)
}

function disableFatCursorMark(cm) {
clearFatCursorMark(cm);
cm.off("cursorActivity", updateFatCursorMark);
// explicitly set fatCursorMarks to null because event listener above
// can be invoke after removing it, if off is called from operation
cm.state.fatCursorMarks = null;
}

// Deprecated, simply setting the keymap works again.
Expand Down
Loading