vim: polish code
authorJulien Moutinho <julm+hdoc@autogeree.net>
Tue, 18 Dec 2018 11:25:35 +0000 (11:25 +0000)
committerJulien Moutinho <julm+hdoc@autogeree.net>
Tue, 18 Dec 2018 11:25:35 +0000 (11:25 +0000)
vim/ftplugin/tct.vim

index 0bf1abd96de9f2aff6c7dbfbba5630008aceaef7..887d556d874ffa13df6d15aaa45488a641a92b05 100644 (file)
@@ -27,10 +27,10 @@ endif
 function! s:sectionLevel(lnum)
   let l = a:lnum
   while l > 0
-    let lineCurr = getline(l)
-    let depth = match(lineCurr, '\(^ *#\+\)\@<=\( .*$\)\@=')
-    if depth > 0
-      return depth
+    let l:lineCurr = getline(l)
+    let l:depth = match(l:lineCurr, '\(^#\+\)\@<=\( .*$\)\@=')
+    if l:depth > 0
+      return l:depth
     endif
     let l = l-1
   endwhile
@@ -38,17 +38,17 @@ function! s:sectionLevel(lnum)
 endfunction
 
 function! TctFold()
-  let lineCurr = getline(v:lnum)
+  let l:lineCurr = getline(v:lnum)
 
   " Fold wrt. section level
-  let depth = match(lineCurr, '\(^ *#\+\)\@<=\( .*$\)\@=')
-  if depth > 0
-    return ">" . depth
+  let l:depth = match(l:lineCurr, '\(^#\+\)\@<=\( .*$\)\@=')
+  if l:depth > 0
+    return ">" . l:depth
   endif
 
   " Fold wrt. indent level
   if s:vim_tct_folding_indent == 1
-   let spacesCurr = matchend(lineCurr,"^ *")
+   let spacesCurr = matchend(l:lineCurr,"^ *")
    return s:sectionLevel(v:lnum) + spacesCurr
   endif