mirror of
https://github.com/neovim/neovim.git
synced 2025-09-19 09:48:19 +00:00
vim-patch:9.0.1583: get E304 when using 'cryptmethod' "xchacha20v2" (#23790)
Problem: Get E304 when using 'cryptmethod' "xchacha20v2". (Steve Mynott)
Solution: Add 4th crypt method to block zero ID check. Avoid syncing a swap
file before reading the file. (closes vim/vim#12433)
3a2a60ce4a
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -248,6 +248,11 @@ int open_buffer(int read_stdin, exarg_T *eap, int flags_arg)
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
// Do not sync this buffer yet, may first want to read the file.
|
||||
if (curbuf->b_ml.ml_mfp != NULL) {
|
||||
curbuf->b_ml.ml_mfp->mf_dirty = MF_DIRTY_YES_NOSYNC;
|
||||
}
|
||||
|
||||
// The autocommands in readfile() may change the buffer, but only AFTER
|
||||
// reading the file.
|
||||
set_bufref(&old_curbuf, curbuf);
|
||||
@@ -316,6 +321,12 @@ int open_buffer(int read_stdin, exarg_T *eap, int flags_arg)
|
||||
}
|
||||
}
|
||||
|
||||
// Can now sync this buffer in ml_sync_all().
|
||||
if (curbuf->b_ml.ml_mfp != NULL
|
||||
&& curbuf->b_ml.ml_mfp->mf_dirty == MF_DIRTY_YES_NOSYNC) {
|
||||
curbuf->b_ml.ml_mfp->mf_dirty = MF_DIRTY_YES;
|
||||
}
|
||||
|
||||
// if first time loading this buffer, init b_chartab[]
|
||||
if (curbuf->b_flags & BF_NEVERLOADED) {
|
||||
(void)buf_init_chartab(curbuf, false);
|
||||
|
Reference in New Issue
Block a user