Placeholders are substituted twice for stored commands

未关闭 适合新手
#46 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
79/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
lua
领域
cli, tooling

调研方向

阅读 #44 中新增的 set_task_command、run_task、历史选择器和文件名检查。追踪已保存命令和一次性命令在哪里进行占位符替换,然后检查历史选择器的命令路径。完成标准是:已保存命令只替换一次,一次性命令仍可正常工作,并且包含 $E_FN 的文件名会被接受。

由索引模型根据 Issue 内容生成。

描述

A command that uses $E_FN is filled in when it is set (set_task_command), and then searched for $E_FN again when it runs (run_task). The history picker also passes an already filled-in command back through set_task_command.

For normal filenames the second pass finds nothing. If the filename itself contains the text $E_FN, the second pass replaces it again and produces a broken command. For example, a file named test_$E_FN.js would run echo 'test_'test_$E_FN.js'.js' instead of echo 'test_$E_FN.js'.

Since #44, such filenames are rejected with an error, so this cannot produce a broken or unsafe command. The proper fix is to fill in placeholders only once:

  • run_task substitutes placeholders only for one-off commands; a stored command is already filled in.
  • The history picker stores the chosen entry directly instead of passing it through set_task_command again.

Once that is done, the filename check added in #44 can be removed.

主要语言
Lua
星标
161
派生
12
平均合并
25 分钟
30 天内合并 PR
1

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

google/executor.nvim 的其他 Issue

查看 google/executor.nvim 的全部 Issue

相似的 Issue

更多 Lua Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。