comparison src/edit.c @ 30833:e3d5781c7ec6 v9.0.0751

patch 9.0.0751: 'scrolloff' does not work well with 'smoothscroll' Commit: https://github.com/vim/vim/commit/c9121f798f49fa71e814912cb186d89c164090c3 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Oct 14 20:09:04 2022 +0100 patch 9.0.0751: 'scrolloff' does not work well with 'smoothscroll' Problem: 'scrolloff' does not work well with 'smoothscroll'. Solution: Make positioning the cursor a bit better. Rename functions.
author Bram Moolenaar <Bram@vim.org>
date Fri, 14 Oct 2022 21:15:03 +0200
parents c7983f593fa7
children 33ca088dbd3e
comparison
equal deleted inserted replaced
30832:64fffffc3295 30833:e3d5781c7ec6
235 { 235 {
236 Insstart = curwin->w_cursor; 236 Insstart = curwin->w_cursor;
237 if (startln) 237 if (startln)
238 Insstart.col = 0; 238 Insstart.col = 0;
239 } 239 }
240 Insstart_textlen = (colnr_T)linetabsize(ml_get_curline()); 240 Insstart_textlen = (colnr_T)linetabsize_str(ml_get_curline());
241 Insstart_blank_vcol = MAXCOL; 241 Insstart_blank_vcol = MAXCOL;
242 if (!did_ai) 242 if (!did_ai)
243 ai_col = 0; 243 ai_col = 0;
244 244
245 if (cmdchar != NUL && restart_edit == 0) 245 if (cmdchar != NUL && restart_edit == 0)
2370 Insstart = curwin->w_cursor; // new insertion starts here 2370 Insstart = curwin->w_cursor; // new insertion starts here
2371 if (Insstart.col > Insstart_orig.col && !ins_need_undo) 2371 if (Insstart.col > Insstart_orig.col && !ins_need_undo)
2372 // Don't update the original insert position when moved to the 2372 // Don't update the original insert position when moved to the
2373 // right, except when nothing was inserted yet. 2373 // right, except when nothing was inserted yet.
2374 update_Insstart_orig = FALSE; 2374 update_Insstart_orig = FALSE;
2375 Insstart_textlen = (colnr_T)linetabsize(ml_get_curline()); 2375 Insstart_textlen = (colnr_T)linetabsize_str(ml_get_curline());
2376 2376
2377 if (u_save_cursor() == OK) 2377 if (u_save_cursor() == OK)
2378 { 2378 {
2379 arrow_used = FALSE; 2379 arrow_used = FALSE;
2380 ins_need_undo = FALSE; 2380 ins_need_undo = FALSE;