wsdjeg/vim-fetch

When "Opening File to Line", Requests "Press ENTER or type command to Continue"

tscheffert opened this issue · 6 comments

Note: It does open the correct file, without any excess buffers or files, after the mentioned screen.

I'm unsure if this is an actual issue, but I didn't see it in the example gif and didn't see it addressed anywhere else, so I'll bring it up. I imagine it's a common issue and could be added to the documentation at least.

In my terminal I entered:

mvim .vimrc:250

and got the following (captured with screen shot)
screen shot 2015-05-19 at 1 53 30 pm

which depicts something about [New File] and says "Press ENTER or type command to Continue". Once I actually press ENTER then it will correctly open the file at line 250.

It was my understanding that the plugin would skip this "interpret as new file" and jump straight to the file with line.

I already checked my .vimrc and there's nothing which I saw that could be interfering, but all the same it's available for browsing here. It's not line 133 which is about returning to the last position. In fact it plays really nicely with that, which is great.

Edit:The expected behavior is to open the file straight to line 250, bypassing this screen.

Also, I haven't yet gone through the hoola hoops of trying to launch with a clean .vimrc and only this plugin the bisecting until I find the culprit. I was hoping that this is a common issue and there is some known setting I can change to bypass the screen. But, I would be glad to to that if this scenario is unfamiliar and it becomes the suggested first step.

I’m sorry to say this is a new one to me. I can understand what happens (a spurious new file is loaded, echoing the first message, then vim-fetch switches it out for the correct one, echoing the second message, which leaves you with two message lines and thus Vim’s dreaded “Press ENTER to continue” prompt[1]), but I’m not sure why it happens for you. Tentatively, could you set noshowcmd in your vimrc and see if that makes the issue go away?

  1. there is no actual way to make Vim “skip this "interpret as new file" and jump straight to the file with line”[2], which is why the plugin has to watch for spurious new files whose names match existing files + a jump spec, then switch those out under Vim’s nose.
  2. none that works for the purpose of the plugin, that is.

Applying set noshowcmd did not get rid of the issue unfortunately. I got rid of set showcmd, added set noshowcmd, and double checked that the value was correctly set with set showcmd? which correctly echoed noshowcmd.

Figured it out. It's line 580 which is

" Shorten messages and don't show intro
set shortmess=atI

To Reproduce

For whatever reason shortmess requires either o, O, or oO to be included. You can use

" Break vim-fetch
set shortmess-=oO

to see the issue hopefully. Removing just one of the two won't work, both have to be gone for it to break.

Why?

help shortmess states:

'o' overwrite message for writing a file with subsequent message for reading a file (useful for ":wn" or when 'autowrite' on)
'O' message for reading a file overwrites any previous message. Also for quickfix message (e.g., ":cn").

Fix

I'll just change my `.vimrc' to read

" 'a' = Shorten messages, 'oO' = overwrite read/write messages (required for vim-fetch),
" 'tT' = truncate messages that are too long, and 'I' = skip the Vim :intro
set shortmess=aoOtTI

and the issue will be fixed. Not too big a deal.

I'm not sure what the exact issue is, or if you want to do anything to fix it. Hopefully it at least warrants some mention in the docs. Issue is closed on my end.

Great sleuth work, thanks for the feedback! I think I will temporarily add o to shortmess while switching files. Leaving the issue open until I handle this.

Fixed in ce1bfad. Thanks again, @tscheffe!