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

Unite -no-split opens in all windows if :pwd matches wildignore #710

Closed
justinmk opened this issue Aug 26, 2014 · 15 comments
Closed

Unite -no-split opens in all windows if :pwd matches wildignore #710

justinmk opened this issue Aug 26, 2014 · 15 comments

Comments

@justinmk
Copy link
Contributor

This started happening in the last couple weeks, I think. If the same buffer is open in multiple windows, and :Unite buffer -no-split is invoked, the unite interface is shown in all windows for that buffer. This is an undesirable change from the old behavior.

  1. start new Vim
  2. :help help
  3. :vsplit
    • two windows now show the same help buffer
  4. :Unite buffer -no-split
  5. Unite list is shown in both windows. These steps aren't correct.
@Shougo
Copy link
Owner

Shougo commented Aug 27, 2014

I cannot reproduce it.
Please read issue template.

#584

@justinmk
Copy link
Contributor Author

justinmk commented Sep 2, 2014

The problem goes away if I remove the -buffer-name=files part of this mapping

nnoremap <silent> <c-p> :Unite -buffer-name=files file_rec <cr>

As an alternative, the problem also goes away if I cd to some directory other than the Vim install directory (C:\opt\vim on this machine).

I will update this issue if I find reduced steps.

@Shougo
Copy link
Owner

Shougo commented Sep 3, 2014

OK. I have waited until get reproduceable .vimrc.

@justinmk
Copy link
Contributor Author

I finally had a chance to debug this. It was an issue with my vimrc: indirectly caused by c1c81e7 which removed the default ignore_pattern:

call unite#util#set_default('g:unite_source_file_ignore_pattern',
      \'\%(^\|/\)\.\.\?$\|\~$\|\.\%(o|exe|dll|bak|DS_Store|pyc|zwc|sw[po]\)$')

In my vimrc I was appending \|foo\|bar to this default ignore pattern, and since it was empty, it was causing all sorts of weird behavior.

ignore_globs looks nice though!

@Shougo
Copy link
Owner

Shougo commented Sep 19, 2014

OK.

@justinmk justinmk reopened this Sep 30, 2014
@justinmk
Copy link
Contributor Author

Re-opening this because I've isolated it to a reproducible cause. Unite still has a problem if I :cd to a path which happens to match ignore_globs. (This can happen in many cases: user drags file to Vim, user opens files with :e <absolute path>, etc.)

  • It seems to be Windows-only.
    • @Shougo I know you don't use Windows, so these notes are for myself or others for future reference.

Steps to reproduce (notice we are adding */foo/* to wildignore):

gvim -u NONE -N -c ":set wildignore+=*/foo/*" -c ":set runtimepath+=~/.vim/bundle/unite.vim/" -c ":runtime plugin/unite.vim"

:!mkdir foo
:e foo/buz.txt | cd foo | vsplit
:Unite file_rec -no-split

Unite opens in both windows, and canceling out of Unite returns to an empty file instead of foo/bar.txt.

@justinmk justinmk changed the title Unite -no-split opens in all windows for the same buffer Unite -no-split opens in all windows if :pwd matches wildignore Sep 30, 2014
@Shougo
Copy link
Owner

Shougo commented Sep 30, 2014

OK. I will test it.
But if I cannot reproduce it, to fix it is too difficult.

@Shougo
Copy link
Owner

Shougo commented Oct 1, 2014

Unfortunatelly, I cannot reproduce the problem in Linux. Sorry.

@justinmk
Copy link
Contributor Author

justinmk commented Oct 1, 2014

I will try to fix it on Windows when I have some time.

@Shougo
Copy link
Owner

Shougo commented Sep 2, 2015

@justinmk Any news?

@justinmk
Copy link
Contributor Author

justinmk commented Sep 2, 2015

No, sorry.

@Shougo
Copy link
Owner

Shougo commented Sep 3, 2015

Oh,...

@Shougo Shougo closed this as completed in 8a8fafa Sep 13, 2015
@Shougo
Copy link
Owner

Shougo commented Sep 13, 2015

I have tested it in Windows.

Unite opens in both windows, and canceling out of Unite returns to an empty file instead of foo/bar.txt.

I can reproduce 2nd problem. I cannot reproduce 1st problem.
I fixed 2nd problem. It seems Vim's bug though...

@justinmk
Copy link
Contributor Author

Thanks!

wilywampa added a commit to wilywampa/unite.vim that referenced this issue Sep 15, 2015
@Shougo
Copy link
Owner

Shougo commented Sep 28, 2015

I don't fix the problem.
It is Vim's bug and to set buflisted occurs the many problems.

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

No branches or pull requests

2 participants