diff --git a/suse.vimrc b/suse.vimrc index b855060..56fc25f 100644 --- a/suse.vimrc +++ b/suse.vimrc @@ -265,16 +265,17 @@ endif map! [3~ map [3~ x -" Only do this part when compiled with support for autocommands. -if has("autocmd") - " 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). - autocmd BufReadPost * - \ if line("'\"") > 0 && line("'\"") <= line("$") | - \ exe "normal g`\"" | - \ endif - +" Only do this part when compiled with support for autocommands. +if has("autocmd") + "Remember the positions in files with some git-specific exceptions" + autocmd BufReadPost * + \ if line("'\"") > 0 && line("'\"") <= line("$") + \ && expand("%") !~ "COMMIT_EDITMSG" + \ && expand("%") !~ "ADD_EDIT.patch" + \ && expand("%") !~ "addp-hunk-edit.diff" + \ && expand("%") !~ "git-rebase-todo" | + \ exe "normal g`\"" | + \ endif endif " has("autocmd") " Changed default required by SuSE security team--be aware if enabling this diff --git a/vim.changes b/vim.changes index c921144..945ef5e 100644 --- a/vim.changes +++ b/vim.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jan 29 10:45:52 UTC 2015 - idonmez@suse.com + +- Update suse.vimrc to stop remembering file positions for git + commit cases. This fixes bnc#538369 and based on msys commits + 1ef258e and 65ffc90. + ------------------------------------------------------------------- Thu Jan 15 11:32:14 UTC 2015 - idonmez@suse.com diff --git a/vim.spec b/vim.spec index 649b82f..b0fcccd 100644 --- a/vim.spec +++ b/vim.spec @@ -1,7 +1,7 @@ # # spec file for package vim # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed