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-7.3-filetype_changes.patch b/vim-7.3-filetype_changes.patch index f4864ff..57cae0d 100644 --- a/vim-7.3-filetype_changes.patch +++ b/vim-7.3-filetype_changes.patch @@ -1,7 +1,8 @@ -diff -rupN vim73.orig/runtime/filetype.vim vim73/runtime/filetype.vim ---- vim73.orig/runtime/filetype.vim 2010-08-03 22:44:00.000000000 +0200 -+++ vim73/runtime/filetype.vim 2010-11-21 06:22:56.650975029 +0100 -@@ -393,6 +393,9 @@ au BufNewFile,BufRead *.css setf css +Index: vim-7.4.580.hg.6506/runtime/filetype.vim +=================================================================== +--- vim-7.4.580.hg.6506.orig/runtime/filetype.vim ++++ vim-7.4.580.hg.6506/runtime/filetype.vim +@@ -407,6 +407,9 @@ au BufNewFile,BufRead *.css setf css " Century Term Command Scripts (*.cmd too) au BufNewFile,BufRead *.con setf cterm @@ -11,16 +12,21 @@ diff -rupN vim73.orig/runtime/filetype.vim vim73/runtime/filetype.vim " Changelog au BufNewFile,BufRead changelog.Debian,changelog.dch,NEWS.Debian,NEWS.dch \ setf debchangelog -diff -rupN vim73.orig/runtime/syntax/changes.vim vim73/runtime/syntax/changes.vim ---- vim73.orig/runtime/syntax/changes.vim 1970-01-01 01:00:00.000000000 +0100 -+++ vim73/runtime/syntax/changes.vim 2010-11-21 06:22:56.649094929 +0100 -@@ -0,0 +1,37 @@ +Index: vim-7.4.580.hg.6506/runtime/syntax/changes.vim +=================================================================== +--- /dev/null ++++ vim-7.4.580.hg.6506/runtime/syntax/changes.vim +@@ -0,0 +1,41 @@ +" Vim syntax file +" Filename: changes.vim +" Language: SuSE package changes +" Maintainer: Michal Svec +" Last change: 20.8.2003 + ++" We shouldn't insert tabs ++" https://bugzilla.opensuse.org/show_bug.cgi?id=900839 ++set expandtab ++ +if version < 600 + syntax clear +elseif exists("b:current_syntax") diff --git a/vim-speedup-gc.patch b/vim-speedup-gc.patch new file mode 100644 index 0000000..58988d9 --- /dev/null +++ b/vim-speedup-gc.patch @@ -0,0 +1,76 @@ +Index: vim-7.4.580.hg.6506/src/eval.c +=================================================================== +--- vim-7.4.580.hg.6506.orig/src/eval.c ++++ vim-7.4.580.hg.6506/src/eval.c +@@ -6927,48 +6927,51 @@ garbage_collect() + free_unref_items(copyID) + int copyID; + { +- dict_T *dd; +- list_T *ll; ++ dict_T *dd, *dd_next; ++ list_T *ll, *ll_next; + int did_free = FALSE; + + /* + * Go through the list of dicts and free items without the copyID. + */ +- for (dd = first_dict; dd != NULL; ) ++ for (dd = first_dict; dd != NULL; ) { + if ((dd->dv_copyID & COPYID_MASK) != (copyID & COPYID_MASK)) + { + /* Free the Dictionary and ordinary items it contains, but don't + * recurse into Lists and Dictionaries, they will be in the list + * of dicts or list of lists. */ ++ dd_next = dd->dv_used_next; + dict_free(dd, FALSE); + did_free = TRUE; +- +- /* restart, next dict may also have been freed */ +- dd = first_dict; ++ dd = dd_next; + } +- else ++ else { + dd = dd->dv_used_next; ++ } ++ } + + /* + * Go through the list of lists and free items without the copyID. + * But don't free a list that has a watcher (used in a for loop), these + * are not referenced anywhere. + */ +- for (ll = first_list; ll != NULL; ) ++ for (ll = first_list; ll != NULL; ) { + if ((ll->lv_copyID & COPYID_MASK) != (copyID & COPYID_MASK) + && ll->lv_watch == NULL) + { + /* Free the List and ordinary items it contains, but don't recurse + * into Lists and Dictionaries, they will be in the list of dicts + * or list of lists. */ ++ ++ ll_next = ll->lv_used_next; + list_free(ll, FALSE); + did_free = TRUE; +- +- /* restart, next list may also have been freed */ +- ll = first_list; ++ ll = ll_next; + } +- else ++ else { + ll = ll->lv_used_next; ++ } ++ } + + return did_free; + } +@@ -7125,6 +7128,7 @@ dict_free(d, recurse) + + /* Lock the hashtab, we don't want it to resize while freeing items. */ + hash_lock(&d->dv_hashtab); ++ assert(d->dv_hashtab.ht_locked > 0); + todo = (int)d->dv_hashtab.ht_used; + for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi) + { diff --git a/vim.changes b/vim.changes index c921144..ca36d1a 100644 --- a/vim.changes +++ b/vim.changes @@ -1,3 +1,22 @@ +------------------------------------------------------------------- +Fri Jan 30 09:45:18 UTC 2015 - idonmez@suse.com + +- Add vim-speedup-gc.patch to improve garbage collection performance. + Based on https://github.com/neovim/neovim/pull/1761 (boo#899747) + +------------------------------------------------------------------- +Thu Jan 29 12:25:06 UTC 2015 - idonmez@suse.com + +- Modify vim-7.3-filetype_changes.patch to expand tabs when editing + *.changes files (bnc#900839) + +------------------------------------------------------------------- +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..1b8d499 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 @@ -105,6 +105,7 @@ Patch18: %{name}-7.3-filetype_spec.patch Patch19: %{name}-7.3-diff_check.patch Patch21: %{name}-7.3-filetype_changes.patch Patch22: %{name}-7.4-filetype_mine.patch +Patch23: %{name}-speedup-gc.patch Patch100: vim-7.1.314-CVE-2009-0316-debian.patch Patch101: vim73-no-static-libpython.patch %{perl_requires} @@ -187,6 +188,7 @@ cp %{SOURCE23} runtime/syntax/apparmor.vim %patch19 -p1 %patch21 -p1 %patch22 -p1 +%patch23 -p1 %patch100 -p1 %patch101 cp %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE8} %{SOURCE10} .