# Highlight the selected symbol
var col: number =
- util.GetBufOneLine(bnr, symbolTable[mid].outlineLine)->match('\S') + 1
+ bnr->getbufline(symbolTable[mid].outlineLine)->get(0, '')->match('\S') + 1
prop_add(symbolTable[mid].outlineLine, col,
{bufnr: bnr, type: 'LspOutlineHighlight',
length: symbolTable[mid].name->len()})
bnr->bufload()
var lnum = range.start.line + 1
- var text: string = util.GetBufOneLine(bnr, lnum)
+ var text: string = bnr->getbufline(lnum)->get(0, '')
menuItems->add($'{lnum}: {text}')
endfor
bnr = fname->bufadd()
endif
bnr->bufload()
- var text: string = util.GetBufOneLine(bnr, range.start.line + 1)->trim("\t ", 1)
+ var text: string = bnr->getbufline(range.start.line + 1)->get(0, '')->trim("\t ", 1)
qflist->add({filename: fname,
lnum: range.start.line + 1,
col: util.GetLineByteFromPos(bnr, range.start) + 1,
# lines.
var dellastline: bool = false
if start_line == 0 && bnr->getbufinfo()[0].linecount == 1 &&
- util.GetBufOneLine(bnr, 1)->empty()
+ bnr->getbufline(1)->get(0, '')->empty()
dellastline = true
endif
# Need a loaded buffer to read the line and compute the offset
bnr->bufload()
- var ltext: string = GetBufOneLine(bnr, pos.line + 1)
+ var ltext: string = bnr->getbufline(pos.line + 1)->get(0, '')
if ltext->empty()
return col
endif
# Need a loaded buffer to read the line and compute the offset
bnr->bufload()
- var ltext: string = GetBufOneLine(bnr, pos.line + 1)
+ var ltext: string = bnr->getbufline(pos.line + 1)->get(0, '')
if ltext->empty()
return col
endif
return sortedList[0]
enddef
-export def GetBufOneLine(bnr: number, lnum: number): string
- if exists_compiled('*getbufoneline')
- # getbufoneline() was introduced in patch 9.0.0916
- return bnr->getbufoneline(lnum)
- else
- var l = bnr->getbufline(lnum)
- if l->empty()
- return ''
- endif
- return l[0]
- endif
-enddef
-
# vim: tabstop=8 shiftwidth=2 softtabstop=2