diff options
| author | Yochem van Rosmalen <git@yochem.nl> | 2025-07-23 13:36:18 +0200 |
|---|---|---|
| committer | Christian Clason <ch.clason+github@icloud.com> | 2025-07-23 13:57:27 +0200 |
| commit | 0dcdd65dcc08483d9a5c106f62b862a9de30983e (patch) | |
| tree | 15cf896bb78812cdf0b50044afcc17360a00de09 /runtime/plugin | |
| parent | 61c4a6b3a9530f3774e3f2e15fdf1edb50f7f4e0 (diff) | |
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.
Diffstat (limited to 'runtime/plugin')
| -rw-r--r-- | runtime/plugin/shada.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/plugin/shada.lua b/runtime/plugin/shada.lua index e1517de626..f8edb3ec71 100644 --- a/runtime/plugin/shada.lua +++ b/runtime/plugin/shada.lua @@ -52,8 +52,8 @@ end) def_autocmd('BufWriteCmd', {}, function(ev) local buflines = vim.api.nvim_buf_get_lines(0, 0, -1, false) - local err = vim.fn.writefile(shada_get_binstrings(buflines), ev.file, 'b') - if not err then + local ret = vim.fn.writefile(shada_get_binstrings(buflines), ev.file, 'b') + if ret == 0 then vim.bo[ev.buf].modified = false end end) |
