Don't remember cursor position for commit messages #149

Merged
merged 1 commit into from May 10, 2013

Conversation

Projects
None yet
3 participants
Member

derekprior commented Apr 27, 2013

It's not very useful to be dropped into the middle of your diff when
opening a new commit. This change prevents cursor position from being
restored for the gitcommit filetype.

@derekprior derekprior Don't remember cursor position for commit messages
It's not very useful to be dropped into the middle of your diff when
opening a new commit. This change prevents cursor position from being
restored for the `gitcommit` filetype.
5fb4052

@mike-burns mike-burns commented on the diff Apr 30, 2013

@@ -30,10 +30,10 @@ augroup vimrcEx
autocmd FileType text setlocal textwidth=78
" When editing a file, always jump to the last known cursor position.
- " Don't do it when the position is invalid or when inside an event handler
- " (happens when dropping a file on gvim).
+ " Don't do it for commit messages, when the position is invalid, or when
+ " inside an event handler (happens when dropping a file on gvim).
autocmd BufReadPost *
@mike-burns

mike-burns Apr 30, 2013

Owner

Can you change this pattern from * to [^C][^O][^M][^M][^I][^T]*?

@derekprior

derekprior May 3, 2013

Member

There was general agreement in code (amongst the few people who discussed it) that the &ft check was better for readability. Is there a reason you prefer the regex?

@mike-burns

mike-burns May 6, 2013

Owner

The regexp simplifies the conditional. Both are rather unreadable, so go with whatever makes sense.

Owner

jferris commented May 8, 2013

This looks good to merge.

derekprior merged commit 5fb4052 into master May 10, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment