Vim
Vim copied to clipboard
Visual mode keys lose current selection
In #40 and other cases, we want to map visual mode keys to commands that operate on what's selected. Unfortunately, on OSX 10.9, LT 0.6.7 and Vim 0.1.0, CodeMirror appears to be losing its selection. To recreate this:
-
Map a visual mode key to a command e.g. in user.behaviors:
(:lt.plugins.vim/map-keys-visual {"=" ":ltexec smart-indent-selection"}) -
Put a debugging statement in that command to demonstrate what's selected:
(prn "HERE" (editor/selection cur)) -
Select something and press '='. You should see
"HERE" ""printed to the console indicating selection is last. If you select and then run the commandEditor: Smart indent line(s), you'll see a selection printed.
Further investigation required to determine if this is a bug with CodeMirror or LT