File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 198
198
local function should_hijack_current_buf ()
199
199
local bufnr = vim .api .nvim_get_current_buf ()
200
200
local bufname = vim .api .nvim_buf_get_name (bufnr )
201
- local bufmodified = vim .api .nvim_buf_get_option (bufnr , " modified" )
202
- local ft = vim .api .nvim_buf_get_option (bufnr , " ft" )
201
+
202
+ local bufmodified , ft
203
+ if vim .fn .has " nvim-0.10" == 1 then
204
+ bufmodified = vim .api .nvim_get_option_value (" modified" , { buf = bufnr })
205
+ ft = vim .api .nvim_get_option_value (" ft" , { buf = bufnr })
206
+ else
207
+ bufmodified = vim .api .nvim_buf_get_option (bufnr , " modified" ) --- @diagnostic disable-line : deprecated
208
+ ft = vim .api .nvim_buf_get_option (bufnr , " ft" ) --- @diagnostic disable-line : deprecated
209
+ end
203
210
204
211
local should_hijack_unnamed = M .hijack_unnamed_buffer_when_opening and bufname == " " and not bufmodified and ft == " "
205
212
local should_hijack_dir = bufname ~= " " and vim .fn .isdirectory (bufname ) == 1 and M .hijack_directories .enable
You can’t perform that action at this time.
0 commit comments