@@ -58,9 +58,9 @@ function View.get_view(view, opts)
58
58
end
59
59
end
60
60
61
+ --- @type NoiceView
61
62
local mod = require (" noice.view.backend." .. opts .backend )
62
63
local init_opts = vim .deepcopy (opts )
63
- --- @type NoiceView
64
64
local ret = mod (opts )
65
65
if not ret :is_available () and opts .fallback then
66
66
return View .get_view (opts .fallback , opts_orig )
@@ -194,12 +194,19 @@ function View:set_win_options(win)
194
194
if self ._opts .win_options then
195
195
require (" nui.utils" )._ .set_win_options (win , self ._opts .win_options )
196
196
end
197
- vim .schedule (function ()
198
- vim .api .nvim_win_set_cursor (win , { 1 , 0 })
199
- vim .api .nvim_win_call (win , function ()
200
- vim .cmd ([[ noautocmd silent! normal! zt]] )
197
+ -- reset cursor on show
198
+ vim .api .nvim_win_set_cursor (win , { 1 , 0 })
199
+ if self ._opts .type == " split" then
200
+ vim .schedule (function ()
201
+ -- this is needed to make the nui split behave with vim.go.splitkeep
202
+ if win and vim .api .nvim_win_is_valid (win ) then
203
+ vim .api .nvim_win_set_cursor (win , { 1 , 0 })
204
+ vim .api .nvim_win_call (win , function ()
205
+ vim .cmd ([[ noautocmd silent! normal! zt]] )
206
+ end )
207
+ end
201
208
end )
202
- end )
209
+ end
203
210
end
204
211
205
212
--- @param buf number buffer number
0 commit comments