Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem when opening with --remote-silent #90

Closed
AgentCosmic opened this issue Jun 18, 2013 · 9 comments
Closed

Problem when opening with --remote-silent #90

AgentCosmic opened this issue Jun 18, 2013 · 9 comments
Labels

Comments

@AgentCosmic
Copy link

When I open a file with --remote-silent I will have an empty buffer [1].
After open some other files and I attempt to close one buffer with :bd, vim quits.

This is message comes up for the first file:
image

This comes up for the second file:
image

@weynhamz
Copy link
Collaborator

Can you provide a more detailed procedure to reproduce this? I am not using vim in server/client mode, you need to guide me to this problem.

@AgentCosmic
Copy link
Author

Run gvim --remote-silent path/to/file
This will produce first error.
Then run gvim --remote-silent another/file
This will produce the second error.

@weynhamz
Copy link
Collaborator

@AgentCosmic Noop, no error here.

Could you please test it with just MBE enable? And you use --remote-silent without a server instance setup?

@AgentCosmic
Copy link
Author

I ran it with only pathogen and MBE, still same problem. I'm running on Windows, vim 7.3 patch 1-46.
I'm using --remote-silent so I only open files in one instance of gvim.

@weynhamz
Copy link
Collaborator

You might need to update Vim to a newer version and try again. The ':bd' quiting problem is fixed in a newer Vim version.

As I can't reproduce your the 'Key not preset' error shown in the screenshots, I can't do anything about, unless you can dig it down a little and provide me with more info.

@AgentCosmic
Copy link
Author

I've updated to the latest version provided here. The :bd bug is fixed.
However the error message still persist. I have this in my vimrc to wipe any empty buffer. After commenting this out, the error is gone. But I need this code so I don't have an empty buffer in the beggining.

autocmd BufAdd * :call <SID>DeleteBufferIfEmpty()
function! s:DeleteBufferIfEmpty()
    " If no name and no content
    if bufname('%') == '' && line('$') == 1 && getline(1) == ''
        bwipe
        " This will trigger filetype detection, mainly to trigger syntax highlighting
        doautocmd BufRead
    endif
endfunction

weynhamz added a commit to weynhamz/vim-plugin-minibufexpl that referenced this issue Jun 20, 2013
Some autocmds might have deleted it already.

Fix fholgado#90.
@weynhamz
Copy link
Collaborator

@AgentCosmic Try the develop branch or my master branch, should be fixed there.

@weynhamz
Copy link
Collaborator

@AgentCosmic The previous attached commit is buggy, reverted for now, I am working on a fix.

@weynhamz
Copy link
Collaborator

@AgentCosmic It turns out that not the MBE needs fix, it is your code, just add a 'nested' attribute to your autocmd, which make MBE update its buffer list when you do bwipe in the BufAdd event, then everything works fine.

autocmd BufAdd * nested :call <SID>DeleteBufferIfEmpty()
function! s:DeleteBufferIfEmpty()
    " If no name and no content
    if bufname('%') == '' && line('$') == 1 && getline(1) == ''
        bwipe
        " This will trigger filetype detection, mainly to trigger syntax highlighting
        doautocmd BufRead
    endif
endfunction

athom pushed a commit to athom/vim-plugin-minibufexpl that referenced this issue Sep 19, 2013
Some autocmds might have deleted it already.

Fix fholgado#90.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants