diff options
author | ZyX <kp-pav@yandex.ru> | 2016-07-26 23:16:23 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-03-29 10:05:06 +0300 |
commit | fb146e80aa1ead96518f38b9684e39249bc83485 (patch) | |
tree | 8a157d55108b19ae40cc85817b2620bdcf809905 /src/nvim/cursor.c | |
parent | 18e7d552008b92dd3ecd42bf6855530838fd22ab (diff) | |
download | rneovim-fb146e80aa1ead96518f38b9684e39249bc83485.tar.gz rneovim-fb146e80aa1ead96518f38b9684e39249bc83485.tar.bz2 rneovim-fb146e80aa1ead96518f38b9684e39249bc83485.zip |
eval: Split eval.c into smaller files
Diffstat (limited to 'src/nvim/cursor.c')
-rw-r--r-- | src/nvim/cursor.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/nvim/cursor.c b/src/nvim/cursor.c index 82f1bf0a16..45abd314fc 100644 --- a/src/nvim/cursor.c +++ b/src/nvim/cursor.c @@ -12,6 +12,7 @@ #include "nvim/state.h" #include "nvim/vim.h" #include "nvim/ascii.h" +#include "nvim/mark.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "cursor.c.generated.h" @@ -227,9 +228,10 @@ static int coladvance2( } } - /* prevent from moving onto a trail byte */ - if (has_mbyte) - mb_adjustpos(curbuf, pos); + // Prevent from moving onto a trail byte. + if (has_mbyte) { + mark_mb_adjustpos(curbuf, pos); + } if (col < wcol) return FAIL; @@ -361,9 +363,10 @@ void check_cursor_col_win(win_T *win) win->w_cursor.col = len; } else { win->w_cursor.col = len - 1; - /* Move the cursor to the head byte. */ - if (has_mbyte) - mb_adjustpos(win->w_buffer, &win->w_cursor); + // Move the cursor to the head byte. + if (has_mbyte) { + mark_mb_adjustpos(win->w_buffer, &win->w_cursor); + } } } else if (win->w_cursor.col < 0) { win->w_cursor.col = 0; |