mhinz / mhinz/vim-startify

invalid back reference on MSYS2

Open
#538 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vim Script
Stars
5.4k
Forks
181
PR merge metrics
No merged PRs in 30d

Description

Hello,

the line

https://github.com/mhinz/vim-startify/blob/81e36c352a8deea54df5ec1e2f4348685569bed2/autoload/startify.vim#L662

leads to an error message

```
line 4:
/c/\12
line 5:
E65: Illegal back reference
```

as shown by

```vim
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 `\`

```vim
if exists('+shellslash') && !&shellslash
```

and to `/` otherwise?

Contributor guide

Open the contributing guide

Research direction

Start at autoload/startify.vim line 662 and reproduce the issue with the Vim snippet from the report using mixed-slash paths in v:oldfiles on MSYS2. Check how shellslash affects the path before fnamemodify() and glob(). Done means the reproduction no longer raises E65: Illegal back reference and path expansion still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
vim
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.