Coder Social home page Coder Social logo

Comments (5)

airblade avatar airblade commented on May 9, 2024

@hoschi Your version text looks fine to me.

Are you using gvim or terminal vim? Terminal vim doesn't trigger FocusGained, I believe.

Please could you show me any vim-gitgutter configuration you have in your vimrc?

Finally, does it work if you do :call GitGutterAll()?

from vim-gitgutter.

hoschi avatar hoschi commented on May 9, 2024

You are right terminal vim doesn't trigger FocusGained. Because of that, I tried gvim and was wordering why it also didn't work.

This is my config for git gutter:

" git gutter
let g:gitgutter_sign_column_always = 1
nmap <silent> ]h :<C-U>execute v:count1 . "GitGutterNextHunk"<CR>
nmap <silent> [h :<C-U>execute v:count1 . "GitGutterPrevHunk"<CR>

I updated my repo this morning and it still doesn't work with FocusGained. When I call the function you mentioned the gutter doesn't update. Only on a write operation.

from vim-gitgutter.

airblade avatar airblade commented on May 9, 2024

Thanks for pasting your config; it's fine.

vim-gitgutter always shows the difference between the saved file and the staged file. If you have unsaved changes in Vim, calling vim-gitgutter again – either via FocusGained or via :call GitGutterAll() – won't change the signs. It's not (yet) a realtime diff, it's what you would get if you ran git diff in the terminal.

So when vim-gitgutter is triggered, the signs will change only if either the git index has changed or you have saved additional changes to the working copy of the file.

Are you saying FocusGained and :call GitGutterAll() don't do anything for you when you have changed the git index or changed the working copy of the file?

from vim-gitgutter.

hoschi avatar hoschi commented on May 9, 2024

Ahhhh ok :) Sorry ^^
I thought it should refresh the signs which reflect not saved changes to my file on FocusGained. If I save the file or change the git index it updates, so you can close the 'issue' ;) Thanks for the explanation.

from vim-gitgutter.

airblade avatar airblade commented on May 9, 2024

I'm glad we figured it out. Sorry for the confusion.

Issue #33 is about signs for unsaved changes – but I'm not sure when I'll be able to tackle it.

from vim-gitgutter.

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.