r626 - in /branches/packages/vim/vim7: debian/changelog patches/111_debchangelog_fold.vim.diff patches/series

zack at users.alioth.debian.org zack at users.alioth.debian.org
Tue Apr 25 15:35:05 UTC 2006


Author: zack
Date: Tue Apr 25 15:35:00 2006
New Revision: 626

URL: http://svn.debian.org/wsvn/pkg-vim/?sc=1&rev=626
Log:
added folding support for debian changelogs

Added:
    branches/packages/vim/vim7/patches/111_debchangelog_fold.vim.diff
Modified:
    branches/packages/vim/vim7/debian/changelog
    branches/packages/vim/vim7/patches/series

Modified: branches/packages/vim/vim7/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-vim/branches/packages/vim/vim7/debian/changelog?rev=626&op=diff
==============================================================================
--- branches/packages/vim/vim7/debian/changelog (original)
+++ branches/packages/vim/vim7/debian/changelog Tue Apr 25 15:35:00 2006
@@ -22,6 +22,8 @@
       lang/po/zh_TW.UTF-8.po.
     + syntax/debchangelog.vim is now officially maintained upstream by Debian
       VIM Maintainers
+    + added patch 111_debchangelog_fold.vim.diff which adds folding support
+      for Debian changelogs
 
   [ James Vega ]
   * Add Replaces against manpages-it and manpages-pl since upstream now

Added: branches/packages/vim/vim7/patches/111_debchangelog_fold.vim.diff
URL: http://svn.debian.org/wsvn/pkg-vim/branches/packages/vim/vim7/patches/111_debchangelog_fold.vim.diff?rev=626&op=file
==============================================================================
--- branches/packages/vim/vim7/patches/111_debchangelog_fold.vim.diff (added)
+++ branches/packages/vim/vim7/patches/111_debchangelog_fold.vim.diff Tue Apr 25 15:35:00 2006
@@ -1,0 +1,73 @@
+Index: vim/runtime/ftplugin/debchangelog.vim
+===================================================================
+--- vim/runtime/ftplugin/debchangelog.vim.orig
++++ vim/runtime/ftplugin/debchangelog.vim
+@@ -1,7 +1,9 @@
+-" Vim filetype plugin file
++" Vim filetype plugin file (GUI menu and folding)
+ " Language:	Debian Changelog
+ " Maintainer:	Michael Piefel <piefel at informatik.hu-berlin.de>
+-" Last Change:	15 August 2005
++"		Stefano Zacchiroli <zack at debian.org>
++" Last Change:	25 April 2006
++" License:	GNU GPL, version 2.1 or later
+ 
+ if exists("g:did_changelog_ftplugin")
+   finish
+@@ -10,6 +12,8 @@
+ " Don't load another plugin (this is global)
+ let g:did_changelog_ftplugin = 1
+ 
++" {{{1 GUI menu
++
+ " Helper functions returning various data.
+ " Returns full name, either from $DEBFULLNAME or debianfullname.
+ " TODO Is there a way to determine name from anywhere else?
+@@ -204,3 +208,47 @@
+ setlocal tw=78
+ setlocal comments=f:* 
+ let b:undo_ftplugin = "setlocal tw< comments<"
++
++" }}}
++" {{{1 folding
++
++setlocal foldmethod=expr
++set foldexpr=GetDebChangelogFold(v:lnum)
++setlocal foldtext=DebChangelogFoldText()
++
++" look for an author name searching backward from a given line number
++function! s:getAuthor(lnum)
++  let line = getline(a:lnum)
++  let backsteps = 0
++  while line !~ '^ --'
++    let backsteps += 1
++    let line = getline(a:lnum - backsteps)
++  endwhile
++  let author = substitute(line, '^ --\s*\([^<]\+\)\s*.*', '\1', '')
++  return author
++endfunction
++
++function! DebChangelogFoldText()
++  if v:folddashes == '-'  " changelog entry fold
++    return foldtext() . ' -- ' . s:getAuthor(v:foldend) . ' '
++  endif
++  return foldtext()
++endfunction
++
++function! GetDebChangelogFold(lnum)
++  let line = getline(a:lnum)
++  if line =~ '^\w\+'
++    return '>1' " beginning of a changelog entry
++  endif
++  if line =~ '^\s\+\[.*\]'
++    return '>2' " beginning of an author-specific chunk
++  endif
++  if line =~ '^ --'
++    return '1'
++  endif
++  return '='
++endfunction
++
++" }}}
++
++" vim: set foldmethod=marker:

Modified: branches/packages/vim/vim7/patches/series
URL: http://svn.debian.org/wsvn/pkg-vim/branches/packages/vim/vim7/patches/series?rev=626&op=diff
==============================================================================
--- branches/packages/vim/vim7/patches/series (original)
+++ branches/packages/vim/vim7/patches/series Tue Apr 25 15:35:00 2006
@@ -1,1 +1,2 @@
 109_xdefaults.vim.diff -p0
+111_debchangelog_fold.vim.diff -p0




More information about the pkg-vim-maintainers mailing list