From 5293b7dfa5a41f09d6bbec48e356ed79942340e4 Mon Sep 17 00:00:00 2001 From: stefan Date: Thu, 4 Sep 2008 09:27:44 +0000 Subject: [PATCH] =?UTF-8?q?default=20f=C3=BCr=20b:commentstring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://vimsuite.svn.sourceforge.net/svnroot/vimsuite/trunk@165 eb2d0018-73a3-4aeb-bfe9-1def61c9ec69 --- vimfiles.stefan/plugin/vimsuite.vim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vimfiles.stefan/plugin/vimsuite.vim b/vimfiles.stefan/plugin/vimsuite.vim index 7a1129c..f05bf2e 100644 --- a/vimfiles.stefan/plugin/vimsuite.vim +++ b/vimfiles.stefan/plugin/vimsuite.vim @@ -627,7 +627,12 @@ function ReformatIndent (fromline,toline) let line_nr = a:fromline while (line_nr <= a:toline) let line = getline(line_nr) - if (match(line,'^' . b:commentstring)>=0) + if !exists("b:commentstring") + let commentstring = b:commentstring + else + let commentstring = '#' + endif + if (match(line,'^' . commentstring)>=0) let line = '@' . line " echo line call setline(line_nr, line) @@ -637,7 +642,7 @@ function ReformatIndent (fromline,toline) " indent all lines execute 'normal ' . a:fromline . 'G=' . a:toline . 'G' " reindent commented lines - let substCmd = 's?^\s*@' . b:commentstring . '?' . b:commentstring . '?' + let substCmd = 's?^\s*@' . commentstring . '?' . commentstring . '?' silent! execute a:fromline . ',' . a:toline . substCmd " go back to mark call cursor(cursorLine, cursorCol)