diff src/testdir/shared.vim @ 13359:81c348d40312 v8.0.1553

patch 8.0.1553: cannot see what digraph is used to insert a character commit https://github.com/vim/vim/commit/5f73ef8d20070cd45c9aea4dc33c2e0657f5515c Author: Bram Moolenaar <Bram@vim.org> Date: Tue Feb 27 21:09:30 2018 +0100 patch 8.0.1553: cannot see what digraph is used to insert a character Problem: Cannot see what digraph is used to insert a character. Solution: Show the digraph with the "ga" command. (Christian Brabandt)
author Christian Brabandt <cb@256bit.org>
date Tue, 27 Feb 2018 21:15:06 +0100
parents 33a2277b8d4d
children fa198b71bab2
line wrap: on
line diff
--- 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