0
0
mirror of https://github.com/vim/vim.git synced 2025-10-06 05:44:14 -04:00

patch 8.0.0639: the cursor position is set when editing a new commit message

Problem:    The cursor position is set to the last position in a new commit
            message.
Solution:   Don't set the position if the filetype matches "commit".
            (Christian Brabandt)
This commit is contained in:
Bram Moolenaar
2017-06-13 16:12:51 +02:00
parent d7383881c8
commit 9a48961d8b
2 changed files with 9 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
" The default vimrc file. " The default vimrc file.
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2017 Apr 12 " Last change: 2017 Jun 13
" "
" This is loaded if no vimrc file was found. " This is loaded if no vimrc file was found.
" Except when Vim is run with "-u NONE" or "-C". " Except when Vim is run with "-u NONE" or "-C".
@@ -106,12 +106,13 @@ if has("autocmd")
au! au!
" When editing a file, always jump to the last known cursor position. " 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 " Don't do it when the position is invalid, when inside an event handler
" (happens when dropping a file on gvim). " (happens when dropping a file on gvim) and for a commit message (it's
" likely a different one than last time).
autocmd BufReadPost * autocmd BufReadPost *
\ if line("'\"") >= 1 && line("'\"") <= line("$") | \ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
\ exe "normal! g`\"" | \ | exe "normal! g`\""
\ endif \ | endif
augroup END augroup END

View File

@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
639,
/**/ /**/
638, 638,
/**/ /**/