Permalink
Browse files

Version 1.12

- Define some keywords in syntax file (useful for omnicompletion)
- Define :VIKI command as an alias for :VikiHome
- FIX: Problem with names containing spaces
- FIX: Extended names with suffix & interviki
- FIX: Indentation of priority lists.
- FIX: VikiDefine created wrong (old-fashioned) VikiEdit commands under
certain conditions.
- FIX: Directories in extended viki names + interviki names were marked
as inexistent
- FIX: Syntax highlighting of regions or commands the headline of which
spanned several lines
- Added ppt to g:vikiSpecialFiles.
  • Loading branch information...
1 parent 9caa564 commit 8d63693ad30920c9a5e509a2839a0950096636b6 @tomtom tomtom committed with Sep 23, 2006
Showing with 243 additions and 140 deletions.
  1. +3 −3 ftplugin/viki.vim
  2. +115 −103 indent/viki.vim
  3. +77 −28 plugin/viki.vim
  4. +48 −6 syntax/viki.vim
View
@@ -2,8 +2,8 @@
" @Author: Thomas Link (samul AT web.de)
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 12-Jän-2004.
-" @Last Change: 29-Mär-2006.
-" @Revision: 146
+" @Last Change: 15-Mai-2006.
+" @Revision: 147
if !g:vikiEnabled
finish
@@ -30,7 +30,7 @@ exe "setlocal comments=:". b:vikiCommentStart
setlocal foldmethod=expr
setlocal foldexpr=VikiFoldLevel(v:lnum)
setlocal expandtab
-setlocal iskeyword+=#
+setlocal iskeyword+=#,{
let b:vikiEnabled = 2
View
@@ -3,8 +3,8 @@
" @Website: http://members.a1.net/t.link/
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 16-Jän-2004.
-" @Last Change: 29-Okt-2005.
-" @Revision: 0.222
+" @Last Change: 17-Sep-2006.
+" @Revision: 0.228
if !g:vikiEnabled
finish
@@ -29,118 +29,130 @@ if exists("*VikiGetIndent")
endif
fun! VikiGetIndent()
- " Find a non-blank line above the current line.
- let lnum = prevnonblank(v:lnum - 1)
-
- " At the start of the file use zero indent.
- if lnum == 0
- return 0
- endif
-
- let ind = indent(lnum)
- let line = getline(lnum) " last line
-
- let cnum = v:lnum
- let cind = indent(cnum)
- let cline = getline(cnum)
-
- " Do not change indentation in regions
- if VikiIsInRegion(cnum)
- return cind
- endif
-
- let cHeading = matchend(cline, '^\*\+\s\+')
- if cHeading >= 0
- return 0
- endif
-
- let pnum = v:lnum - 1
- let pind = indent(pnum)
-
- let pline = getline(pnum) " last line
- let plCont = matchend(pline, '\\$')
-
- if plCont >= 0
- let plHeading = matchend(pline, '^\*\+\s\+')
- " if plHeading >= 0
- " " echo "DBG continuation plHeading=". plHeading
- " return plHeading
- " else
- " " echo "DBG continuation pind=". pind
- return pind
- " endif
- end
-
- if cind > 0
- " Do not change indentation of:
- " - commented lines
- " - headings
- if cline =~ '^\(\s*%\|\*\)'
- " echom "DBG comment or heading: ". cline
- return ind
+ let lr = &lazyredraw
+ set lazyredraw
+ try
+ " Find a non-blank line above the current line.
+ let lnum = prevnonblank(v:lnum - 1)
+
+ " At the start of the file use zero indent.
+ if lnum == 0
+ return 0
endif
- let markRx = '^\s\+\([#?!+]\)\1\{2,2}\s\+'
- let listRx = '^\s\+\([-+*#?@]\|[0-9#]\+\.\|[a-zA-Z?]\.\)\s\+'
- let priRx = '^\s\+#[A-F]\d\? \+[x_] \+'
- let descRx = '^\s\+.\{-1,}\s::\s\+'
+ let ind = indent(lnum)
+ if ind == 0
+ return 0
+ end
+
+ let line = getline(lnum) " last line
- let clMark = matchend(cline, markRx)
- let clList = matchend(cline, listRx)
- let clPri = matchend(cline, priRx)
- let clDesc = matchend(cline, descRx)
- " let cln = clList >= 0 ? clList : clDesc
-
- if clList >= 0 || clDesc >= 0 || clMark >= 0 || clPri >= 0
- let spaceEnd = matchend(cline, '^\s\+')
- let rv = (spaceEnd / &sw) * &sw
- " echom "DBG clList=". clList ." clDesc=". clDesc
- return rv
- else
- let plMark = matchend(pline, markRx)
- if plMark >= 0
- return plMark
- endif
+ let cnum = v:lnum
+ let cind = indent(cnum)
+ let cline = getline(cnum)
+
+ " Do not change indentation in regions
+ if VikiIsInRegion(cnum)
+ return cind
+ endif
+
+ let cHeading = matchend(cline, '^\*\+\s\+')
+ if cHeading >= 0
+ return 0
+ endif
- let plList = matchend(pline, listRx)
- if plList >= 0
- " echom "DBG plList ". plList ." ". pline
- return plList
+ let pnum = v:lnum - 1
+ let pind = indent(pnum)
+
+ let pline = getline(pnum) " last line
+ let plCont = matchend(pline, '\\$')
+
+ if plCont >= 0
+ let plHeading = matchend(pline, '^\*\+\s\+')
+ " if plHeading >= 0
+ " " echo "DBG continuation plHeading=". plHeading
+ " return plHeading
+ " else
+ " " echo "DBG continuation pind=". pind
+ return pind
+ " endif
+ end
+
+ if cind > 0
+ " Do not change indentation of:
+ " - commented lines
+ " - headings
+ if cline =~ '^\(\s*%\|\*\)'
+ " echom "DBG comment or heading: ". cline
+ return ind
endif
- let plPri = matchend(pline, priRx)
- " echom "DBG plPri=". plPri
- if plPri >= 0
- return plPri
- endif
+ let markRx = '^\s\+\([#?!+]\)\1\{2,2}\s\+'
+ let listRx = '^\s\+\([-+*#?@]\|[0-9#]\+\.\|[a-zA-Z?]\.\)\s\+'
+ let priRx = '^\s\+#[A-F]\d\? \+\([x_0-9%-]\+ \+\)\?'
+ let descRx = '^\s\+.\{-1,}\s::\s\+'
+
+ let clMark = matchend(cline, markRx)
+ let clList = matchend(cline, listRx)
+ let clPri = matchend(cline, priRx)
+ let clDesc = matchend(cline, descRx)
+ " let cln = clList >= 0 ? clList : clDesc
- let plDesc = matchend(pline, descRx)
- if plDesc >= 0
- " echom "DBG plDesc ". pind + (&sw / 2)
- if plDesc >= 0 && g:vikiIndentDesc == '::'
- return plDesc
- else
- return pind + (&sw / 2)
+ if clList >= 0 || clDesc >= 0 || clMark >= 0 || clPri >= 0
+ let spaceEnd = matchend(cline, '^\s\+')
+ let rv = (spaceEnd / &sw) * &sw
+ " echom "DBG clList=". clList ." clDesc=". clDesc
+ return rv
+ else
+ let plMark = matchend(pline, markRx)
+ if plMark >= 0
+ return plMark
+ endif
+
+ let plList = matchend(pline, listRx)
+ if plList >= 0
+ " echom "DBG plList ". plList ." ". pline
+ return plList
endif
- endif
- if cind < ind
- let rv = (cind / &sw) * &sw
- " echom "DBG cind < ind ". rv
- return rv
- elseif cind >= ind
- if cind % &sw == 0
- " echom "DBG cind % &sw ". cind
- return cind
- else
- " echom "DBG cind >= ind ". ind
- return ind
- end
+ let plPri = matchend(pline, priRx)
+ " echom "DBG plPri=". plPri
+ if plPri >= 0
+ let rv = indent(pnum) + &sw / 2
+ " return plPri
+ return rv
+ endif
+
+ let plDesc = matchend(pline, descRx)
+ if plDesc >= 0
+ " echom "DBG plDesc ". pind + (&sw / 2)
+ if plDesc >= 0 && g:vikiIndentDesc == '::'
+ return plDesc
+ else
+ return pind + (&sw / 2)
+ endif
+ endif
+
+ if cind < ind
+ let rv = (cind / &sw) * &sw
+ " echom "DBG cind < ind ". rv
+ return rv
+ elseif cind >= ind
+ if cind % &sw == 0
+ " echom "DBG cind % &sw ". cind
+ return cind
+ else
+ " echom "DBG cind >= ind ". ind
+ return ind
+ end
+ endif
endif
endif
- endif
- " echom "DBG fallback"
- return ind
+ " echom "DBG fallback"
+ return ind
+ finally
+ let &lazyredraw = lr
+ endtry
endfun
Oops, something went wrong.

0 comments on commit 8d63693

Please sign in to comment.