$E_FN crashes or uses the wrong file outside :ExecutorRun
还没有人认领这个 Issue。
评估
调研方向
首先阅读 run_one_off_cmd、set_task_command 和 get_relative_buffer_name,issue 报告的问题出现在这些位置:buffer 路径过时或为 nil。在 Neovim 中重现这两种情况:先运行 :ExecutorRun 之前运行 :ExecutorOneOff,然后在运行 :ExecutorRun 后从另一个 buffer 运行它。更新受影响路径的 buffer 选择,并验证 $E_FN 使用当前文件且不会崩溃。
由索引模型根据 Issue 内容生成。
描述
:ExecutorRun records the current buffer, and $E_FN uses that recorded buffer. Other ways of running or setting a command do not record it first, so $E_FN either crashes or uses the wrong file.
Steps to reproduce
Crash
- Start Neovim and open any file.
- Before running
:ExecutorRun, run:ExecutorOneOff echo $E_FN. - The command fails with
Invalid 'buf': Expected Lua number. The error comes fromnvim_buf_get_name(nil)inget_relative_buffer_name.
Wrong file
- Open
a.jsand run:ExecutorRunonce. - Switch to
b.js. - Run
:ExecutorOneOff echo $E_FN. The command runs ona.jsinstead ofb.js.
Affected paths
last_active_buf_id is set only in Executor.run(). These paths read it before it is set, or after it has gone stale:
:ExecutorOneOff(run_one_off_cmd).- Choosing a preset.
set_task_commandruns beforeExecutor.run()records the buffer. - Choosing an entry from the history picker. This path also calls
set_task_commandbeforeExecutor.run(). require("executor").api.set_task_commandandapi.run_task.
Possible fix
Record the current buffer in run_one_off_cmd and set_task_command. Alternatively, read the current buffer directly when last_active_buf_id is nil.
- 主要语言
- Lua
- 星标
- 161
- 派生
- 12
- 平均合并
- 25 分钟
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
google/executor.nvim 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 79/100
google/executor.nvim#46 ·
-
难度 5/5 一周以上 新手友好度 20/100
google/executor.nvim#38 ·
-
难度 3/5 1-2 天 新手友好度 45/100
google/executor.nvim#35 ·
-
[Feature Request] Option to run ExecutorShowDetail when the current task finishes可能已有人在做 @jackfranklin 于 513 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 35/100
google/executor.nvim#33 · 9 条评论 ·
-
难度 5/5 一周以上 新手友好度 15/100
google/executor.nvim#26 · 3 条评论 ·
查看 google/executor.nvim 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
teradata-labs/loom#624 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
lsp
难度 1/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复