diff options
-rw-r--r-- | .github/workflows/codeql-analysis.yml | 42 | ||||
-rw-r--r-- | runtime/doc/lsp.txt | 18 | ||||
-rw-r--r-- | runtime/lua/vim/lsp.lua | 5 | ||||
-rw-r--r-- | src/nvim/api/ui.c | 2 | ||||
-rw-r--r-- | src/nvim/api/vim.c | 2 | ||||
-rw-r--r-- | src/nvim/edit.c | 2 | ||||
-rw-r--r-- | src/nvim/eval/funcs.c | 2 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 2 | ||||
-rw-r--r-- | src/nvim/ex_getln.c | 2 | ||||
-rw-r--r-- | src/nvim/highlight.c | 4 | ||||
-rw-r--r-- | src/nvim/insexpand.c | 2 | ||||
-rw-r--r-- | src/nvim/main.c | 2 | ||||
-rw-r--r-- | src/nvim/menu.c | 2 | ||||
-rw-r--r-- | src/nvim/move.c | 2 | ||||
-rw-r--r-- | src/nvim/option.c | 2 | ||||
-rw-r--r-- | src/nvim/popupmenu.c (renamed from src/nvim/popupmnu.c) | 24 | ||||
-rw-r--r-- | src/nvim/popupmenu.h (renamed from src/nvim/popupmnu.h) | 8 | ||||
-rw-r--r-- | src/nvim/screen.c | 2 | ||||
-rw-r--r-- | src/nvim/ui.c | 2 | ||||
-rw-r--r-- | src/nvim/ui_compositor.c | 2 | ||||
-rw-r--r-- | test/functional/ui/highlight_spec.lua | 16 |
21 files changed, 93 insertions, 52 deletions
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000000..b31382af37 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,42 @@ +name: "CodeQL" + +on: + schedule: + - cron: '42 0 * * 0' + workflow_dispatch: +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'cpp', 'python' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup common environment variables + run: ./.github/workflows/env.sh + + - name: Install apt packages + run: | + sudo apt-get update + sudo apt-get install -y autoconf automake build-essential cmake cpanminus cscope gcc-multilib gdb gettext language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + + - if: matrix.language == 'cpp' + run: make + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 94aa42e500..7fc0daa0ca 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -568,24 +568,6 @@ buf_notify({bufnr}, {method}, {params}) *vim.lsp.buf_notify()* Return: ~ true if any client returns true; false otherwise - *vim.lsp.buf_request()* -buf_request({bufnr}, {method}, {params}, {handler}) - Sends an async request for all active clients attached to the buffer. - - Parameters: ~ - {bufnr} (number) Buffer handle, or 0 for current. - {method} (string) LSP method name - {params} (optional, table) Parameters to send to the server - {handler} (optional, function) See |lsp-handler| If nil, follows - resolution strategy defined in |lsp-handler-configuration| - - Return: ~ - 2-tuple: - • Map of client-id:request-id pairs for all successful requests. - • Function which can be used to cancel all the requests. You could - instead iterate all clients and call their `cancel_request()` - methods. - *vim.lsp.buf_request_all()* buf_request_all({bufnr}, {method}, {params}, {callback}) Sends an async request for all active clients attached to the buffer. diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index 8d4f388e23..fd64c1a495 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -1845,13 +1845,14 @@ api.nvim_create_autocmd('VimLeavePre', { end, }) +---@private --- Sends an async request for all active clients attached to the --- buffer. --- ---@param bufnr (number) Buffer handle, or 0 for current. ---@param method (string) LSP method name ----@param params (optional, table) Parameters to send to the server ----@param handler (optional, function) See |lsp-handler| +---@param params table|nil Parameters to send to the server +---@param handler function|nil See |lsp-handler| --- If nil, follows resolution strategy defined in |lsp-handler-configuration| --- ---@returns 2-tuple: diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 84cc77d8de..6f7bfa244a 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -18,7 +18,7 @@ #include "nvim/msgpack_rpc/channel.h" #include "nvim/msgpack_rpc/helpers.h" #include "nvim/option.h" -#include "nvim/popupmnu.h" +#include "nvim/popupmenu.h" #include "nvim/ui.h" #include "nvim/vim.h" #include "nvim/window.h" diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 25f6e822b3..53ffac1474 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -53,7 +53,7 @@ #include "nvim/option.h" #include "nvim/os/input.h" #include "nvim/os/process.h" -#include "nvim/popupmnu.h" +#include "nvim/popupmenu.h" #include "nvim/runtime.h" #include "nvim/screen.h" #include "nvim/state.h" diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 4e8c3d1ed9..2a9d2ac121 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -47,7 +47,7 @@ #include "nvim/os/time.h" #include "nvim/path.h" #include "nvim/plines.h" -#include "nvim/popupmnu.h" +#include "nvim/popupmenu.h" #include "nvim/quickfix.h" #include "nvim/screen.h" #include "nvim/search.h" diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 104560547c..7f564f582e 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -60,7 +60,7 @@ #include "nvim/os/shell.h" #include "nvim/path.h" #include "nvim/plines.h" -#include "nvim/popupmnu.h" +#include "nvim/popupmenu.h" #include "nvim/profile.h" #include "nvim/quickfix.h" #include "nvim/regexp.h" diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 799acbbb9e..1f04ff565c 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -65,7 +65,7 @@ #include "nvim/os/time.h" #include "nvim/os_unix.h" #include "nvim/path.h" -#include "nvim/popupmnu.h" +#include "nvim/popupmenu.h" #include "nvim/profile.h" #include "nvim/quickfix.h" #include "nvim/regexp.h" diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 56d4deb245..445ab6c549 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -67,7 +67,7 @@ #include "nvim/os/time.h" #include "nvim/os_unix.h" #include "nvim/path.h" -#include "nvim/popupmnu.h" +#include "nvim/popupmenu.h" #include "nvim/profile.h" #include "nvim/regexp.h" #include "nvim/screen.h" diff --git a/src/nvim/highlight.c b/src/nvim/highlight.c index 21d7f9ada1..994d496556 100644 --- a/src/nvim/highlight.c +++ b/src/nvim/highlight.c @@ -13,7 +13,7 @@ #include "nvim/map.h" #include "nvim/message.h" #include "nvim/option.h" -#include "nvim/popupmnu.h" +#include "nvim/popupmenu.h" #include "nvim/screen.h" #include "nvim/ui.h" #include "nvim/vim.h" @@ -317,7 +317,7 @@ void update_window_hl(win_T *wp, bool invalid) int ns_id = wp->w_ns_hl; update_ns_hl(ns_id); - if (ns_id != wp->w_ns_hl_active) { + if (ns_id != wp->w_ns_hl_active || wp->w_ns_hl_attr == NULL) { wp->w_ns_hl_active = ns_id; wp->w_ns_hl_attr = *(NSHlAttr *)pmap_get(handle_T)(&ns_hl_attr, ns_id); diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index 53c238a380..63c33632e5 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -34,7 +34,7 @@ #include "nvim/os/input.h" #include "nvim/os/time.h" #include "nvim/path.h" -#include "nvim/popupmnu.h" +#include "nvim/popupmenu.h" #include "nvim/regexp.h" #include "nvim/screen.h" #include "nvim/search.h" diff --git a/src/nvim/main.c b/src/nvim/main.c index 7de91cb06f..19d5a9bf4e 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -58,7 +58,7 @@ #include "nvim/os/time.h" #include "nvim/os_unix.h" #include "nvim/path.h" -#include "nvim/popupmnu.h" +#include "nvim/popupmenu.h" #include "nvim/profile.h" #include "nvim/quickfix.h" #include "nvim/runtime.h" diff --git a/src/nvim/menu.c b/src/nvim/menu.c index 9cb9503b3c..c3cf4457fc 100644 --- a/src/nvim/menu.c +++ b/src/nvim/menu.c @@ -23,7 +23,7 @@ #include "nvim/memory.h" #include "nvim/menu.h" #include "nvim/message.h" -#include "nvim/popupmnu.h" +#include "nvim/popupmenu.h" #include "nvim/screen.h" #include "nvim/state.h" #include "nvim/strings.h" diff --git a/src/nvim/move.c b/src/nvim/move.c index 564a9ca5df..4902b7750d 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -31,7 +31,7 @@ #include "nvim/move.h" #include "nvim/option.h" #include "nvim/plines.h" -#include "nvim/popupmnu.h" +#include "nvim/popupmenu.h" #include "nvim/screen.h" #include "nvim/search.h" #include "nvim/strings.h" diff --git a/src/nvim/option.c b/src/nvim/option.c index 82dac029f4..f1127ad133 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -68,7 +68,7 @@ #include "nvim/os/os.h" #include "nvim/os_unix.h" #include "nvim/path.h" -#include "nvim/popupmnu.h" +#include "nvim/popupmenu.h" #include "nvim/regexp.h" #include "nvim/runtime.h" #include "nvim/screen.h" diff --git a/src/nvim/popupmnu.c b/src/nvim/popupmenu.c index c137675502..75bd46bb30 100644 --- a/src/nvim/popupmnu.c +++ b/src/nvim/popupmenu.c @@ -1,7 +1,7 @@ // 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 +/// @file popupmenu.c /// /// Popup menu (PUM) @@ -24,7 +24,7 @@ #include "nvim/menu.h" #include "nvim/move.h" #include "nvim/option.h" -#include "nvim/popupmnu.h" +#include "nvim/popupmenu.h" #include "nvim/screen.h" #include "nvim/search.h" #include "nvim/strings.h" @@ -57,7 +57,7 @@ static bool pum_external = false; static bool pum_invalid = false; // the screen was just cleared #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "popupmnu.c.generated.h" +# include "popupmenu.c.generated.h" #endif #define PUM_DEF_HEIGHT 10 @@ -465,7 +465,7 @@ void pum_redraw(void) / (pum_size - pum_height); } - for (i = 0; i < pum_height; ++i) { + for (i = 0; i < pum_height; i++) { idx = i + pum_first; attr = (idx == pum_selected) ? attr_select : attr_norm; @@ -485,7 +485,7 @@ void pum_redraw(void) grid_col = col_off; totwidth = 0; - for (round = 1; round <= 3; ++round) { + for (round = 1; round <= 3; round++) { width = 0; s = NULL; @@ -641,11 +641,11 @@ void pum_redraw(void) /// @param n /// @param repeat /// -/// @returns TRUE when the window was resized and the location of the popup +/// @returns true when the window was resized and the location of the popup /// menu must be recomputed. -static int pum_set_selected(int n, int repeat) +static bool pum_set_selected(int n, int repeat) { - int resized = FALSE; + int resized = false; int context = pum_height / 2; pum_selected = n; @@ -778,12 +778,12 @@ static int pum_set_selected(int n, int repeat) if (curwin->w_height < lnum) { win_setheight((int)lnum); - resized = TRUE; + resized = true; } } curbuf->b_changed = false; - curbuf->b_p_ma = FALSE; + curbuf->b_p_ma = false; curwin->w_cursor.lnum = 1; curwin->w_cursor.col = 0; @@ -797,7 +797,7 @@ static int pum_set_selected(int n, int repeat) // window is not resized, skip the preview window's // status line redrawing. if (ins_compl_active() && !resized) { - curwin->w_redr_status = FALSE; + curwin->w_redr_status = false; } // Return cursor to where we were @@ -906,7 +906,7 @@ void pum_recompose(void) /// Gets the height of the menu. /// /// @return the height of the popup menu, the number of entries visible. -/// Only valid when pum_visible() returns TRUE! +/// Only valid when pum_visible() returns true! int pum_get_height(void) { if (pum_external) { diff --git a/src/nvim/popupmnu.h b/src/nvim/popupmenu.h index 7d3f4c6f51..851ad31486 100644 --- a/src/nvim/popupmnu.h +++ b/src/nvim/popupmenu.h @@ -1,5 +1,5 @@ -#ifndef NVIM_POPUPMNU_H -#define NVIM_POPUPMNU_H +#ifndef NVIM_POPUPMENU_H +#define NVIM_POPUPMENU_H #include "nvim/grid_defs.h" #include "nvim/macros.h" @@ -17,6 +17,6 @@ typedef struct { EXTERN ScreenGrid pum_grid INIT(= SCREEN_GRID_INIT); #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "popupmnu.h.generated.h" +# include "popupmenu.h.generated.h" #endif -#endif // NVIM_POPUPMNU_H +#endif // NVIM_POPUPMENU_H diff --git a/src/nvim/screen.c b/src/nvim/screen.c index f5158256e9..ae3aa63cb8 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -110,7 +110,7 @@ #include "nvim/os_unix.h" #include "nvim/path.h" #include "nvim/plines.h" -#include "nvim/popupmnu.h" +#include "nvim/popupmenu.h" #include "nvim/profile.h" #include "nvim/quickfix.h" #include "nvim/regexp.h" 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" diff --git a/src/nvim/ui_compositor.c b/src/nvim/ui_compositor.c index d960b2b785..2216e25db9 100644 --- a/src/nvim/ui_compositor.c +++ b/src/nvim/ui_compositor.c @@ -23,7 +23,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/os/os.h" -#include "nvim/popupmnu.h" +#include "nvim/popupmenu.h" #include "nvim/ugrid.h" #include "nvim/ui.h" #include "nvim/ui_compositor.h" diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua index 28f4c0eb23..4e3d62509c 100644 --- a/test/functional/ui/highlight_spec.lua +++ b/test/functional/ui/highlight_spec.lua @@ -2317,6 +2317,22 @@ describe("'winhighlight' highlight", function() | ]]} end) + + it('can be disabled in newly opened window #19823', function() + command('split | set winhl=Normal:ErrorMsg | set winhl=') + screen:expect{grid=[[ + ^ | + {0:~ }| + {0:~ }| + {3:[No Name] }| + | + {0:~ }| + {4:[No Name] }| + | + ]]} + + helpers.assert_alive() + end) end) describe('highlight namespaces', function() |