From 9d4a4f49ef74f3c14df63e3d32a20830bfa8c7a9 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 22 Jul 2022 21:14:17 +0800 Subject: vim-patch:8.1.1933: the eval.c file is too big (#19462) Problem: The eval.c file is too big. Solution: Move code related to variables to evalvars.c. (Yegappan Lakshmanan, closes vim/vim#4868) https://github.com/vim/vim/commit/0522ba0359c96a8c2a4fc8fca0d3b58e49dda759 Name the new file eval/vars.c instead. --- src/nvim/buffer.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index f937450107..4830b200af 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -37,6 +37,7 @@ #include "nvim/diff.h" #include "nvim/digraph.h" #include "nvim/eval.h" +#include "nvim/eval/vars.h" #include "nvim/ex_cmds.h" #include "nvim/ex_cmds2.h" #include "nvim/ex_docmd.h" -- cgit From 91c99eed540a329b7738bd2f28259f8ac0670ef2 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 23 Jul 2022 09:15:31 +0800 Subject: vim-patch:8.2.4731: the changelist index is not remembered per buffer Problem: The changelist index is not remembered per buffer. Solution: Keep the changelist index per window and buffer. (closes vim/vim#10135, closes vim/vim#2173) https://github.com/vim/vim/commit/db0ea7f2b00c84d84f188c9e9953c4f1887528e7 Cherry-pick FOR_ALL_BUF_WININFO from patch 8.2.0500. Cherry-pick test_changelist.vim change from patch 8.2.3795. --- src/nvim/buffer.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 4830b200af..10ce893fe8 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -2483,6 +2483,9 @@ void buflist_setfpos(buf_T *const buf, win_T *const win, linenr_T lnum, colnr_T wip->wi_mark.view = mark_view_make(win->w_topline, wip->wi_mark.mark); } } + if (win != NULL) { + wip->wi_changelistidx = win->w_changelistidx; + } if (copy_options && win != NULL) { // Save the window-specific option values. copy_winopt(&win->w_onebuf_opt, &wip->wi_opt); @@ -2586,6 +2589,9 @@ void get_winopts(buf_T *buf) } else { copy_winopt(&curwin->w_allbuf_opt, &curwin->w_onebuf_opt); } + if (wip != NULL) { + curwin->w_changelistidx = wip->wi_changelistidx; + } if (curwin->w_float_config.style == kWinStyleMinimal) { didset_window_options(curwin); -- cgit From e6b7f70294f0e461e95621719c459c9765f07dc7 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 28 Jul 2022 06:32:07 +0800 Subject: vim-patch:9.0.0095: conditions are always true Problem: Conditions are always true. Solution: Remove useless conditions. (closes vim/vim#10802) https://github.com/vim/vim/commit/122dea70073d140aa89212d344c3f62bd3b5b3fa --- src/nvim/buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 10ce893fe8..328a72476a 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -3470,7 +3470,7 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, int use_san // Proceed character by character through the statusline format string // fmt_p is the current position in the input buffer - for (char *fmt_p = usefmt; *fmt_p;) { + for (char *fmt_p = usefmt; *fmt_p != NUL;) { if (curitem == (int)stl_items_len) { size_t new_len = stl_items_len * 3 / 2; @@ -3484,7 +3484,7 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, int use_san stl_items_len = new_len; } - if (*fmt_p != NUL && *fmt_p != '%') { + if (*fmt_p != '%') { prevchar_isflag = prevchar_isitem = false; } -- cgit From c223875a65dd703e42956e064239369817faa0b2 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Tue, 2 Aug 2022 11:52:33 +0200 Subject: refactor: rename function prefix mb to the more accurate utf_cp (#19590) The "cp" stands for codepoint. Closes https://github.com/neovim/neovim/issues/7401 --- src/nvim/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 328a72476a..6dd71e92a6 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -3288,7 +3288,7 @@ void maketitle(void) len = (int)STRLEN(buf_p); if (len > 100) { len -= 100; - len += mb_tail_off(buf_p, buf_p + len) + 1; + len += utf_cp_tail_off(buf_p, buf_p + len) + 1; buf_p += len; } STRCPY(icon_str, buf_p); -- cgit