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 摘要。