Problem: Expand functions use confusing argument names.
Solution: Rename "file" to "match". Refactor some completion code. Add a
few more tests. (Yegappan Lakshmanan, closesvim/vim#9790)
2438430863
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
IWYU stopped working after 438b4361cc,
likely due to the code being moved from CMakeLists.txt to
src/nvim/CMakelists.txt. Using the IWYU target property instead of the
variable ensures that the information to use IWYU isn't lost.
Problem: Some command completion functions are too long.
Solution: Refactor code into separate functions. Add a few more tests.
(Yegappan Lakshmanan, closesvim/vim#9785)
b31aec3b93
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closesvim/vim#11813)
e857598896
Partial port as this depends on some previous eval and 'smoothscroll'
patches.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Command line executed when typing Esc in the GUI.
Solution: Move saving/restoring KeyTyped to build_stl_str_hl().
(closesvim/vim#9783)
0e1f36fc59
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: A custom 'tabline' may cause Esc to work like Enter on the
command line when the popup menu is displayed.
Solution: Save and restore KeyTyped. (closesvim/vim#9776)
e4835bf340
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: A custom statusline may cause Esc to work like Enter on the
command line when the popup menu is displayed.
Solution: Save and restore KeyTyped. (closesvim/vim#9749)
481acb1141
Co-authored-by: Bram Moolenaar <Bram@vim.org>
when using the rbuffer as a linear buffer, exactly filling the buffer
will case write_ptr to wrap around too early. For now detect this
special case.
Of course, the rbuffer should refactored to a proper ring buffer where
write_pos >= read_pos always and there is no special case for full
buffers. This will be a follow up change.
Problem: Command line not redrawn when finishing popup menu and the screen
has scrolled up.
Solution: Redraw the command line after updating the screen. (closesvim/vim#9722)
414acd342f
Code change is N/A as Nvim doesn't call update_screen() here.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: CTRL-A does not work properly with the cmdline popup menu.
Solution: Fix issues with CTRL-A. Add more tests for the cmdline popup
menu. Remove TermWait() before VeriryScreenDump(). Refactor the
cmdline popup code. (Yegappan Lakshmanan, closesvim/vim#9735)
560dff49c0
Only port cmdexpand.c and test_cmdline.vim changes.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Fix remaining clint errors and remove error suppression completely.
Rename the lint targets to align with the established naming convention:
- lintc-clint lints with clint.py.
- lintc-uncrustify lints with uncrustify.
- lintc runs both targets.
lintc is also provided as a make target for convenience.
After this change we can remove these files:
https://github.com/neovim/doc/tree/gh-pages/reports/clinthttps://github.com/neovim/doc/blob/main/ci/clint-errors.sh
Problem: Invalid memory access with folding and using "L".
Solution: Prevent the cursor from moving to line zero.
232bdaaca9
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Some Bazel files are not recognized.
Solution: Add an extra Bazel pattern. (Keith Smily, closesvim/vim#11807)
3213952966
Co-authored-by: Keith Smiley <keithbsmiley@gmail.com>
fix(statuscolumn): statusline click registered as statuscolumn
Problem: Status line click is registered as status status column click.
Solution: Check that mouse is not on the status line.
Resolve https://github.com/luukvbaal/statuscol.nvim/issues/4.
Problem:
The calculation of `len` in `make_filter_cmd` for powershell falls short
by one character for the following ex command:
:%w !sort
This command satisfies these conditions:
- `itmp` is not null
- `otmp` is null
__NOTE__ that other shells circumvent this bug only because of `len`
allocation for six extra characters: a pair of curly braces and four
spaces:
cfdb4cbada/src/nvim/ex_cmds.c (L1551-L1554)
If allocation for these six characters are removed, then bash also faces
the same bug.
Solution:
Add allocation for 6 extra bytes. 1 would do, but let's keep powershell
in sync with other shells as much as possible.
Including our libraries as system libraries is helpful to suppress any
warnings, but the default behavior is to include it after existing
libraries. This can become a problem with some package managers such as
macports, as CMake automatically adds /opt/local to the include path,
which is where they store all includes. This means that the wrong header
might be chosen if it has the same name as the one from our
dependencies.
Adding the BEFORE keyword when including will ensure that our
dependency headers are chosen first.
Also remove old Darwin workarounds that shouldn't be necessary anymore.
Closes: https://github.com/neovim/neovim/issues/21742
This small changes just ensures that if you're using `convert_input_to_markdown_lines`
without `contents` you don't get a warning (when using something like neodev) that
there is an expected second param, since it can be nil.
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closesvim/vim#11805)
0233bdfa2b
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: go checksum files are not recognized.
Solution: Add the name of go checksum files. (Amaan Qureshi, closesvim/vim#11803)
043d7b2c84
Co-authored-by: Amaan Q <amaanq12@gmail.com>
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.
Problem: smithy files are not recognized.
Solution: Add a pattern for Smithy files. (Chris Kipp, closesvim/vim#11804)
f68cddabff
Co-authored-by: Chris Kipp <ckipp@pm.me>
Problem: When 'selection' is "exclusive" then "1v" is one char short.
Solution: Add one character when 'selection' is "exclusive. (closesvim/vim#11791)
79c11e399b
Cherry-pick update_curswant_force() refactor from patch 9.0.0482.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Screen is not redrawn after using setcellwidths().
Solution: Redraw the screen when the cell widths have changed. (Yasuhiro
Matsumoto, closesvim/vim#11800)
2bc849ff81
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.
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 })
```
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().