comparison src/buffer.c @ 32503:5d07e7e9580f v9.0.1583

patch 9.0.1583: get E304 when using 'cryptmethod' "xchacha20v2" Commit: https://github.com/vim/vim/commit/3a2a60ce4a8e73594bca16814672fcc243d093ac Author: Bram Moolenaar <Bram@vim.org> Date: Sat May 27 18:02:55 2023 +0100 patch 9.0.1583: get E304 when using 'cryptmethod' "xchacha20v2" 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 #12433)
author Bram Moolenaar <Bram@vim.org>
date Sat, 27 May 2023 19:15:04 +0200
parents 2707c75175c6
children 448aef880252
comparison
equal deleted inserted replaced
32502:b1bb97d879b6 32503:5d07e7e9580f
216 check_colorcolumn(curwin); 216 check_colorcolumn(curwin);
217 #endif 217 #endif
218 return FAIL; 218 return FAIL;
219 } 219 }
220 220
221 // Do not sync this buffer yet, may first want to read the file.
222 if (curbuf->b_ml.ml_mfp != NULL)
223 curbuf->b_ml.ml_mfp->mf_dirty = MF_DIRTY_YES_NOSYNC;
224
221 // The autocommands in readfile() may change the buffer, but only AFTER 225 // The autocommands in readfile() may change the buffer, but only AFTER
222 // reading the file. 226 // reading the file.
223 set_bufref(&old_curbuf, curbuf); 227 set_bufref(&old_curbuf, curbuf);
224 modified_was_set = FALSE; 228 modified_was_set = FALSE;
225 229
295 flags | (READ_NEW + READ_STDIN)); 299 flags | (READ_NEW + READ_STDIN));
296 curbuf->b_p_bin = save_bin; 300 curbuf->b_p_bin = save_bin;
297 if (retval == OK) 301 if (retval == OK)
298 retval = read_buffer(TRUE, eap, flags); 302 retval = read_buffer(TRUE, eap, flags);
299 } 303 }
304
305 // Can now sync this buffer in ml_sync_all().
306 if (curbuf->b_ml.ml_mfp != NULL
307 && curbuf->b_ml.ml_mfp->mf_dirty == MF_DIRTY_YES_NOSYNC)
308 curbuf->b_ml.ml_mfp->mf_dirty = MF_DIRTY_YES;
300 309
301 // if first time loading this buffer, init b_chartab[] 310 // if first time loading this buffer, init b_chartab[]
302 if (curbuf->b_flags & BF_NEVERLOADED) 311 if (curbuf->b_flags & BF_NEVERLOADED)
303 { 312 {
304 (void)buf_init_chartab(curbuf, FALSE); 313 (void)buf_init_chartab(curbuf, FALSE);