Vim: cannot jump to the previous occurrence of a character in visual mode

Steps to reproduce

  1. Type a line (the line has to contain a character that occurs two times), e.g. type 123 123 123 in a line
  2. Go to the 3 in the middle in normal mode
  3. Type v to go into the visual mode, and type F3 to find the previous occurrence of 3

Expected result

It should highlight 3 123

Actual result

It cannot find the previous option, even typing ;

Environment

  • Operating system:

Windows

  • Debug info:
SYSTEM INFO:
	Obsidian version: v1.1.16
	Installer version: v1.1.9
	Operating system: Windows 10 Home 10.0.22621
	Login status: not logged in
	Insider build toggle: off
	Live preview: off
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 3
	Plugins enabled: 0

RECOMMENDATIONS:
	none

Additional information

  • It won’t work only when the cursor is highlighting the character that you are searching for, and the highlight is going in the “forward” direction
    • This means, if your cursor is on 2 and do vF3 it will work
    • Or if you cursor highlighted 23 and currently placed on top of 2, and do vF2 it will also work
    • But if your cursor is highlighting 23 and the cursor is placed on top of 3, and do vF3 it will not work
  • After it’s stuck, typing ; will not move the cursor forwards (backwards in the line) but typing , will move the cursor backwards (forwards in the line).
  • Forward search in visual mode works, i.e.vf3 will work
  • Backward search in normal mode also work, i.e. just F3 will jump to the previous occurrence
  1. Does it happen in the sandbox vault?
  2. Does it happen in source mode?
  3. Does it happen here https://codemirror.net/5/demo/vim.html ?
  4. Does it happen here https://codemirror-vim--util.repl.co/ ?
  1. Does it happen in the sandbox vault? Yes
  2. Does it happen in source mode? Yes
  3. Does it happen here CodeMirror: Vim bindings demo ? Yes
  4. Does it happen here https://codemirror-vim--util.repl.co/ ? Yes

I find another weird issue:

1234567
beehive

Assuming the word beehive is at position 1-7:

  • If the cursor is on position 3: do vfe will highlight positions 3-7 as expected
  • If the cursor is on position 2: do vfe will highlight positions 2-7 instead of 2-3
  • If the cursor is on position 3: do vFe the cursor doesn’t move, instead of highlighting 3-2, which is the issue pointed out above

open a feature request here https://github.com/replit/codemirror-vim/issues

Submitted: Cannot/Buggy jump to the next/previous occurrence of a character in visual mode · Issue #95 · replit/codemirror-vim · GitHub. Thanks for the guidance.

thank you

Let me know if this works when you get 1.2.4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.