File tree 1 file changed +13
-11
lines changed
1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,18 @@ function NuiView:create()
127
127
local opts = vim .deepcopy (self ._opts )
128
128
self ._nui = self ._opts .type == " split" and require (" nui.split" )(opts ) or require (" nui.popup" )(opts )
129
129
130
+ self :mount ()
131
+ self :update_layout ()
132
+ self ._scroll = Scrollbar ({
133
+ winnr = self ._nui .winid ,
134
+ padding = Util .nui .normalize_padding (self ._opts .border ),
135
+ })
136
+ self ._scroll :mount ()
137
+ self ._loading = false
138
+ end
139
+
140
+ function NuiView :mount ()
141
+ self ._nui :mount ()
130
142
if self ._opts .close and self ._opts .close .events then
131
143
self ._nui :on (self ._opts .close .events , function ()
132
144
self :hide ()
@@ -138,16 +150,6 @@ function NuiView:create()
138
150
self :hide ()
139
151
end , { remap = false , nowait = true })
140
152
end
141
-
142
- self ._nui :mount ()
143
-
144
- self :update_layout ()
145
- self ._scroll = Scrollbar ({
146
- winnr = self ._nui .winid ,
147
- padding = Util .nui .normalize_padding (self ._opts .border ),
148
- })
149
- self ._scroll :mount ()
150
- self ._loading = false
151
153
end
152
154
153
155
--- @param old NoiceNuiOptions
@@ -259,7 +261,7 @@ function NuiView:show()
259
261
end
260
262
261
263
if not self ._nui ._ .mounted then
262
- self . _nui :mount ()
264
+ self :mount ()
263
265
end
264
266
265
267
vim .bo [self ._nui .bufnr ].modifiable = true
You can’t perform that action at this time.
0 commit comments