Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Bug: `plenary.filetype` module overwrites `fs_access = false` option with default value

Đang mở
#652 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ó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
lua, neovim
Lĩnh vực
tooling

Hướng nghiên cứu

Open lua/plenary/filetype.lua and inspect the option handling around line 161. Verify that an explicitly supplied fs_access = false remains false while an unspecified option receives the default true; the issue is done when both cases behave as expected.

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

Mô tả

Issue

There's a bug in lua/plenary/filetype.lua where if you explicitly pass fs_access = false as an option, it gets overwritten with the default value true. This causes text matches to be converted to "" when the filepath exists.

Current behavior

In the code at line 161:

opts.fs_access = opts.fs_access or true

This expression will always set opts.fs_access to true if its current value is false.

Expected behavior

The code should only set the default value if opts.fs_access is nil (unspecified), not when it's explicitly set to false.

Proposed fix

Change line 161 to:

opts.fs_access = (opts.fs_access == nil and true) or opts.fs_access

fs_access only gets the default value of true when it hasn't been specified, preserving any explicitly set value including false.

Ngôn ngữ chính
Lua
Star
3.5k
Fork
340
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

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 nvim-lua/plenary.nvim

Tất cả issue của nvim-lua/plenary.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.