Loading ...
Sorry, an error occurred while loading the content.

139382Re: Calling a user function via a map cancels visual mode

Expand Messages
  • Ben Fritz
    Sep 29, 2013
    • 0 Attachment
      On Saturday, September 28, 2013 5:42:46 PM UTC-5, skeept wrote:
      > vnoremap ,n :<C-U>call JumpToNextNonMatching(2)<CR>gv
      > vnoremap ,N :<C-U>call JumpToNextNonMatching(-2)<CR>gv
      >
      > This almost works, if I am moving backwards it progressively increases the visual selected area, but if I am moving forward the visually selected area remains the same because it seems that `gv` brings the cursor back to the beginning of the selection...
      > Any idea on how to make this work also for the forward movement?
      >

      Yes, you can jump to the other side of the visual selection when in visual mode by pressing 'o', so append one more letter to your forward mapping.

      :help v_o

      --
      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Show all 4 messages in this topic