From e18a5783080f7c94f408ec5f53dedffdb69789e1 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 20 Aug 2016 22:24:34 +0300 Subject: *: Move some dictionary functions to typval.h and use char* Also fixes buffer reusage in setmatches() and complete(). --- src/nvim/popupmnu.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/nvim/popupmnu.c') diff --git a/src/nvim/popupmnu.c b/src/nvim/popupmnu.c index ea00afbd86..6346951c05 100644 --- a/src/nvim/popupmnu.c +++ b/src/nvim/popupmnu.c @@ -610,13 +610,10 @@ static int pum_set_selected(int n, int repeat) if (res == OK) { // Edit a new, empty buffer. Set options for a "wipeout" // buffer. - set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL); - set_option_value((char_u *)"bt", 0L, - (char_u *)"nofile", OPT_LOCAL); - set_option_value((char_u *)"bh", 0L, - (char_u *)"wipe", OPT_LOCAL); - set_option_value((char_u *)"diff", 0L, - NULL, OPT_LOCAL); + set_option_value("swf", 0L, NULL, OPT_LOCAL); + set_option_value("bt", 0L, "nofile", OPT_LOCAL); + set_option_value("bh", 0L, "wipe", OPT_LOCAL); + set_option_value("diff", 0L, NULL, OPT_LOCAL); } } -- cgit From c2f3e361c52ec4e7149ea1d8c6a1202e0873da8e Mon Sep 17 00:00:00 2001 From: ZyX Date: Wed, 19 Apr 2017 19:11:50 +0300 Subject: *: Add comment to all C files --- src/nvim/popupmnu.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/nvim/popupmnu.c') diff --git a/src/nvim/popupmnu.c b/src/nvim/popupmnu.c index 6346951c05..6e81c5a171 100644 --- a/src/nvim/popupmnu.c +++ b/src/nvim/popupmnu.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// @file popupmnu.c /// /// Popup menu (PUM) -- cgit From 00843902d3472ac4e74106fc06fa60e599914496 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 25 Apr 2017 02:17:15 +0200 Subject: api/ui: externalize tabline - Work with a bool[] array parallel to the UIWidget enum. - Rename some functions. - Documentation. --- src/nvim/popupmnu.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/nvim/popupmnu.c') diff --git a/src/nvim/popupmnu.c b/src/nvim/popupmnu.c index 6e81c5a171..b8650d8c62 100644 --- a/src/nvim/popupmnu.c +++ b/src/nvim/popupmnu.c @@ -41,9 +41,7 @@ static int pum_row; // top row of pum static int pum_col; // left column of pum static bool pum_is_visible = false; - static bool pum_external = false; -static bool pum_wants_external = false; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "popupmnu.c.generated.h" @@ -80,7 +78,7 @@ void pum_display(pumitem_T *array, int size, int selected, bool array_changed) if (!pum_is_visible) { // To keep the code simple, we only allow changing the // draw mode when the popup menu is not being displayed - pum_external = pum_wants_external; + pum_external = ui_is_external(kUIPopupmenu); } redo: @@ -751,8 +749,3 @@ int pum_get_height(void) { return pum_height; } - -void pum_set_external(bool external) -{ - pum_wants_external = external; -} -- cgit From 4eb781ce1d8d5796bb5c2db96c48152021165b50 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sat, 29 Apr 2017 14:27:22 +0200 Subject: api: use generated events for popupmenu and tabline --- src/nvim/popupmnu.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/nvim/popupmnu.c') diff --git a/src/nvim/popupmnu.c b/src/nvim/popupmnu.c index b8650d8c62..9f3abfcb89 100644 --- a/src/nvim/popupmnu.c +++ b/src/nvim/popupmnu.c @@ -98,7 +98,6 @@ redo: } if (pum_external) { - Array args = ARRAY_DICT_INIT; if (array_changed) { Array arr = ARRAY_DICT_INIT; for (i = 0; i < size; i++) { @@ -109,14 +108,9 @@ redo: ADD(item, STRING_OBJ(cstr_to_string((char *)array[i].pum_info))); ADD(arr, ARRAY_OBJ(item)); } - ADD(args, ARRAY_OBJ(arr)); - ADD(args, INTEGER_OBJ(selected)); - ADD(args, INTEGER_OBJ(row)); - ADD(args, INTEGER_OBJ(col)); - ui_event("popupmenu_show", args); + ui_call_popupmenu_show(arr, selected, row, col); } else { - ADD(args, INTEGER_OBJ(selected)); - ui_event("popupmenu_select", args); + ui_call_popupmenu_select(selected); } return; } @@ -713,8 +707,7 @@ void pum_undisplay(void) pum_array = NULL; if (pum_external) { - Array args = ARRAY_DICT_INIT; - ui_event("popupmenu_hide", args); + ui_call_popupmenu_hide(); } else { redraw_all_later(SOME_VALID); redraw_tabline = true; -- cgit From 16ae369474b0605716a962b60337421a9fc8741f Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Mon, 8 May 2017 18:36:03 +0200 Subject: screen.c: make more highlights window specific --- src/nvim/popupmnu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/nvim/popupmnu.c') diff --git a/src/nvim/popupmnu.c b/src/nvim/popupmnu.c index 9f3abfcb89..2462975c9b 100644 --- a/src/nvim/popupmnu.c +++ b/src/nvim/popupmnu.c @@ -307,10 +307,10 @@ void pum_redraw(void) { int row = pum_row; int col; - int attr_norm = highlight_attr[HLF_PNI]; - int attr_select = highlight_attr[HLF_PSI]; - int attr_scroll = highlight_attr[HLF_PSB]; - int attr_thumb = highlight_attr[HLF_PST]; + int attr_norm = win_hl_attr(curwin, HLF_PNI); + int attr_select = win_hl_attr(curwin, HLF_PSI); + int attr_scroll = win_hl_attr(curwin, HLF_PSB); + int attr_thumb = win_hl_attr(curwin, HLF_PST); int attr; int i; int idx; -- cgit