Problem: On MS-Windows it is not possible to switch to a buffer by name
with ":b" (including via command-line completion) when the
buffer name contains '%'.
Solution: In file_pat_to_reg_pat() do not treat a backslash before '%',
'#', ',' or a space as a path separator; these are escapes
added by completion and must be undone, like on Unix.
fixes: #20529
https://github.com/vim/vim/pull/20548
(2 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Thanks, but this breaks glob2regpat() on Windows:
echo assert_equal('^\(foo[\/]\|bar\|foobar\)$', glob2regpat('{foo\,bar,foobar}'))
^\(foo[\/]\|bar\|foobar\)$
I think the \ is considered a path separator, that's why it is converted to [\/]
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
You're right — I'll drop the file_pat_to_reg_pat() change; it breaks the
general glob-to-regexp conversion where \ is correctly a path separator.
Root cause: on Windows % is in 'isfname', so \% is treated as a path
separator everywhere (also in rem_backslash()). Buffer completion escapes
% as \% (it's in BUFFER_ESC_CHARS), but nothing turns it back, so :b
builds a regexp with a spurious [\/] and never matches.
I think the fix belongs in completion, not file_pat_to_reg_pat(): drop %
and # from the Windows BUFFER_ESC_CHARS. :buffer has no EX_XFILE, so
they aren't expanded and don't need escaping for buffer matching. Does that
look right to you?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()