123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917 |
- local helpers = require('test.functional.helpers')(after_each)
- local Screen = require('test.functional.ui.screen')
- local clear, feed, command = helpers.clear, helpers.feed, helpers.command
- local eq = helpers.eq
- local insert = helpers.insert
- describe('Screen', function()
- local screen
- before_each(function()
- clear()
- screen = Screen.new(nil,10)
- screen:attach()
- screen:set_default_attr_ids( {
- [0] = {bold=true, foreground=Screen.colors.Blue},
- [1] = {foreground = Screen.colors.LightGrey, background = Screen.colors.DarkGray},
- [2] = {bold = true, reverse = true},
- [3] = {reverse = true},
- [4] = {bold = true},
- [5] = {background = Screen.colors.Yellow},
- [6] = {background = Screen.colors.LightGrey},
- } )
- end)
- describe("match and conceal", function()
- before_each(function()
- command("let &conceallevel=1")
- end)
- describe("multiple", function()
- before_each(function()
- insert([[
- &&
- &&
- &&
- &&
- &&
- &&
- ]])
- command("syn match dAmpersand '[&][&]' conceal cchar=∧")
- end)
- it("double characters.", function()
- screen:expect([[
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- ^ |
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- it('double characters and move the cursor one line up.', function()
- feed("k")
- screen:expect([[
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- ^&& |
- |
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- it('double characters and move the cursor to the beginning of the file.', function()
- feed("gg")
- screen:expect([[
- ^&& |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- |
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- it('double characters and move the cursor to the second line in the file.', function()
- feed("ggj")
- screen:expect([[
- {1:∧} |
- ^&& |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- |
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- it('double characters and then move the cursor to the beginning of the file and back to the end of the file.', function()
- feed("ggG")
- screen:expect([[
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- {1:∧} |
- ^ |
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- end) -- multiple
- it("keyword instances in initially in the document.", function()
- feed("2ilambda<cr><ESC>")
- command("let &conceallevel=1")
- command("syn keyword kLambda lambda conceal cchar=λ")
- screen:expect([[
- {1:λ} |
- {1:λ} |
- ^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- end) -- Keyword
- describe("regions in the document", function()
- before_each(function()
- feed("2")
- insert("<r> a region of text </r>\n")
- command("let &conceallevel=1")
- end)
- it('initially and conceal it.', function()
- command("syn region rText start='<r>' end='</r>' conceal cchar=R")
- screen:expect([[
- {1:R} |
- {1:R} |
- ^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- it('initially and conceal its start tag and end tag.', function()
- -- concealends has a known bug (todo.txt) where the first match won't
- -- be replaced with cchar.
- command("syn region rText matchgroup=rMatch start='<r>' end='</r>' concealends cchar=-")
- screen:expect([[
- {1: } a region of text {1:-} |
- {1: } a region of text {1:-} |
- ^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- it('that are nested and conceal the nested region\'s start and end tags.', function()
- command("syn region rText contains=rText matchgroup=rMatch start='<r>' end='</r>' concealends cchar=-")
- insert("<r> A region with <r> a nested <r> nested region.</r> </r> </r>\n")
- screen:expect([[
- {1: } a region of text {1:-} |
- {1: } a region of text {1:-} |
- {1: } A region with {1: } a nested {1: } nested region.{1:-} |
- {1:-} {1:-} |
- ^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- end) -- regions in the document
- describe("a region of text", function()
- before_each(function()
- command("syntax conceal on")
- feed("2")
- insert("<r> a region of text </r>\n")
- command("syn region rText start='<r>' end='</r>' cchar=-")
- end)
- it("and turn on implicit concealing", function()
- screen:expect([[
- {1:-} |
- {1:-} |
- ^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- it("and then turn on, then off, and then back on implicit concealing.", function()
- command("syntax conceal off")
- feed("2")
- insert("<i> italian text </i>\n")
- command("syn region iText start='<i>' end='</i>' cchar=*")
- screen:expect([[
- {1:-} |
- {1:-} |
- <i> italian text </i> |
- <i> italian text </i> |
- ^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- command("syntax conceal on")
- command("syn region iText start='<i>' end='</i>' cchar=*")
- screen:expect([[
- {1:-} |
- {1:-} |
- {1:*} |
- {1:*} |
- ^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- end) -- a region of text (implicit concealing)
- end) -- match and conceal
- describe("let the conceal level be", function()
- before_each(function()
- insert("// No Conceal\n")
- insert('"Conceal without a cchar"\n')
- insert("+ With cchar\n\n")
- command("syn match noConceal '^//.*$'")
- command("syn match concealNoCchar '\".\\{-}\"$' conceal")
- command("syn match concealWCchar '^+.\\{-}$' conceal cchar=C")
- end)
- it("0. No concealing.", function()
- command("let &conceallevel=0")
- screen:expect([[
- // No Conceal |
- "Conceal without a cchar" |
- + With cchar |
- |
- ^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- it("1. Conceal using cchar or reference listchars.", function()
- command("let &conceallevel=1")
- screen:expect([[
- // No Conceal |
- {1: } |
- {1:C} |
- |
- ^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- it("2. Hidden unless cchar is set.", function()
- command("let &conceallevel=2")
- screen:expect([[
- // No Conceal |
- |
- {1:C} |
- |
- ^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- it("3. Hide all concealed text.", function()
- command("let &conceallevel=3")
- screen:expect([[
- // No Conceal |
- |
- |
- |
- ^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- end) -- conceallevel
- describe("cursor movement", function()
- before_each(function()
- command("syn keyword concealy barf conceal cchar=b")
- command("set cole=2")
- feed('5Ofoo barf bar barf eggs<esc>')
- screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo barf bar barf egg^s |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- it('between windows', function()
- feed('k')
- command("split")
- screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo barf bar barf egg^s |
- foo {1:b} bar {1:b} eggs |
- |
- {2:[No Name] [+] }|
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- {3:[No Name] [+] }|
- |
- ]])
- feed('<c-w>w')
- screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {3:[No Name] [+] }|
- foo {1:b} bar {1:b} eggs |
- foo barf bar barf egg^s |
- foo {1:b} bar {1:b} eggs |
- {2:[No Name] [+] }|
- |
- ]])
- end)
- it('in insert mode', function()
- feed('i')
- screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo barf bar barf egg^s |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {4:-- INSERT --} |
- ]])
- feed('<up>')
- screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo barf bar barf egg^s |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {4:-- INSERT --} |
- ]])
- end)
- it('between modes cocu=iv', function()
- command('set cocu=iv')
- feed('gg')
- screen:expect([[
- ^foo barf bar barf eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- feed('i')
- screen:expect([[
- ^foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {4:-- INSERT --} |
- ]])
- feed('<esc>')
- screen:expect([[
- ^foo barf bar barf eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- feed('v')
- screen:expect([[
- ^foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {4:-- VISUAL --} |
- ]])
- feed('<esc>')
- screen:expect([[
- ^foo barf bar barf eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- it('between modes cocu=n', function()
- command('set cocu=n')
- feed('gg')
- screen:expect([[
- ^foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- feed('i')
- screen:expect([[
- ^foo barf bar barf eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {4:-- INSERT --} |
- ]])
- feed('<esc>')
- screen:expect([[
- ^foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- feed('v')
- screen:expect([[
- ^foo barf bar barf eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {4:-- VISUAL --} |
- ]])
- feed('<esc>')
- screen:expect([[
- ^foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- it('and open line', function()
- feed('o')
- screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- ^ |
- |
- {0:~ }|
- {0:~ }|
- {4:-- INSERT --} |
- ]])
- end)
- it('and open line cocu=i', function()
- command('set cocu=i')
- feed('o')
- screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- ^ |
- |
- {0:~ }|
- {0:~ }|
- {4:-- INSERT --} |
- ]])
- end)
- describe('with incsearch', function()
- before_each(function()
- command('set incsearch hlsearch')
- feed('2GA x<esc>3GA xy<esc>gg')
- screen:expect([[
- ^foo barf bar barf eggs |
- foo {1:b} bar {1:b} eggs x |
- foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- it('cocu=', function()
- feed('/')
- screen:expect([[
- foo barf bar barf eggs |
- foo {1:b} bar {1:b} eggs x |
- foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- /^ |
- ]])
- feed('x')
- screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo barf bar barf eggs {3:x} |
- foo {1:b} bar {1:b} eggs {5:x}y |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- /x^ |
- ]])
- feed('y')
- screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs x |
- foo barf bar barf eggs {3:xy} |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- /xy^ |
- ]])
- feed('<c-w>')
- screen:expect([[
- foo barf bar barf eggs |
- foo {1:b} bar {1:b} eggs x |
- foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- /^ |
- ]])
- end)
- it('cocu=c', function()
- command('set cocu=c')
- feed('/')
- -- NB: we don't do this redraw. Probably best to still skip it,
- -- to avoid annoying distraction from the cmdline
- screen:expect([[
- foo barf bar barf eggs |
- foo {1:b} bar {1:b} eggs x |
- foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- /^ |
- ]])
- feed('x')
- screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs {3:x} |
- foo {1:b} bar {1:b} eggs {5:x}y |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- /x^ |
- ]])
- feed('y')
- screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs x |
- foo {1:b} bar {1:b} eggs {3:xy} |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- /xy^ |
- ]])
- feed('<c-w>')
- screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs x |
- foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- /^ |
- ]])
- feed('<esc>')
- screen:expect([[
- ^foo barf bar barf eggs |
- foo {1:b} bar {1:b} eggs x |
- foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- it('cocu=n', function()
- command('set cocu=n')
- screen:expect([[
- ^foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs x |
- foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- feed('/')
- -- NB: we don't do this redraw. Probably best to still skip it,
- -- to avoid annoying distraction from the cmdline
- screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs x |
- foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- /^ |
- ]])
- feed('x')
- screen:expect([[
- foo {1:b} bar {1:b} eggs |
- foo barf bar barf eggs {3:x} |
- foo {1:b} bar {1:b} eggs {5:x}y |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- /x^ |
- ]])
- feed('<c-w>')
- screen:expect([[
- foo barf bar barf eggs |
- foo {1:b} bar {1:b} eggs x |
- foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- /^ |
- ]])
- feed('<esc>')
- screen:expect([[
- ^foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs x |
- foo {1:b} bar {1:b} eggs xy |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]])
- end)
- end)
- it('redraws properly with concealcursor in visual mode', function()
- command('set concealcursor=v conceallevel=2')
- feed('10Ofoo barf bar barf eggs<esc>')
- feed(':3<cr>o a<Esc>ggV')
- screen:expect{grid=[[
- ^f{6:oo }{1:b}{6: bar }{1:b}{6: eggs} |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- a |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- {4:-- VISUAL LINE --} |
- ]]}
- feed(string.rep('j', 15))
- screen:expect{grid=[[
- {6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
- {6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
- {6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
- {6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
- {6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
- {6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
- {6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
- {6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
- ^f{6:oo }{1:b}{6: bar }{1:b}{6: eggs} |
- {4:-- VISUAL LINE --} |
- ]]}
- feed(string.rep('k', 15))
- screen:expect{grid=[[
- ^f{6:oo }{1:b}{6: bar }{1:b}{6: eggs} |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- a |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- foo {1:b} bar {1:b} eggs |
- {4:-- VISUAL LINE --} |
- ]]}
- end)
- end)
- it('redraws not too much with conceallevel=1', function()
- command('set conceallevel=1')
- command('set redrawdebug+=nodelta')
- insert([[
- aaa
- bbb
- ccc
- ]])
- screen:expect{grid=[[
- aaa |
- bbb |
- ccc |
- ^ |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]]}
- -- XXX: hack to get notifications, and check only a single line is
- -- updated. Could use next_msg() also.
- local orig_handle_grid_line = screen._handle_grid_line
- local grid_lines = {}
- function screen._handle_grid_line(self, grid, row, col, items)
- table.insert(grid_lines, {row, col, items})
- orig_handle_grid_line(self, grid, row, col, items)
- end
- feed('k')
- screen:expect{grid=[[
- aaa |
- bbb |
- ^ccc |
- |
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- {0:~ }|
- |
- ]]}
- eq(grid_lines, {{2, 0, {{'c', 0, 3}}}})
- end)
- end)
|