Vim icon indicating copy to clipboard operation
Vim copied to clipboard

Visual mode keys lose current selection

Open cldwalker opened this issue 11 years ago • 0 comments

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:

  1. Map a visual mode key to a command e.g. in user.behaviors:

    (:lt.plugins.vim/map-keys-visual {"=" ":ltexec smart-indent-selection"})
    
  2. Put a debugging statement in that command to demonstrate what's selected: (prn "HERE" (editor/selection cur))

  3. Select something and press '='. You should see "HERE" "" printed to the console indicating selection is last. If you select and then run the command Editor: Smart indent line(s), you'll see a selection printed.

Further investigation required to determine if this is a bug with CodeMirror or LT

cldwalker avatar Oct 16 '14 22:10 cldwalker