File tree 1 file changed +16
-3
lines changed
1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -249,23 +249,36 @@ local move_tbl = {
249
249
top = ' K' ,
250
250
}
251
251
252
+ -- TODO: remove this once they fix https://github.com/neovim/neovim/issues/14670
253
+ local function set_local (opt , value )
254
+ local cmd
255
+ if value == true then
256
+ cmd = string.format (' setlocal %s' , opt )
257
+ elseif value == false then
258
+ cmd = string.format (' setlocal no%s' , opt )
259
+ else
260
+ cmd = string.format (' setlocal %s=%s' , opt , value )
261
+ end
262
+ vim .cmd (cmd )
263
+ end
264
+
252
265
function M .open ()
253
266
if not is_buf_valid () then
254
267
M .setup ()
255
268
end
256
269
257
270
a .nvim_command (" vsp" )
271
+
258
272
local move_to = move_tbl [M .View .side ]
259
273
a .nvim_command (" wincmd " .. move_to )
260
274
a .nvim_command (" vertical resize " .. get_width ())
261
275
local winnr = a .nvim_get_current_win ()
262
276
local tabpage = a .nvim_get_current_tabpage ()
263
277
M .View .tabpages [tabpage ] = vim .tbl_extend (" force" , M .View .tabpages [tabpage ] or {help = false }, {winnr = winnr })
278
+ vim .cmd (" buffer " .. M .View .bufnr )
264
279
for k , v in pairs (M .View .winopts ) do
265
- vim . wo [ winnr ][ k ] = v
280
+ set_local ( k , v )
266
281
end
267
-
268
- vim .cmd (" buffer " .. M .View .bufnr )
269
282
vim .cmd " :wincmd ="
270
283
end
271
284
You can’t perform that action at this time.
0 commit comments