Commit Graph

24304 Commits

Author SHA1 Message Date
jdrouhard
143d3f1f32
fix(lsp): revert semantic token gravity change from #21574 (#21763) 2023-01-12 07:13:52 +01:00
Chris Kipp
a37c686d21
docs(lsp): update buf_notify and rpc.notify params types (#21753)
Small, but I was getting warnings about my usage of
`vim.lsp.buf_notify(bufnr, method, {example = example})` since the docs
say that `params` must be a string, however this can really be anything
when it's passed to `rpc.notify` since we just end up calling
`vim.json.encode(payload)` on it. This fixes the docs in those two
places and regenerates them.
2023-01-11 20:17:10 +01:00
Christian Clason
8c5c2136fe
vim-patch:9.0.1176: smithy files are not recognized (#21751)
Problem:    smithy files are not recognized.
Solution:   Add a pattern for Smithy files. (Chris Kipp, closes vim/vim#11804)

f68cddabff

Co-authored-by: Chris Kipp <ckipp@pm.me>
2023-01-11 17:15:54 +01:00
zeertzjq
3d49d39cd8
ci(tsan): run functionaltests instead of oldtests (#21744)
With TUI as an external process oldtests no longer involve threads, so
TSAN isn't useful. Meanwhile functionaltests may involve threads.
2023-01-11 14:36:26 +01:00
bfredl
80a02d1cef
Merge pull request #21706 from bfredl/notermios
refactor(pty): remove old logic for inheriting termios from host terminal
2023-01-11 13:19:01 +01:00
dundargoc
ddecf5e27f
ci: remove ci/snap (#21743)
Context: https://github.com/neovim/neovim/pull/21166#issuecomment-1377623160
2023-01-11 10:31:03 +01:00
luukvbaal
93d99aefd3
fix(statuscolumn): fix sign column highlights (#21727)
Resolve #21726.
2023-01-11 09:52:11 +08:00
zeertzjq
08d5b4275e
vim-patch:9.0.1172: when 'selection' is "exclusive" then "1v" is one char short (#21735)
Problem:    When 'selection' is "exclusive" then "1v" is one char short.
Solution:   Add one character when 'selection' is "exclusive. (closes vim/vim#11791)

79c11e399b

Cherry-pick update_curswant_force() refactor from patch 9.0.0482.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-11 06:39:20 +08:00
zeertzjq
15ee93c0b4
vim-patch:9.0.1171: screen is not redrawn after using setcellwidths() (#21730)
Problem:    Screen is not redrawn after using setcellwidths().
Solution:   Redraw the screen when the cell widths have changed. (Yasuhiro
            Matsumoto, closes vim/vim#11800)

2bc849ff81
2023-01-11 05:42:33 +08:00
Amaan Qureshi
ea2658e1f7
vim-patch:9.0.1174: smali files are not recognized (#21734)
Problem: Smali files are not recognized.
Solution: Add a pattern for Smali files. (Amaan Qureshi, closes vim/vim#11801)
2023-01-10 22:29:25 +01:00
dundargoc
438b4361cc
build: use modern cmake (#21589)
Replace old-school cmake with the so-called "Modern CMake", meaning
preferring using targets and properties over directory settings and
variables. This allows greater flexibility, robustness and clarity over
how the code works.

The following deprecated commands will be replaced with their modern
alternatives that operates on a specific target, rather than all targets
in the current directory:

- add_compile_options -> target_compile_options
- include_directories -> target_include_directories
- link_libraries -> target_link_libraries
- add_definitions -> target_compile_definitions

There are mainly four main targets that we currently use: nvim, libnvim,
nvim-test (used by unittests) and ${texe} (used by
check-single-includes). The goal is to explicitly define the
dependencies of each target fully, rather than having everything be
dependent on everything else.
2023-01-10 18:49:57 +01:00
zeertzjq
9b1112cf48
fix(statuscolumn): fix crashes and clang/PVS warnings (#21725) 2023-01-10 21:18:12 +08:00
bfredl
38140a63fb refactor(pty): remove old logic for inheriting termios from host terminal 2023-01-10 14:04:58 +01:00
Sebastian Lyng Johansen
870ca1de52
feat(float): open float relative to mouse #21531
Problem:
No easy way to position a LSP hover window relative to mouse.

Solution:
Introduce another option to the `relative` key in `nvim_open_win()`.

With this PR it should be possible to override the handler and do something
similar to this https://github.com/neovim/neovim/pull/19481#issuecomment-1193248674
to have hover information displayed from the mouse.

Test case:

    ```lua
    local util = require('vim.lsp.util')

    local function make_position_param(window, offset_encoding)
        window = window or 0
        local buf = vim.api.nvim_win_get_buf(window)
        local row, col

        local mouse = vim.fn.getmousepos()
        row = mouse.line
        col = mouse.column

        offset_encoding = offset_encoding or util._get_offset_encoding(buf)
        row = row - 1
        local line = vim.api.nvim_buf_get_lines(buf, row, row + 1, true)[1]
        if not line then
            return { line = 0, character = 0 }
        end
        if #line < col then
            return { line = 0, character = 0 }
        end

        col = util._str_utfindex_enc(line, col, offset_encoding)

        return { line = row, character = col }
    end

    local make_params = function(window, offset_encoding)
        window = window or 0
        local buf = vim.api.nvim_win_get_buf(window)
        offset_encoding = offset_encoding or util._get_offset_encoding(buf)
        return {
            textDocument = util.make_text_document_params(buf),
            position = make_position_param(window, offset_encoding),
        }
    end

    local hover_timer = nil
    vim.o.mousemoveevent = true

    vim.keymap.set({ '', 'i' }, '<MouseMove>', function()
        if hover_timer then
            hover_timer:close()
        end
        hover_timer = vim.defer_fn(function()
            hover_timer = nil
            local params = make_params()
            vim.lsp.buf_request(
                0,
                'textDocument/hover',
                params,
                vim.lsp.with(vim.lsp.handlers.hover, {
                    silent = true,
                    focusable = false,
                    relative = 'mouse',
                })
            )
        end, 500)
        return '<MouseMove>'
    end, { expr = true })
    ```
2023-01-10 02:22:41 -08:00
Christian Clason
d6cb3328f7
vim-patch:1b5f03ec9c55 (#21715)
Update runtime files

1b5f03ec9c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-10 11:02:00 +01:00
Raphael
87cfe50944
fix(ui): set stc to empty in floatwin with minimal style (#21720)
fix(ui): set stc to emtpy in floatwin with minimal style
2023-01-10 10:36:48 +01:00
zeertzjq
1df2db0bc4
test(statuscolumn): add more tests for wrapped lines (#21718)
test(statuscolumn): add more tests more wrapped lines

Also initialize a "relnum" variable to suppress a Coverity warning.
The uninitialized value wasn't actually used by build_statuscol_str().
2023-01-10 11:30:45 +08:00
dundargoc
ef67503320
refactor: replace char_u with char 19 (#21241)
* refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2023-01-10 10:28:01 +08:00
luukvbaal
f62da7381e
docs: add 'statuscolumn' docstrings (#21717) 2023-01-10 09:00:21 +08:00
zeertzjq
dc7edce650
vim-patch:partial:9.0.1166: code is indented more than necessary (#21716)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11792)

1cfb14aa97

Partial port as some highlight.c changes depend on previous patches.
Cherry-pick fname_match() change from patch 8.2.4959.
Omit internal_func_check_arg_types(): only used for Vim9 script.

N/A patches for version.c:

vim-patch:9.0.1167: EditorConfig files do not have their own filetype

Problem:    EditorConfig files do not have their own filetype.
Solution:   Add the "editorconfig" filetype. (Gregory Anders, closes vim/vim#11779)

d41262ed06

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-10 08:46:42 +08:00
luukvbaal
364b131f42
feat(ui): add 'statuscolumn' option
Problem:    Unable to customize the column next to a window ('gutter').
Solution:   Add 'statuscolumn' option that follows the 'statusline' syntax,
	    allowing to customize the status column. Also supporting the %@
	    click execute function label. Adds new items @C and @s which
	    will print the fold and sign columns. Line numbers and signs
	    can be clicked, highlighted, aligned, transformed, margined etc.
2023-01-09 17:12:06 +00:00
dundargoc
50f03773f4
refactor: replace char_u with char 18 (#21237)
refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2023-01-09 22:37:34 +08:00
bfredl
9cd7edc6ad
Merge pull request #21704 from bfredl/nofree
fix(rpc): don't free args on error in rpc_send_event
2023-01-09 14:52:02 +01:00
dundargoc
1492094003
refactor: replace char_u with char 17 - remove STRLCPY (#21235)
refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2023-01-09 21:13:06 +08:00
bfredl
bb7033a033 fix(rpc): don't free args on error in rpc_send_event
fixup #21631
fixes #21690
2023-01-09 13:59:35 +01:00
bfredl
fc2cd28547
Merge pull request #21702 from glepnir/fix_2
fix(api): convert title_pos string in nvim_win_get_config
2023-01-09 12:33:08 +01:00
bfredl
df60ac9767
Merge pull request #21675 from bfredl/nonstdio
fix(embed): handle stdio in server properly
2023-01-09 12:28:10 +01:00
bfredl
1d16bba4d8 fix(embed): handle stdio in server properly
Rename stdin/stdout in the server, so that RPC data won't get corrupted.
This also restores the use of stderr to write directly to the terminal.
2023-01-09 11:17:11 +01:00
zeertzjq
d64549bc4e
Merge pull request #21488 from dundargoc/refactor/char_u/16.1
refactor/char u/16.1
2023-01-09 17:37:21 +08:00
zeertzjq
7ba39b4378 test: add more tests for Unicode 2023-01-09 17:11:39 +08:00
dundargoc
08c2c74806 refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
2023-01-09 17:03:40 +08:00
zeertzjq
53adccb6e0
test(tui_spec): doesn't use Unicode in cursor_address test (#21703)
Using Unicode makes the test flaky because of #16245.
2023-01-09 17:02:45 +08:00
Raphael
3a8be82175 fix: use enum type 2023-01-09 17:00:32 +08:00
Raphael
ad34ab38db fix: format 2023-01-09 14:22:10 +08:00
Raphael
e351ab179b fix(ui): add test case 2023-01-09 14:17:32 +08:00
Raphael
1f18c27404 fix(ui): convert title_pos string in nvim_win_get_config 2023-01-09 13:57:46 +08:00
zeertzjq
c19bd47c0a
test(tui_spec): improve cursor_address test (#21700) 2023-01-09 12:20:50 +08:00
zeertzjq
a174f4e53f
vim-patch:9.0.1158: code is indented more than necessary (#21697)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11787)

7f8b2559a3

Omit reset_last_used_map(): only used in Vim9 script.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-09 07:16:36 +08:00
TJ DeVries
904c13e6b5
dist: transpile cfilter.vim => cfilter.lua #21662
Vim has changed cfilter.vim from vimscript to vim9script.
Nvim supports only vimscript, not vim9script.
2023-01-08 12:31:38 -08:00
dundargoc
266a1c61b9
Merge pull request #21678 from dundargoc/build/remove-old-workarounds
build: remove old cmake workarounds that aren't necessary anymore
2023-01-08 11:01:24 +01:00
dundargoc
50687e60ae build: remove workaround for ancient clang versions
We don't need to support this as it's only required when using
AddressSanitizer, meaning it only affects developers.
2023-01-08 11:00:16 +01:00
dundargoc
623dad1a2c build: remove workaround for old luajit versions
Luajit version 2.1.0-beta3 was released 2017, there's no reason to use
such an old version on macOS. Also, the version check doesn't work
anymore as LUAJIT_VERSION seems to not be defined anywhere.
2023-01-08 10:58:51 +01:00
Mathias Fußenegger
d1b3611f03
feat(lsp): show active clients in :checkhealth vim.lsp (#21670)
For users using vim.lsp.start it can be useful to get an
overview of active client that is less verbose than a full `:lua
=vim.lsp.get_active_clients()`
2023-01-08 09:23:08 +01:00
jdrouhard
0b136a14dc
fix(lsp): partially revert semantic token gravity change from #21574 (#21680) 2023-01-08 07:43:15 +01:00
dundargoc
d89290b453
ci(news): checkout to HEAD commit instead of merge commit (#21679)
The default merge branch is unreliable when trying to determine number
of commits in a PR. Using the HEAD branch of the PR removes this
ambiguity.
2023-01-07 16:51:52 +01:00
Gregory Anders
f601c4b1ca
fix(editorconfig): do not highlight unknown properties as errors (#21673)
Other plugins may define their own custom properties outside of Neovim's
builtin EditorConfig support. Instead of highlighting these unknown
properties as errors, do not highlight them at all.

This still differentiates between known and unknown properties, which
helps to catch typos or mistakes, but does not use the garish "error"
highlight that signals something is wrong.
2023-01-07 08:20:55 -07:00
Gregory Anders
3636338449
Merge pull request #21649 from gpanders/editorconfig-enable
feat(editorconfig): allow editorconfig to be toggled dynamically
2023-01-07 08:20:37 -07:00
Gregory Anders
6ffa434f0b refactor(editorconfig)!: change editorconfig_enable to editorconfig 2023-01-07 08:19:37 -07:00
Gregory Anders
34d1eaa792 feat(editorconfig): allow editorconfig to be toggled dynamically
Rather than only check `editorconfig_enable` when the plugin is loaded,
check it each time the autocommand fires, so that users may enable or
disable it dynamically.

Also check for a buffer local version of the variable, so that
editorconfig can be enabled or disabled per-buffer.
2023-01-07 08:19:12 -07:00
Justin M. Keyes
42afa0369a
Merge #21663 lua: "nvim -l" scriptname in _G.arg[0] 2023-01-06 22:07:34 -05:00