mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 16:28:17 +00:00
vim-patch:8.2.3227: 'virtualedit' can only be set globally
Problem: 'virtualedit' can only be set globally.
Solution: Make 'virtualedit' global-local. (Gary Johnson, closes vim/vim#8638)
53ba05b090
I changed some macros to unsigned integer literals to avoid compiler warnings.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "nvim/memline.h"
|
||||
#include "nvim/memory.h"
|
||||
#include "nvim/move.h"
|
||||
#include "nvim/option.h"
|
||||
#include "nvim/plines.h"
|
||||
#include "nvim/screen.h"
|
||||
#include "nvim/state.h"
|
||||
@@ -110,7 +111,7 @@ static int coladvance2(pos_T *pos, bool addspaces, bool finetune, colnr_T wcol_a
|
||||
|| (State & TERM_FOCUS)
|
||||
|| restart_edit != NUL
|
||||
|| (VIsual_active && *p_sel != 'o')
|
||||
|| ((ve_flags & VE_ONEMORE) && wcol < MAXCOL);
|
||||
|| ((get_ve_flags() & VE_ONEMORE) && wcol < MAXCOL);
|
||||
line = ml_get_buf(curbuf, pos->lnum, false);
|
||||
|
||||
if (wcol >= MAXCOL) {
|
||||
@@ -366,6 +367,7 @@ void check_cursor_col_win(win_T *win)
|
||||
colnr_T len;
|
||||
colnr_T oldcol = win->w_cursor.col;
|
||||
colnr_T oldcoladd = win->w_cursor.col + win->w_cursor.coladd;
|
||||
unsigned int cur_ve_flags = get_ve_flags();
|
||||
|
||||
len = (colnr_T)STRLEN(ml_get_buf(win->w_buffer, win->w_cursor.lnum, false));
|
||||
if (len == 0) {
|
||||
@@ -377,7 +379,7 @@ void check_cursor_col_win(win_T *win)
|
||||
* - 'virtualedit' is set */
|
||||
if ((State & INSERT) || restart_edit
|
||||
|| (VIsual_active && *p_sel != 'o')
|
||||
|| (ve_flags & VE_ONEMORE)
|
||||
|| (cur_ve_flags & VE_ONEMORE)
|
||||
|| virtual_active()) {
|
||||
win->w_cursor.col = len;
|
||||
} else {
|
||||
@@ -394,7 +396,7 @@ void check_cursor_col_win(win_T *win)
|
||||
// line.
|
||||
if (oldcol == MAXCOL) {
|
||||
win->w_cursor.coladd = 0;
|
||||
} else if (ve_flags == VE_ALL) {
|
||||
} else if (cur_ve_flags == VE_ALL) {
|
||||
if (oldcoladd > win->w_cursor.col) {
|
||||
win->w_cursor.coladd = oldcoladd - win->w_cursor.col;
|
||||
|
||||
|
Reference in New Issue
Block a user