Skip to content

C-c C-c causes nvim-cmp havoc while q works fine #1492

Answered by CKolkey
r-darwish asked this question in Q&A
Discussion options

You must be logged in to vote

Let's have a look.

Here's the function run when with <c-c><c-c>: https://github.com/NeogitOrg/neogit/blob/master/lua/neogit/buffers/editor/init.lua#L202-L212

        [mapping_I["Submit"]] = function(buffer)
          logger.debug("[EDITOR] Action I: Submit")
          vim.cmd.stopinsert()
          if amend_header then
            buffer:set_lines(0, 0, false, amend_header)
            amend_header = nil
          end

          buffer:write()
          buffer:close(true)
        end,

Stops insert, writes the amend header to the file (if present), writes the buffer, and closes it with force (the true)

We can compare that to the normal-mode q function: https://github.com/NeogitOrg/neogit/b…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@r-darwish
Comment options

Answer selected by r-darwish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants