Giter Site home page Giter Site logo

Comments (11)

mhinz avatar mhinz commented on May 23, 2024

Hmm, it should work without BufEnter.

  1. What version of Vim (+ patch level) do you use?
  2. What VCS?
  3. Did you set any signify options?

from vim-signify.

weynhamz avatar weynhamz commented on May 23, 2024
  1. Vim 7.3 patch 918
  2. git
  3. no

I tried just with signify enabled and it works, there must be some ohter plugin that is interfarring it. Though, it would be no harm to call it on the BufEnter, wouldn't it?

from vim-signify.

mhinz avatar mhinz commented on May 23, 2024

Well, BufEnter will be triggered every time you change between windows even when there were no changes.

Therefore the signify_update_on_bufenter option was introduced. See :help signify-options

from vim-signify.

weynhamz avatar weynhamz commented on May 23, 2024

Yeah, right, I have that option enabled, but no lucky.

from vim-signify.

mhinz avatar mhinz commented on May 23, 2024

Well, it only works if the something was modified in Vim already. :echo &modified has to be 1. Then the buffer would be written and &modified would be 0 again. That prevents unneeded sign updating between switching windows.

And since it should work, you probably have to find the faulty plugin.

from vim-signify.

weynhamz avatar weynhamz commented on May 23, 2024

It is acctually your plugin that is faulty, you should use 'b:path' instead of 's:path'.

The problem I am encoutering is that after signify set the signs, a new window with a 'unlisted' buffer is created in which your 'BufDelete' is triggered in which script wide variable 's:path' is reset which cause the signs are removed globally. 'b:path' will fix this problem though, it is just a quick fix, I havn't digging deeper into your code, there might be a better true fix though. Just want to point the problem out to you.

from vim-signify.

mhinz avatar mhinz commented on May 23, 2024

Ah, I see. A racing problem.

Try replacing the code for BufDelete in plugin/signify.vim by this:

autocmd BufDelete *
    \ let path = resolve(expand('<afile>:p')) |
    \ call s:stop(path) |
    \ if has_key(s:sy, path) |
    \   call remove(s:sy, path) |
    \ endif     

Does this help?

from vim-signify.

weynhamz avatar weynhamz commented on May 23, 2024

Noop, still not.

By the way, it is minibufexpl.vim plugin that signify do not cooprate well with. The code related to this problem in minibufexpl.vim is https://github.com/fholgado/minibufexpl.vim/blob/v6.5.2/plugin/minibufexpl.vim#L1028, with this line commented out, everthing works, but this code is acctually necessary. 'set nobuflisted' will trigger your 'BufDelete' in a nested autocmd, this is the problem.

from vim-signify.

weynhamz avatar weynhamz commented on May 23, 2024

You can reproduce this problem by the following steps:

  1. git clone https://github.com/yegle/vim-reset
  2. source vim-reset/activate
  3. mkdir ~/.vim/.develop
  4. touch ~/.vim/.develop/_vimrc
  5. echo "let g:miniBufExplAutoStart = 1" >> ~/.vim/.develop/_vimrc
  6. echo "let g:miniBufExplBuffersNeeded = 0" >>~/.vim/.develop/_vimrc
  7. vim-reset --hard --confdir ~/.vim/.develop --add-rtp ~/.vim/bundle/plugin-signify/ --add-rtp ~/.vim/bundle/plugin-minibufexpl/
  8. open a git tracked modified file, you will see the problem.

vim-reset is a script that I contributed and rewritten almost all lines to set up a sandbox vim environment for plugin testing and development.

from vim-signify.

weynhamz avatar weynhamz commented on May 23, 2024

Acctually after a small change to your patch, it woks, it probobly a typo of yours

autocmd BufDelete *
    \ let path = resolve(expand('<afile>:p')) |
    \ call s:stop(path) | "use path here not s:path
    \ if has_key(s:sy, path) |
    \   call remove(s:sy, path) |
    \ endif

from vim-signify.

mhinz avatar mhinz commented on May 23, 2024

Yup, I corrected the typo just after I posted it. :-)

Cool, I'll merge this into master then.

Thanks for noticing and the helping feedback!

from vim-signify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.