Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pressing 0 (zero) in commit section adds new line #124

Closed
argshook opened this issue Mar 1, 2017 · 4 comments
Closed

Pressing 0 (zero) in commit section adds new line #124

argshook opened this issue Mar 1, 2017 · 4 comments

Comments

@argshook
Copy link
Contributor

argshook commented Mar 1, 2017

In commit section, whilst editing commit message, hitting 0 in normal mode calls magit#update_diff('0'). I expect 0 to work as in normal mode - move cursor to beginning of line. Instead, it adds new line under Commit message heading and moves cursor there.

ideally, none of the diff mappings (and possibly others) should work whilst in commit section.

didn't investigate this at all, just reporting.

@argshook argshook changed the title Pressing 0 (zero) in commit section add new line Pressing 0 (zero) in commit section adds new line Mar 1, 2017
@jreybert
Copy link
Owner

jreybert commented Mar 1, 2017

0 is mapped to reset the hunk context size to its default. It also starts a refresh of the magit buffer, with the new hunk context size.

Real problem here (as you pointed it out) is that vimagit mappings are not section aware. I'm quite reluctant to distinguish mapping effect on current section, I already thought about that when I tried #101. It is not that difficult, but I fear it would be error prone.

Anyway, which mappings should work in commit sections?

  • CC
  • CA
  • R ?
  • <C-n> <C-p>
  • ?
  • Any other thought?

@argshook
Copy link
Contributor Author

argshook commented Mar 1, 2017

maybe there is a way to configure and disable 0 entirely? - and + is enough for me.

as per mappings, for me it's okay to have whatever mappings as long as they don't collide with vim defaults. or at least as little as possible

@jreybert
Copy link
Owner

jreybert commented Mar 1, 2017

At least, you can remap 0 to something else, setting g:magit_diff_reset to whatever you want.

@argshook
Copy link
Contributor Author

argshook commented Mar 1, 2017

nunmap works, so i'll probably just stick this in my vimrc:

autocmd User VimagitBufferInit nunmap <silent> <buffer> 0

@argshook argshook closed this as completed Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants