Placeholders are substituted twice for stored commands

Đang mở Phù hợp với người mới
#46 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
79/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
lua
Lĩnh vực
cli, tooling

Hướng nghiên cứu

Đọc set_task_command, run_task, bộ chọn lịch sử và phần kiểm tra tên tệp được thêm trong #44. Theo dõi nơi các lệnh đã lưu và lệnh dùng một lần được thay thế placeholder, sau đó kiểm tra luồng lệnh của bộ chọn lịch sử. Hoàn tất khi lệnh đã lưu chỉ được thay thế một lần, lệnh dùng một lần vẫn hoạt động và tên tệp chứa $E_FN được chấp nhận.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Lua
Star
161
Fork
12
Merge trung bình
25 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của google/executor.nvim

Tất cả issue của google/executor.nvim

Issue tương tự

Thêm issue về Lua

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.