fix(nvim): work around R.nvim cwd change on rout parser build failure#69
Merged
michaelbarton merged 1 commit intomasterfrom Feb 27, 2026
Merged
fix(nvim): work around R.nvim cwd change on rout parser build failure#69michaelbarton merged 1 commit intomasterfrom
michaelbarton merged 1 commit intomasterfrom
Conversation
R.nvim's check_rout_parser() changes directory into resources/tree-sitter-rout to build the rout parser, but when the build fails the early return statements skip the chdir(cwdir) restore call, leaving nvim stuck in the plugin directory. The build fails because the tree-sitter-rout submodule gitlink is absent from older pinned commits so grammar.js is never present. Upstream bug: R-nvim/R.nvim#466 Changes: - nvim/lua/plugins/language.lua: add lazy.nvim build function that clones tree-sitter-rout directly if grammar.js is missing, so the parser build succeeds and cwd is properly restored - ansible/tasks/neovim.yml: add provisioning task that does the same clone for fresh machine setup, idempotent via grammar.js existence check - Makefile: add nvim-check target that boots nvim headlessly across R/py/lua/md filetypes and fails on any startup errors or warnings; add to all: chain Both workarounds include TODO markers referencing the upstream issue to remove once R-nvim/R.nvim#466 is merged and R.nvim is updated past the fix commit. Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
R.nvim's
check_rout_parser()function changes directory intoresources/tree-sitter-rout/to build the rout tree-sitter parser. When the build fails, earlyreturnstatements skip thechdir(cwdir)restore call, leaving nvim stuck in the plugin directory for the rest of the session -- breaking:pwd, file saves, and any workflow that depends on cwd.The build fails because the
tree-sitter-routsubmodule gitlink is absent from older pinned commits of R.nvim, sogrammar.jsis never present.Upstream bug: R-nvim/R.nvim#466 (fix branch exists, not yet merged to main as of 2026-02-27)
Changes
nvim/lua/plugins/language.lua: adds a lazy.nvimbuildfunction for R.nvim that clonestree-sitter-routdirectly ifgrammar.jsis missing, so the parser build succeeds and cwd is properly restoredansible/tasks/neovim.yml: adds a provisioning task that does the same clone for fresh machine setup; idempotent viagrammar.jsexistence checkMakefile: addsnvim-checktarget that boots nvim headlessly across R/py/lua/md filetypes, captures:messages, and fails on any startup errors or warnings; wired intoall:Both workarounds include
TODOmarkers with the upstream issue URL to remove once R-nvim/R.nvim#466 is merged and R.nvim is updated past the fix commit.Removal criteria
Once R-nvim/R.nvim#466 is merged to R.nvim main:
:Lazy update R.nvimto advance past the fix commitbuildblock innvim/lua/plugins/language.luaand the Ansible taskmake nvim-check-- confirmPASS [R]: clean startupMade with Cursor