Coder Social home page Coder Social logo

Comments (9)

bagnaram avatar bagnaram commented on July 21, 2024 2

I switched to the branch you mentioned and it works. Sweet!

Yeah you're right about how the autocmd handles different types of buffer closure states. I recall some sort of thing glancing at the docs long ago.

Thanks for maintaining this awesome plugin! It's a must-have coming from emacs!

from neogit.

bagnaram avatar bagnaram commented on July 21, 2024 1

I see the same result with the latest change. I will mess with it when I have some more time but for now I will settle for my autocmd workaround. Thanks!

from neogit.

CKolkey avatar CKolkey commented on July 21, 2024

Yea, in order for us to be able to abort, and for some other reasons, we rely on a BufUnload autocmd to handle some cleanup behind the scenes. But, this means :wq won't work. :w then :q. You can also use q or <c-c><c-c> to submit the commit - those can be remapped too.

The reason it hangs like you see is complicated.. Mostly to do with this: https://github.com/NeogitOrg/neogit/blob/master/lua/neogit/client.lua

Anyways, this isn't a "bug", per-sey, but I'll leave this open for visibility/feedback.

from neogit.

CKolkey avatar CKolkey commented on July 21, 2024

You can try this branch and let me know if that works. The documentation on autocmds isn't the best, but I think that should get called with :wq

from neogit.

bagnaram avatar bagnaram commented on July 21, 2024

I take that back 😅 It appears to have worked due to that race condition mentioned earlier. Subsequent commit attempts are failing.

from neogit.

bagnaram avatar bagnaram commented on July 21, 2024

I wonder if it has to do with some sort of internal vim race condition? Now I know how to get around it though using CTRL-C+CTRL-C

from neogit.

bagnaram avatar bagnaram commented on July 21, 2024

it's sort of glitchy but I think I got it working with autocmd Filetype NeogitCommitMessage cmap <buffer> <silent> wq w!<CR><c-c><c-c>

It's the muscle memory that is failing me!

from neogit.

CKolkey avatar CKolkey commented on July 21, 2024

I changed the test branch to use the WinClosed event instead of BufUnload. Maybe it is some race condition, or.. I donno. It seems like it's some combination of saving and closing in the same action that messes it up. I'm having trouble reproducing it, to be honest. But I would like this to work.

from neogit.

lechat avatar lechat commented on July 21, 2024

it's sort of glitchy but I think I got it working with autocmd Filetype NeogitCommitMessage cmap <buffer> <silent> wq w!<CR><c-c><c-c>

Please don't forget about :x as well!

from neogit.

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.