Lines Matching refs:lnum

45 let b:hi_indent = {"lnum": -1}
118 \,"auto": "indent(prevnonblank(v:lnum-1))"
354 let b:hi_newstate.blocklnr = v:lnum
408 " Look back in the file, starting at a:lnum - 1, to compute a state for the
409 " start of line a:lnum. Return the new state.
410 func s:FreshState(lnum) argument
413 " lines 1..a:lnum-1, initial calculating (here!) can be slow, but updating is
419 " lnum last indented line == prevnonblank(a:lnum - 1)
420 " block = 0 a:lnum located within special tag: 0:none, 2:<pre>,
422 " baseindent use this indent for line a:lnum as a start - kind of
427 " blocklnr lnum of starting blocktag (if block!=0)
428 " inattr line {lnum} starts with attributes of a tag
430 let state.lnum = prevnonblank(a:lnum - 1)
438 if state.lnum == 0
443 " remember startline state.lnum
447 " assume a:lnum within block
452 " assume a:lnum within comment
454 " assume usual html for a:lnum
455 " if a:lnum-1 has a closing comment
460 let stopline2 = v:lnum + 1
470 " opening tag found, assume a:lnum within block
480 elseif stopline == state.lnum
481 " handle special case: previous line (= state.lnum) contains a
501 " comment opener found, assume a:lnum within comment
514 let text = tolower(getline(state.lnum))
516 " Check a:lnum-1 for closing comment (we need indent from the opening line).
520 call cursor(state.lnum, comcol + 1)
522 if comlnum == state.lnum
538 call cursor(state.lnum, 99999)
558 let [state.lnum, found] = HtmlIndent_FindTagStart(state.lnum)
560 let text = getline(state.lnum)
563 let state.baseindent = indent(state.lnum) + s:nextrel * shiftwidth()
579 let lnum = prevnonblank(v:lnum - 1)
580 while lnum > 1 && getline(lnum) =~ '^\s*/[/*]'
582 let lnum = prevnonblank(lnum - 1)
584 if lnum < b:hi_indent.blocklnr
588 if lnum == b:hi_indent.blocklnr
603 if prevnonblank(v:lnum-1) == b:hi_indent.blocklnr
618 let curtext = getline(v:lnum)
620 \ || (v:lnum > 1 && getline(v:lnum - 1) =~ '\s*/\*'
621 \ && getline(v:lnum - 1) !~ '\*/\s*$')
622 return cindent(v:lnum)
626 let prev_lnum = s:CssPrevNonComment(v:lnum - 1, min_lnum)
635 call cursor(v:lnum, 1)
733 " Search back for the first unfinished line above "lnum".
734 func s:CssFirstUnfinished(lnum, min_lnum) argument
736 let align_lnum = a:lnum
743 " Find the non-empty line at or before "lnum" that is not a comment.
744 func s:CssPrevNonComment(lnum, stopline) argument
746 " caller starts from a line a:lnum + 1 that is not a comment
747 let lnum = prevnonblank(a:lnum)
749 let ccol = match(getline(lnum), '\*/')
752 return lnum
754 call cursor(lnum, ccol + 1)
756 let lnum = search('/\*', 'bW', a:stopline)
760 let lnum = prevnonblank(lnum - 1)
763 return lnum
768 " Check the number of {} and () in line "lnum". Return a dict with the counts.
769 func HtmlIndent_CountBraces(lnum) argument
771 let brs = substitute(getline(a:lnum), '[''"].\{-}[''"]\|/\*.\{-}\*/\|/\*.*$\|[^{}()]', '', 'g')
804 let curtext = getline(v:lnum)
807 call cursor(v:lnum, 0)
808 let lnum = search('<!--', 'b')
809 if lnum > 0
811 return indent(lnum)
818 let prevlnum = prevnonblank(v:lnum - 1)
836 let curtext = getline(v:lnum)
839 let lnum = search('<!--', 'bn')
840 if lnum > 0
841 return indent(lnum)
847 " When the "lnum" line ends in ">" find the line containing the matching "<".
848 func HtmlIndent_FindTagStart(lnum) argument
853 " - the matching line number or "lnum".
859 let idx = match(getline(a:lnum), '\S>\s*$')
861 call cursor(a:lnum, idx)
862 let lnum = searchpair('<\w', '' , '\S>', 'bW', '', max([a:lnum - b:html_indent_line_limit, 0]))
863 if lnum > 0
864 return [lnum, 1]
867 return [a:lnum, 0]
910 let lnum = v:lnum - 1
911 if lnum > 1
913 return b:html_indent_tag_string_func(lnum)
917 if getline(lnum) =~ '"'
918 call cursor(lnum, 0)
922 return indent(lnum)
928 let lnum = v:lnum
929 while lnum > 1
930 let lnum -= 1
931 let text = getline(lnum)
952 call cursor(lnum, idx + 1)
958 call cursor(lnum, idx)
965 " THE MAIN INDENT FUNCTION. Return the amount of indent for v:lnum.
968 if prevnonblank(v:lnum - 1) < 1
973 let curtext = tolower(getline(v:lnum))
977 let b:hi_newstate.lnum = v:lnum
984 let stack = synstack(v:lnum, col('.')) " assumes there are no tabs
995 let b:hi_indent.lnum = 0
1005 if prevnonblank(v:lnum - 1) == b:hi_indent.lnum && b:hi_lasttick == b:changedtick - 1
1009 let b:hi_indent = s:FreshState(v:lnum)
1038 call cursor(v:lnum, 1)