Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.
This repository has been archived by the owner on May 8, 2024. It is now read-only.

[commit] :wq prompts after vim 8.2.2900 #290

Closed
itchyny opened this issue Jun 11, 2021 · 5 comments · Fixed by #291
Closed

[commit] :wq prompts after vim 8.2.2900 #290

itchyny opened this issue Jun 11, 2021 · 5 comments · Fixed by #291
Labels

Comments

@itchyny
Copy link
Contributor

itchyny commented Jun 11, 2021

Using :wq on gina-buffer-commit feature, gina is expected not to show confirmation prompt.

Do you want to commit changes? (Y[es]/n[o]):

However, starting from vim 8.2.2900, which fixes the issue vim/vim#8279, the plugin starts to show confirmation prompt.
It seems that the commit in Vim breaks the assumption of gina at https://github.com/lambdalisue/gina.vim/blob/97116f338f304802ce2661c2e7c0593e691736f8/autoload/gina/command/tag/edit.vim#L111.

@lambdalisue
Copy link
Owner

I see... Do you know any workaround for this?

@itchyny
Copy link
Contributor Author

itchyny commented Jun 11, 2021

Removing the following line may fix the issue but not sure it breaks other behaviors. https://github.com/lambdalisue/gina.vim/blob/7069668147157d872821ebed1eee07742ece48fd/autoload/gina/command/commit.vim#L318

@lambdalisue
Copy link
Owner

Hum... That would break the behavior of :q which should show the prompt otherwise unwilling commit will be performed.

@itchyny
Copy link
Contributor Author

itchyny commented Jun 11, 2021

How about checking the last command then?

  if histget('cmd', -1) !~# '^\(wq\|x\%[it]\|exi\%[t]\)'
    silent! unlet b:gina_BufWriteCmd
  endif

This is not perfect and does not work with ZZ though (should not prompt). But note that ZQ is unchecked (in L309) and invokes the commit unlike :q!.

@lambdalisue
Copy link
Owner

Nice. Would you mind if I ask you to create a PR for that?

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

Successfully merging a pull request may close this issue.

2 participants