Skip to content

fix: defer auto_start_watch_mode callback to prevent split blocking#76

Merged
dmmulroy merged 1 commit intomainfrom
fix/auto-start-watch-mode-blocking
Jan 14, 2026
Merged

fix: defer auto_start_watch_mode callback to prevent split blocking#76
dmmulroy merged 1 commit intomainfrom
fix/auto-start-watch-mode-blocking

Conversation

@dmmulroy
Copy link
Copy Markdown
Owner

Summary

  • Wraps M.run() in vim.schedule() in the auto_start_watch_mode autocommand callback
  • Allows buffer/window operations to complete before notifications start

Problem

When auto_start_watch_mode = true, opening files with vertical split from nvim-tree or telescope failed on first attempt but worked on second.

Root cause: The BufRead/BufNewFile autocommand called M.run() synchronously during buffer load. The immediate vim.notify() call created floating windows that interfered with split operations in progress.

Second attempt worked because M.run() short-circuits when process already running (no notifications created).

Fix

Defer M.run() to next event loop iteration with vim.schedule(), allowing split to complete first.

Closes #75

Wrap M.run() in vim.schedule() so buffer/window operations complete before notifications start.

Closes #75
@dmmulroy dmmulroy merged commit e083bcf into main Jan 14, 2026
2 checks passed
@dmmulroy dmmulroy deleted the fix/auto-start-watch-mode-blocking branch January 14, 2026 13:19
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.

Opening files in new buffer with vertical split blocked when watch mode is active.

1 participant