mirror of
https://github.com/neovim/neovim.git
synced 2026-08-28 10:01:49 +00:00
fix(ui2): emit FileType event after setting default pager options #36315
Problem: Setting a filetype before configuring default options for ui2 buffers (pager, cmd, ...) prevents users from setting their own options. Solution: Call nvim_set_option_value after defaults are set. Closes #36314 Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
-- Tests for (protocol-driven) ui2, intended to replace the legacy message grid UI.
|
||||
|
||||
local t = require('test.testutil')
|
||||
local n = require('test.functional.testnvim')()
|
||||
local Screen = require('test.functional.ui.screen')
|
||||
|
||||
@@ -418,4 +419,23 @@ describe('messages2', function()
|
||||
|
|
||||
]])
|
||||
end)
|
||||
|
||||
it('FileType is fired after default options are set', function()
|
||||
n.exec([[
|
||||
let g:set = {}
|
||||
au FileType pager set nowrap
|
||||
au OptionSet * let g:set[expand('<amatch>')] = g:set->get(expand('<amatch>'), 0) + 1
|
||||
echom 'foo'->repeat(&columns)
|
||||
messages
|
||||
]])
|
||||
screen:expect([[
|
||||
|
|
||||
{1:~ }|*9
|
||||
{3:─────────────────────────────────────────────────────}|
|
||||
^foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofo|
|
||||
{1: }|
|
||||
|
|
||||
]])
|
||||
t.eq({ filetype = 4 }, n.eval('g:set')) -- still fires for 'filetype'
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user