mirror of
https://github.com/neovim/neovim.git
synced 2026-04-29 02:34:10 +00:00
fix(ui2): only highlight Ex command lines in the cmdline #38182
Problem: Prompts and message text (in block mode) in the cmdline are
parsed and highlighted as if it is Vimscript.
Entering the cmdline while it is expanded can work more like
it does with UI1, where the press enter prompt is replaced
and previous messages stay on the message grid, while
subsequent messages are placed below it.
Solution: Highlight manually with string parser on lines starting with ':'.
Spoof cmdline block mode when the cmdline is entered while it
is expanded.
This commit is contained in:
@@ -78,17 +78,17 @@ describe('cmdline2', function()
|
||||
{1:~ }|*9
|
||||
{16::}{15:if} {26:1} |
|
||||
{16::} {15:echo} {26:"foo"} |
|
||||
{15:foo} |
|
||||
foo |
|
||||
{16::} ^ |
|
||||
]])
|
||||
feed([[echo input("foo\nbar:")<CR>]])
|
||||
screen:expect([[
|
||||
|
|
||||
{1:~ }|*7
|
||||
:if 1 |
|
||||
: echo "foo" |
|
||||
{16::}{15:if} {26:1} |
|
||||
{16::} {15:echo} {26:"foo"} |
|
||||
foo |
|
||||
: echo input("foo\nbar:") |
|
||||
{16::} {15:echo} {25:input}{16:(}{26:"foo\nbar:"}{16:)} |
|
||||
foo |
|
||||
bar:^ |
|
||||
]])
|
||||
@@ -96,10 +96,10 @@ describe('cmdline2', function()
|
||||
screen:expect([[
|
||||
|
|
||||
{1:~ }|*7
|
||||
:if 1 |
|
||||
: echo "foo" |
|
||||
{16::}{15:if} {26:1} |
|
||||
{16::} {15:echo} {26:"foo"} |
|
||||
foo |
|
||||
: echo input("foo\nbar:") |
|
||||
{16::} {15:echo} {25:input}{16:(}{26:"foo\nbar:"}{16:)} |
|
||||
foo |
|
||||
bar:baz^ |
|
||||
]])
|
||||
@@ -109,11 +109,11 @@ describe('cmdline2', function()
|
||||
{1:~ }|*5
|
||||
{16::}{15:if} {26:1} |
|
||||
{16::} {15:echo} {26:"foo"} |
|
||||
{15:foo} |
|
||||
foo |
|
||||
{16::} {15:echo} {25:input}{16:(}{26:"foo\nbar:"}{16:)} |
|
||||
{15:foo} |
|
||||
{15:bar}:baz |
|
||||
{15:baz} |
|
||||
foo |
|
||||
bar:baz |
|
||||
baz |
|
||||
{16::} ^ |
|
||||
]])
|
||||
feed('endif')
|
||||
@@ -122,11 +122,11 @@ describe('cmdline2', function()
|
||||
{1:~ }|*5
|
||||
{16::}{15:if} {26:1} |
|
||||
{16::} {15:echo} {26:"foo"} |
|
||||
{15:foo} |
|
||||
foo |
|
||||
{16::} {15:echo} {25:input}{16:(}{26:"foo\nbar:"}{16:)} |
|
||||
{15:foo} |
|
||||
{15:bar}:baz |
|
||||
{15:baz} |
|
||||
foo |
|
||||
bar:baz |
|
||||
baz |
|
||||
{16::} {15:endif}^ |
|
||||
]])
|
||||
feed('<CR>')
|
||||
@@ -178,7 +178,7 @@ describe('cmdline2', function()
|
||||
screen:expect([[
|
||||
{10:f}oo |
|
||||
{1:~ }|*12
|
||||
{16::}{15:s}{16:/f}^ |
|
||||
{16::}{15:s}{16:/f^ } |
|
||||
]])
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user