From 342d18b91ec176c5e3aa6d32d439d01e6ac88ee6 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 12 Aug 2022 21:16:28 +0800 Subject: refactor: remove some unused includes (#19740) Mostly avoids including eval.h, ex_cmds2.h and ex_docmd.h in other headers. --- src/nvim/ui.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/nvim/ui.c') diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 4fcfee1192..2cbdeb318b 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -14,7 +14,6 @@ #include "nvim/cursor_shape.h" #include "nvim/diff.h" #include "nvim/event/loop.h" -#include "nvim/ex_cmds2.h" #include "nvim/ex_getln.h" #include "nvim/fold.h" #include "nvim/garray.h" -- cgit From 33f4ba7379b5ad1670f9168dd98e3031780776f1 Mon Sep 17 00:00:00 2001 From: bfredl Date: Sat, 13 Aug 2022 10:45:21 +0200 Subject: fix(winbar): do not always assume cursor is valid. fixes #19458 --- src/nvim/ui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/ui.c') diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 2cbdeb318b..be0dda0a2f 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -662,6 +662,6 @@ void ui_grid_resize(handle_T grid_handle, int width, int height, Error *error) // non-positive indicates no request wp->w_height_request = MAX(height, 0); wp->w_width_request = MAX(width, 0); - win_set_inner_size(wp); + win_set_inner_size(wp, true); } } -- cgit From f7cfca49d6f1380b2ec0b0f7723ea308d0810857 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 17 Aug 2022 22:18:34 +0800 Subject: refactor: remove some unused includes (#19820) Replace grid.h in screen.h and screen.h in buffer.h with grid_defs.h --- src/nvim/ui.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/ui.c') diff --git a/src/nvim/ui.c b/src/nvim/ui.c index be0dda0a2f..1dce61a0c0 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -17,6 +17,7 @@ #include "nvim/ex_getln.h" #include "nvim/fold.h" #include "nvim/garray.h" +#include "nvim/grid.h" #include "nvim/highlight.h" #include "nvim/log.h" #include "nvim/main.h" -- cgit From fbcce2b2ca781fa2133e5d1c85d1eb4ea91a06ee Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 18 Aug 2022 17:06:39 +0800 Subject: vim-patch:8.1.2082: rename popupmnu.* to popupmenu.* (#19829) vim-patch:8.1.2082: some files have a weird name to fit in 8.3 characters Problem: Some files have a weird name to fit in 8.3 characters. Solution: Use a nicer names. https://github.com/vim/vim/commit/30e8e73506e4522ef4aebf7d525c0e6ffe8805fd --- src/nvim/ui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/ui.c') diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 1dce61a0c0..d4efeb0208 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -31,7 +31,7 @@ #include "nvim/os/signal.h" #include "nvim/os/time.h" #include "nvim/os_unix.h" -#include "nvim/popupmnu.h" +#include "nvim/popupmenu.h" #include "nvim/screen.h" #include "nvim/ui.h" #include "nvim/ui_compositor.h" -- cgit From 51063a90df4cc8af4e1111dd50194ae487e8097e Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Tue, 16 Aug 2022 12:27:07 +0100 Subject: vim-patch:8.1.2057: the screen.c file is much too big Problem: The screen.c file is much too big. Solution: Split it in three parts. (Yegappan Lakshmanan, closes vim/vim#4943) https://github.com/vim/vim/commit/7528d1f6b5422750eb778dfb550cfd0b0e540964 This is an approximation vim-patch 8.1.2057. Applying the patch directly isn't feasible since our version of screen.c has diverged too much, however we still introduce drawscreen.c and drawline.c: - screen.c is now a much smaller file used for low level screen functions - drawline.c contains everything needed for win_line() - drawscreen.c contains everything needed for update_screen() Co-authored-by: zeertzjq --- src/nvim/ui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/ui.c') diff --git a/src/nvim/ui.c b/src/nvim/ui.c index d4efeb0208..da671a3ad1 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -13,6 +13,7 @@ #include "nvim/cursor.h" #include "nvim/cursor_shape.h" #include "nvim/diff.h" +#include "nvim/drawscreen.h" #include "nvim/event/loop.h" #include "nvim/ex_getln.h" #include "nvim/fold.h" @@ -32,7 +33,6 @@ #include "nvim/os/time.h" #include "nvim/os_unix.h" #include "nvim/popupmenu.h" -#include "nvim/screen.h" #include "nvim/ui.h" #include "nvim/ui_compositor.h" #include "nvim/vim.h" -- cgit From bcf5ee328e228d5a536b4de2069a79234f9f3e9e Mon Sep 17 00:00:00 2001 From: bfredl Date: Tue, 23 Aug 2022 10:36:46 +0200 Subject: refactor(arena): use a shared block freelist This is both simpler in client code and more effective (always reuse block hottest in cache) --- src/nvim/ui.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/nvim/ui.c') diff --git a/src/nvim/ui.c b/src/nvim/ui.c index da671a3ad1..0126ad62b5 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -517,11 +517,10 @@ void ui_flush(void) } if (pending_mode_info_update) { Arena arena = ARENA_EMPTY; - arena_start(&arena, &ui_ext_fixblk); Array style = mode_style_array(&arena); bool enabled = (*p_guicursor != NUL); ui_call_mode_info_set(enabled, style); - arena_mem_free(arena_finish(&arena), &ui_ext_fixblk); + arena_mem_free(arena_finish(&arena)); pending_mode_info_update = false; } if (pending_mode_update && !starting) { -- cgit From 395277036014189c03b8969fc0a5cd2bdc5c8631 Mon Sep 17 00:00:00 2001 From: Dundar Göc Date: Fri, 26 Aug 2022 10:36:35 +0200 Subject: refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459 --- src/nvim/ui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/ui.c') diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 0126ad62b5..46f4d137c4 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -336,7 +336,7 @@ void vim_beep(unsigned val) // When 'debug' contains "beep" produce a message. If we are sourcing // a script or executing a function give the user a hint where the beep // comes from. - if (vim_strchr((char *)p_debug, 'e') != NULL) { + if (vim_strchr(p_debug, 'e') != NULL) { msg_source(HL_ATTR(HLF_W)); msg_attr(_("Beep!"), HL_ATTR(HLF_W)); } @@ -565,7 +565,7 @@ void ui_check_mouse(void) // - 'a' is in 'mouse' and "c" is in MOUSE_A, or // - the current buffer is a help file and 'h' is in 'mouse' and we are in a // normal editing mode (not at hit-return message). - for (char_u *p = p_mouse; *p; p++) { + for (char_u *p = (char_u *)p_mouse; *p; p++) { switch (*p) { case 'a': if (vim_strchr(MOUSE_A, checkfor) != NULL) { -- cgit