VIM can't leave INSERT mode

VIM-mode seems to become disabled or unusable after dragging to select a list that has been collapsed. The only remedy is to close out of the document and open it back up again. Hitting Esc to “return” to NORMAL mode does nothing. It’s as if VIM-mode becomes disabled, or it’s stuck in INSERT mode.

Important: This happens regardless of whether or not you’re in INSERT or NORMAL mode when you select the collapsed list.

Steps to reproduce

  1. Open Sandbox Vault
  2. Go to Settings > Editor > Advanced
  3. Activate Vim key bindings and solve the puzzle
  4. Close Settings
  5. Open any document
  6. Enter INSERT mode by tapping “i”
  7. Enter a series of nested lists
    image
  8. Collapse a top-level list item (notice the vim NORMAL-mode cursor above the lists)
    image
  9. Select the lists with your mouse (notice the vim INSERT-mode cursor below the lists)
    image

Expected result

Obsidian will VISUAL select mode (or just stay in NORMAL mode; however Obsidinan has implemented this).

Actual result

VIM-mode is effectively disabled. Any attempts at hitting Esc to leave INSERT mode and return to NORMAL mode don’t work. Either vim-mode “crashed”, or Obsidian is now stuck in INSERT mode.

Environment

SYSTEM INFO:
	Obsidian version: v1.5.12
	Installer version: v1.5.8
	Operating system: Darwin Kernel Version 23.4.0: Wed Feb 21 21:44:54 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T6031 23.4.0
	Login status: logged in
	Catalyst license: none
	Insider build toggle: off
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on

RECOMMENDATIONS:
	none
1 Like

Also seeing this with v1.5.12 on Windows. I pretty heavily use Vim mode + nested lists, so I think it’s a recent change, but I haven’t tried with v1.5.11 to be sure.

Yeah, this is definitely a recent change. I’ve been using VIM Mode + Nested Lists for quite some time and this is new to me. It’s quite frustrating, honestly, because I have to close the document and reopen it just to keep going.

Does it happen in source view?

1 Like

Just reproduced it in Source View:

  1. Collapse a list
  2. Select the list

image

Does it happen here https://raw.githack.com/replit/codemirror-vim/master/dev/web-demo.html?

1 Like

No. REPLit’s CodeMirror VIM mode doesn’t have nested list collapse functionality. It only emulates VIM, and CodeMirror (and by extension, Obisidian) does not support VIM-native folding. The folding functionality that is causing issues here would likely be built in to Obsidian :slightly_smiling_face::+1:

thank you actually I can reproduce.

1 Like

I just tested by collapsing the new EditorView() line in the example you posted, and the folding functionality that is in that example doesn’t seem to reproduce the issue:

image

Selecting something that is collapsed stays in VISUAL mode, which is how it should be :+1: