diff options
Diffstat (limited to 'src/testdir/shared.vim')
-rw-r--r-- | src/testdir/shared.vim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/testdir/shared.vim b/src/testdir/shared.vim index ef85514004..5fef6bd1d0 100644 --- a/src/testdir/shared.vim +++ b/src/testdir/shared.vim @@ -259,3 +259,14 @@ endfunc func CanRunGui() return has('gui') && ($DISPLAY != "" || has('gui_running')) endfunc + +" Get line "lnum" as displayed on the screen. +" Trailing white space is trimmed. +func! Screenline(lnum) + let chars = [] + for c in range(1, winwidth(0)) + call add(chars, nr2char(screenchar(a:lnum, c))) + endfor + let line = join(chars, '') + return matchstr(line, '^.\{-}\ze\s*$') +endfunc |