mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +00:00
vim-patch:9.1.0039: too vague errors for 'listchars'/'fillchars' (#27070)
Problem: too vague errors for 'listchars'/'fillchars'
Solution: Include the field name in error message.
(zeertzjq)
related: #27050
closes: vim/vim#13877
6a8d2e1634
Co-authored-by: Cole Frankenhoff <cole.nhf@gmail.com>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
local helpers = require('test.functional.helpers')(after_each)
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
local clear, command = helpers.clear, helpers.command
|
||||
local pcall_err = helpers.pcall_err
|
||||
local eval = helpers.eval
|
||||
local eq = helpers.eq
|
||||
local exc_exec = helpers.exc_exec
|
||||
local insert = helpers.insert
|
||||
local feed = helpers.feed
|
||||
local api = helpers.api
|
||||
@@ -17,11 +17,6 @@ describe("'fillchars'", function()
|
||||
screen:attach()
|
||||
end)
|
||||
|
||||
local function shouldfail(val, errval)
|
||||
errval = errval or val
|
||||
eq('Vim(set):E474: Invalid argument: fillchars=' .. errval, exc_exec('set fillchars=' .. val))
|
||||
end
|
||||
|
||||
describe('"eob" flag', function()
|
||||
it("uses '~' by default", function()
|
||||
eq('', eval('&fillchars'))
|
||||
@@ -64,10 +59,22 @@ describe("'fillchars'", function()
|
||||
end)
|
||||
|
||||
it('handles invalid values', function()
|
||||
shouldfail('eob:') -- empty string
|
||||
shouldfail('eob:馬') -- doublewidth char
|
||||
shouldfail('eob:xy') -- two ascii chars
|
||||
shouldfail('eob:\255', 'eob:<ff>') -- invalid UTF-8
|
||||
eq(
|
||||
'Vim(set):E1511: Wrong number of characters for field "eob": fillchars=eob:',
|
||||
pcall_err(command, 'set fillchars=eob:') -- empty string
|
||||
)
|
||||
eq(
|
||||
'Vim(set):E1512: Wrong character width for field "eob": fillchars=eob:馬',
|
||||
pcall_err(command, 'set fillchars=eob:馬') -- doublewidth char
|
||||
)
|
||||
eq(
|
||||
'Vim(set):E1511: Wrong number of characters for field "eob": fillchars=eob:xy',
|
||||
pcall_err(command, 'set fillchars=eob:xy') -- two ascii chars
|
||||
)
|
||||
eq(
|
||||
'Vim(set):E1512: Wrong character width for field "eob": fillchars=eob:<ff>',
|
||||
pcall_err(command, 'set fillchars=eob:\255') -- invalid UTF-8
|
||||
)
|
||||
end)
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user