aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/mode_spec.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-03-26 21:23:36 +0100
committerbfredl <bjorn.linse@gmail.com>2024-03-26 21:28:05 +0100
commit35f2bb05a5cb84af405a094f040b92461a824e61 (patch)
tree157ba34b5e8673092405b9b3dfd70bcba180590e /test/functional/ui/mode_spec.lua
parent0c0be09eab66975e62c67522620fee10f82663d2 (diff)
downloadrneovim-35f2bb05a5cb84af405a094f040b92461a824e61.tar.gz
rneovim-35f2bb05a5cb84af405a094f040b92461a824e61.tar.bz2
rneovim-35f2bb05a5cb84af405a094f040b92461a824e61.zip
refactor(tests): use new global defaults instead of set_default_attr_ids
This will be done in batches.
Diffstat (limited to 'test/functional/ui/mode_spec.lua')
-rw-r--r--test/functional/ui/mode_spec.lua69
1 files changed, 31 insertions, 38 deletions
diff --git a/test/functional/ui/mode_spec.lua b/test/functional/ui/mode_spec.lua
index 8d7fae3e91..262b63977b 100644
--- a/test/functional/ui/mode_spec.lua
+++ b/test/functional/ui/mode_spec.lua
@@ -12,20 +12,13 @@ describe('ui mode_change event', function()
clear()
screen = Screen.new(25, 4)
screen:attach({ rgb = true })
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = 255 },
- [1] = { bold = true, reverse = true },
- [2] = { bold = true },
- [3] = { reverse = true },
- [4] = { background = Screen.colors.Red, foreground = Screen.colors.White }, -- ErrorMsg
- })
end)
it('works in normal mode', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -35,7 +28,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'operator',
@@ -45,7 +38,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -61,7 +54,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'operator',
@@ -71,8 +64,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
- {4:E21: Cannot make changes, 'modifiable' is off} |
+ {1:~ }|*2
+ {9:E21: Cannot make changes, 'modifiable' is off} |
]],
mode = 'normal',
}
@@ -84,7 +77,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'replace',
@@ -94,7 +87,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -106,8 +99,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
- {2:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]],
mode = 'insert',
}
@@ -116,7 +109,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
wor^d |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -133,8 +126,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
word(stuff^ |
- {0:~ }|*2
- {2:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]],
mode = 'insert',
timeout = screen_timeout,
@@ -144,8 +137,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
word^(stuff) |
- {0:~ }|*2
- {2:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]],
mode = 'showmatch',
timeout = screen_timeout,
@@ -154,8 +147,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
word(stuff)^ |
- {0:~ }|*2
- {2:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]],
mode = 'insert',
timeout = screen_timeout,
@@ -168,8 +161,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
- {2:-- REPLACE --} |
+ {1:~ }|*2
+ {5:-- REPLACE --} |
]],
mode = 'replace',
}
@@ -178,7 +171,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
wor^d |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -190,7 +183,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
|
- {0:~ }|*2
+ {1:~ }|*2
:^ |
]],
mode = 'cmdline_normal',
@@ -200,7 +193,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
|
- {0:~ }|*2
+ {1:~ }|*2
:^x |
]],
mode = 'cmdline_insert',
@@ -210,7 +203,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
|
- {0:~ }|*2
+ {1:~ }|*2
:^x |
]],
mode = 'cmdline_replace',
@@ -220,7 +213,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
|
- {0:~ }|*2
+ {1:~ }|*2
:x^ |
]],
mode = 'cmdline_normal',
@@ -230,7 +223,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -243,8 +236,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
tex^t |
- {0:~ }|*2
- {2:-- VISUAL --} |
+ {1:~ }|*2
+ {5:-- VISUAL --} |
]],
mode = 'visual',
}
@@ -253,7 +246,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
tex^t |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -264,8 +257,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
tex^t |
- {0:~ }|*2
- {2:-- VISUAL --} |
+ {1:~ }|*2
+ {5:-- VISUAL --} |
]],
mode = 'visual_select',
}
@@ -274,7 +267,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
tex^t |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',