diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-01-27 08:41:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-27 08:41:29 +0100 |
commit | 95b8a8f6aed2057dbbb745c703612d1ace5eb2b2 (patch) | |
tree | 44536cd5ed3a26d747d43e69f9214fd2c4a858cd /src/nvim/normal.c | |
parent | 480fbbe296d4cad860855fc62a9d8296e915c8df (diff) | |
parent | 176df92bd7f8a3c8755b2a16e021489ca03db747 (diff) | |
download | rneovim-95b8a8f6aed2057dbbb745c703612d1ace5eb2b2.tar.gz rneovim-95b8a8f6aed2057dbbb745c703612d1ace5eb2b2.tar.bz2 rneovim-95b8a8f6aed2057dbbb745c703612d1ace5eb2b2.zip |
Merge pull request #17131 from zeertzjq/vim-8.2.3580
vim-patch:8.2.3580: gj does not move properly with a wide character
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r-- | src/nvim/normal.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 8f1751d483..5838918558 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -3281,7 +3281,7 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist) int col_off1; // margin offset for first screen line int col_off2; // margin offset for wrapped screen line int width1; // text width for first screen line - int width2; // test width for wrapped screen line + int width2; // text width for wrapped screen line oap->motion_type = kMTCharWise; oap->inclusive = (curwin->w_curswant == MAXCOL); @@ -3405,6 +3405,13 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist) virtcol -= vim_strsize(get_showbreak_value(curwin)); } + int c = utf_ptr2char(get_cursor_pos_ptr()); + if (dir == FORWARD && virtcol < curwin->w_curswant + && (curwin->w_curswant <= (colnr_T)width1) + && !vim_isprintc(c) && c > 255) { + oneright(); + } + if (virtcol > curwin->w_curswant && (curwin->w_curswant < (colnr_T)width1 ? (curwin->w_curswant > (colnr_T)width1 / 2) |