mirror of
https://github.com/neovim/neovim.git
synced 2026-07-14 21:30:34 +00:00
fix(shada): check return value is 0
Problem: Vimscript functions return number to signal ok/error. Lua doesn't convert these to be falsey. Solution: Explicitly check if the return value is 0.
This commit is contained in:
committed by
Christian Clason
parent
61c4a6b3a9
commit
0dcdd65dcc
@@ -52,8 +52,8 @@ end)
|
|||||||
|
|
||||||
def_autocmd('BufWriteCmd', {}, function(ev)
|
def_autocmd('BufWriteCmd', {}, function(ev)
|
||||||
local buflines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
|
local buflines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
|
||||||
local err = vim.fn.writefile(shada_get_binstrings(buflines), ev.file, 'b')
|
local ret = vim.fn.writefile(shada_get_binstrings(buflines), ev.file, 'b')
|
||||||
if not err then
|
if ret == 0 then
|
||||||
vim.bo[ev.buf].modified = false
|
vim.bo[ev.buf].modified = false
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user