Skip to content

feat(neotree): open file tree from insert mode - #312

Merged
fcoury-oai merged 1 commit into
mainfrom
fcoury/neotree-insert-mode
Aug 22, 2026
Merged

fcoury-oai merged 1 commit into
mainfrom
fcoury/neotree-insert-mode

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

Why

Ctrl-e only opened NeoTree from Normal mode. Pressing it while editing instead inserted a literal e, unexpectedly modifying the buffer and requiring users to leave Insert mode manually.

What Changed

  • Map Insert-mode Ctrl-e to EnterMode(Normal) followed by the existing global NeoTree command while preserving the Normal-mode toggle.
  • Finish the active insert transaction before focusing NeoTree so closing the tree returns to Normal mode and undo treats the preceding edit as one change.
  • Cover both default keymaps and the complete open, focus, close, unchanged-buffer, transaction, and undo flow with focused regression tests.

How to Test

  1. Run cargo test --locked --lib neotree; all 14 NeoTree-focused tests should pass, including insert_mode_neotree_shortcut_commits_edits_and_toggles_panel_focus.
  2. Run cargo test --locked --lib config::test::; all 96 configuration tests should pass, including default_config_maps_ctrl_e_to_neotree_in_normal_and_insert_modes.
  3. Open a file in Red, press i, type x, then press Ctrl-e; NeoTree should open and receive focus, the editor should leave Insert mode, and the buffer should contain only the intended x.
  4. Press Ctrl-e again, then u; the tree should close, focus should return to the editor in Normal mode, and one undo should remove the entire preceding insert transaction.

@fcoury-oai
fcoury-oai merged commit 9c461e8 into main Aug 22, 2026
11 checks passed
@fcoury-oai
fcoury-oai deleted the fcoury/neotree-insert-mode branch August 22, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant