Open
Description
Hello,
the line
vim-startify/autoload/startify.vim
Line 662 in 81e36c3
leads to an error message
line 4:
/c/\12
line 5:
E65: Illegal back reference
as shown by
let fname = '/c/\12'
let fname = fnamemodify(fname, ":p")
let fname = glob(fname)
if v:oldfiles contains file paths with back and forward slashes (as happens when using Vim in MSYS2 and Windows).
Maybe the slashes should be all converted to \
if exists('+shellslash') && !&shellslash
and to /
otherwise?
Metadata
Metadata
Assignees
Labels
No labels
Activity
FocusedWolf commentedon Oct 10, 2022
Just experienced an issue with this same line in
s:filter_oldfiles_unsafe(...)
. Turned ons:filter_oldfiles_unsafe = 1
and now i see:E944: Reverse range in character class
when i start gvim. The same issue i think, special characters in fname cause errors.Example of my issue with this line caused by [ ] in fname:
Doing this before fnamemodify(...) will fix my issue but more robust special-character escaping is needed for all cases:
EDIT: No the above fix only stops the error from occurring.
This is correct (for windows only):
let fname = substitute(fname, '\[', '\[[]', 'g')
escape glob characters
Konfekt commentedon Oct 11, 2022
By
:help wildcards
,therefore something like
should work
FocusedWolf commentedon Oct 11, 2022
The win32 section needs some changes. Its causing files like
D:\[test].txt
to be filtered out of the recent file list.I think it should be:
D:\test\.vimrc [[]automatic-backup].vimrc
according to :help wildcardsThe following fixes the win32 side:
update win32 glob escape regex
Konfekt commentedon Oct 12, 2022
Updated accordingly, though in
let fname = substitute(fname, '\[', '\[[]', 'g')
I wonder why\[[]
instead of[[]
FocusedWolf commentedon Oct 12, 2022
Good question. I copied the
let fname = substitute(fname, '\[', '\[[]', 'g')
line from thes:show_sessions()
function. From what i can telllet fname = substitute(fname, '\[', '[[]', 'g')
works identically, i.e.\[[]
and[[]
both insert[[]
. Not sure why '[' is escaped? Help indicates some characters have special meaning in the {sub} argument (but nothing related to '[' that i could see).:h substitute()
:h sub-replace-special