Commit Graph

19914 Commits

Author SHA1 Message Date
VVKot
26ced79c3b vim-patch:8.1.0040: warnings from 64-bit compiler
Problem:    Warnings from 64-bit compiler.
Solution:   Add type casts. (Mike Williams)
e31e256ba1
2021-12-20 05:30:15 +00:00
Dundar Göc
482df82e69 docs: stop suggestion "good first issue" as a good first issue
They're simply too difficult and too niche for an actual newcomer to
solve them. Instead, use the "complexity:low" as a substitute.
2021-12-19 22:15:42 +01:00
Gregory Anders
67bb01ae27
chore(build): add option to disable Lua bytecode compilation (#16722)
Include a build option to explicitly disable Lua bytecode compilation.
This is needed in some situations where the existing checks are not
sufficient (e.g. cross compilation).
2021-12-19 14:00:53 -07:00
Michael Lingelbach
d6b939a13f
fix(lsp): avoid attaching to unloaded buffers (#16723)
Closes https://github.com/neovim/neovim/issues/16562 https://github.com/neovim/neovim/issues/16249 https://github.com/neovim/neovim/issues/16297

* buf_attach_client can be called on an unloaded buffer
* on_attach will prematurely fail, while the language server client
  tracks this buffer as attached
* The language server client will track this buffer as attached despite
  textDocument/didChange notifications not being sent to the server
* Instead, check if the buffer is loaded and return early, warning via
  the lsp logger that buf_attach_client was called on an invalid buffer
2021-12-19 12:49:56 -08:00
Björn Linse
115d4da882
Merge pull request #16657 from lewis6991/unused_warn
chore(): suppress -Wunused-but-set-variable warns
2021-12-19 21:38:07 +01:00
VVKot
6f72236a00 vim-patch:8.2.3855: illegal memory access when displaying a blob
Problem:    Illegal memory access when displaying a blob.
Solution:   Append a NUL at the end. (Yegappan Lakshmanan, closes vim/vim#9372)
bc404bfb32
2021-12-19 19:50:59 +00:00
VVKot
bdfca2028b vim-patch:8.2.3850: illegal memory access when displaying a partial
Problem:    Illegal memory access when displaying a partial.
Solution:   Terminate the string with a NUL. (closes vim/vim#9371)
2de5371a75
2021-12-19 19:48:57 +00:00
Lewis Russell
e0750f3e8a chore: suppress -Wunused-but-set-variable warns 2021-12-19 13:20:17 +00:00
Gregory Anders
abdf3a8128
fix(build): check that LuaJIT has required modules for compilation (#16714)
Apparently some installations of LuaJIT do not have the "jit.bcsave"
module which is required for pre-compilation. Check that this module
exists before using LuaJIT as luac and if it doesn't, skip compiling
bytecode.
2021-12-18 20:59:02 -07:00
Michael Lingelbach
b42e0c40c8
fix: update last cursor on first CursorMoved (#16698)
Closes https://github.com/neovim/neovim/issues/16625 https://github.com/neovim/neovim/issues/12923

The first defined CursorMoved autocommand will immediately
fire if the cursor has previously moved upon definition
of the autocommand.

Plugins add dummy autocommands such as:

```lua
autocmd CursorMoved * execute ''
```

to avoid this behavior.

Instead, when defining a new CursorHold autocommand, force
update the last cursor position.

See https://github.com/vim/vim/issues/2053
2021-12-18 19:18:47 -08:00
zeertzjq
0e18cf4b6d vim-patch:8.2.3846: no error when using control character for 'lcs' or 'fcs'
Problem:    No error when using control character for 'lcs' or 'fcs'.
Solution:   Use char2cells() to check the width. (closes vim/vim#9369)
60618c8f1a
2021-12-19 09:55:17 +08:00
zeertzjq
c05e647681 vim-patch:8.2.2641: display test fails because of lacking redraw
Problem:    Display test fails because of lacking redraw.
Solution:   Add a redraw command.
2cec027af4
2021-12-19 09:55:17 +08:00
zeertzjq
fd70018e21 vim-patch:8.2.2508: cannot change the character displayed in non existing lines
Problem:    Cannot change the character displayed in non existing lines.
Solution:   Add the "eob" item to 'fillchars'. (closes vim/vim#7832, closes vim/vim#3820)
a98f8a2305

Nvim has already implemented this feature, so this just ports the tests
and docs.
2021-12-19 09:55:17 +08:00
Christian Clason
95803f0e90
build(deps): bump luajit to commit 1d20f33 (#16712)
fixes a bug with jit.bcsave on Windows (cf. #16631)
2021-12-18 19:09:00 +01:00
James McCoy
8d22049513
Merge pull request #16294 from zeertzjq/test-fewest-iteration
test: require fewest number of main loop iterations possible
2021-12-18 13:08:28 -05:00
James McCoy
2202400f15
Merge pull request #16707 from jamessan/filter-out-tests
test: allow excluding functional/unti tests using TEST_FILTER_OUT
2021-12-18 13:01:38 -05:00
Gregory Anders
eceb0b305e
fix(build): check for empty value of LUAC_PRG (#16711)
If the LUAC_PRG environment variable is defined, but empty, compilation
would still be attempted but would be malformed. This results in garbage
bytes being included.

Fix this by checking that LUAC_PRG is both defined *and* non-empty.
2021-12-18 10:56:10 -07:00
James McCoy
267ec67fab
test: allow excluding functional/unit tests using TEST_FILTER_OUT
Although this can already be done using `BUSTED_ARGS`, it complements
our existing shortcut of `TEST_FILTER.`

[skip ci]
2021-12-18 12:55:09 -05:00
kylo252
2abd17813e
fix(build): install luajit modules on windows (#16658) 2021-12-18 10:53:27 -07:00
Christian Clason
ff1b0f632a
vim-patch:8.2.3843: dep3patch files are not recognized (#16700)
Problem:    Dep3patch files are not recognized.
Solution:   Recognize dep3patch files by their location and content. (James
            McCoy, closes vim/vim#9367)
647ab4cede
2021-12-18 17:22:09 +01:00
erw7
34d88edaec
feat(tui): add error logging (#16615) 2021-12-18 09:18:30 -07:00
matveyt
734fba0d88
feat(runtime): new checkhealth filetype (#16660) 2021-12-18 09:14:42 -07:00
Gregory Anders
36758ba9a7
autocmd: RecordingEnter, RecordingLeave (#16684) 2021-12-18 08:55:43 -07:00
Axel Dahlberg
df50fb5859 test(old): change usage of Q to gQ
test(old) fix Test_ex_mode_count_overflow

test(old) change usage of Q to gQ
2021-12-18 08:54:07 -07:00
Thomas Vigouroux
684c782546 docs(autocmd): update docs to match implementation
docs(reg_recorded): add links to relevant docs

docs(Recording): update docs to match implementation

docs(Q) update references of Q to be gQ

docs(autocmd) add description about state of reg_record{ing,ed} for RecordingLeave

docs(vim_diff) add Recording{Enter,Leave} to features

docs(index) removed duplicate gQ

docs(options) removed line about gQ erroring in visual mode

Update runtime/doc/vim_diff.txt

Co-authored-by: zeertzjq <zeertzjq@outlook.com>

docs(vim_diff) removed double mention of Q
2021-12-18 08:54:07 -07:00
Thomas Vigouroux
8a4e26c6fe feat(autocmd): add Recording autocmds
feat(eval): add reg_recorded()

This function is used the get the last recorded register.

style(Recording): rename handler to match suggestions

fix(RecordingLeave): send autocommand earlier

This makes the autocommand fire just before setting reg_recorded to
reg_recording, this way we clearly show that we are actually just before
actually quitting the recording mode.
2021-12-18 10:54:26 +01:00
Gregory Anders
818ae74eaf
fix(diagnostic): respect "if_many" source option for virtual text (#16653)
The `prefix_source` function only evaluates the sources from the
diagnostics passed to it; however, because each namespace draws its own
virtual text, its diagnostics will never contain more than a single
source (by definition). This requires changing the semantics of what
"if_many" means from "multiple sources in a single 'batch' of
diagnostics" to "multiple sources of all diagnostics within a buffer".
2021-12-17 19:38:33 -07:00
Rishikesh Vaishnav
36c401db24
fix(lsp): correctly align start and end range to codepoints during incremental sync (#16670)
Closes #16624

Fixes two issues with aligning the start position and end position to
codepoints when calculating the start and end range.

When aligning the start position:
* use aligned byte index to calculate character index rather than 
  the unadjusted byte

When aligning the end position:
* do not adjust the end byte if it falls on a UTF-8 codepoint
* align byte to the first byte of the next codepoint rather than the
  last byte of the current codepoint
* compute character character end range on the aligned byte index

This commit also adds additional test coverage, including multibyte operations
that previously failed before this commit.
2021-12-17 18:05:00 -08:00
Gregory Anders
6a92a53c02
fix(lsp): call config on_exit handler before context is cleared (#16638)
The on_exit handler provided to the client configuration is called after
the client's context is cleared (e.g. which buffers the client was
attached to). Calling the handler sooner allows these handlers to access
the client object and do their own cleanup with the full context.
2021-12-17 12:06:44 -08:00
James McCoy
51306f98b8
Merge pull request #16681 from zeertzjq/vim-8.2.3825
vim-patch:8.2.3825: various comments could be improved
2021-12-17 07:15:42 -05:00
Christian Clason
b1757e1c29
vim-patch:0e6adf8a29d5 (#16682)
Update runtime files
0e6adf8a29
2021-12-16 21:46:13 +01:00
Gregory Anders
80210c189f
refactor(diagnostic): remove hack (#16685)
No longer required since #16548.
2021-12-16 12:13:30 -07:00
Gregory Anders
b515160cef
fix(diagnostic): assert that diagnostics have line number and column (#16683)
Line number and column are required and much of the diagnostic API
assumes that these are both present. When one of the two is missing,
cryptic errors pop up in other parts of the diagnostic subsystem.
Instead, assert that diagnostics are well formed when they are entered
into the cache, which provides a clearer error.
2021-12-16 11:20:18 -07:00
Gregory Anders
4240ce8eb3
perf: pre-compile embedded Lua source into bytecode (#16631)
The Lua modules that make up vim.lua are embedded as raw source files into the
nvim binary. These sources are loaded by the Lua runtime on startuptime. We can
pre-compile these sources into Lua bytecode before embedding them into the
binary, which minimizes the size of the binary and improves startuptime.
2021-12-16 09:27:39 -07:00
zeertzjq
f59f81c32e vim-patch:8.2.3825: various comments could be improved
Problem:    Various comments could be improved.
Solution:   Improve the comments.
52797bae17
2021-12-16 23:05:52 +08:00
James McCoy
56fa08b458
Merge pull request #16617 from pekdon/forkpty
fix: add forkpty for SunOS variants
2021-12-16 08:24:29 -05:00
Björn Linse
a402b5e2d5
Merge pull request #16134 from zeertzjq/screenpos-border
fix(screenpos, float): add top and left border adjustment
2021-12-16 12:41:43 +01:00
Michael Lingelbach
326e74571b
Merge pull request #16666 from mjlbach/fix/bad-cast 2021-12-15 13:56:41 -08:00
Hitarth Thummar
4218b7079e
docs(options): mention how to disable inccommand preview (#16534)
Co-authored-by: Hitarth Thumma
2021-12-15 22:41:24 +01:00
Michael Lingelbach
fcbffcd92a chore: improve naming consistency in str_utf_start 2021-12-15 09:07:23 -08:00
Michael Lingelbach
1a887293ef fix: do not cast offset to char_u
* str_utf_start/end both cast the offset into the utf string
to a char_u, a pointer + long is well-defined and the cast is
unnecessary. This previously resulted in issues for offsets greater than
256.
2021-12-15 09:07:23 -08:00
github-actions[bot]
4393360796
docs: regenerate (#16468)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2021-12-15 08:19:54 -07:00
Sean Dewar
0a1391fdd7
fix(terminal): fix resize crash with pending scrollback (#14891)
refresh_scrollback assumes pending scrollback rows exist only if the
terminal window height decreased (or the screen was full).

However, after accumulating scrollback, it's possible in some cases for
the terminal height to increase before refresh_scrollback is called via
invalidation (especially when the terminal buffer isn't initially
displayed in a window before nvim_open_term), which may crash.

As we'll have enough room for some scrollback rows, just append them to
the top of the buffer until it fills the window, then continue with the
previous logic for any remaining scrollback rows if necessary.
2021-12-15 08:18:06 -07:00
Christian Clason
cf65071e2e
vim-patch:8.2.3814: .csx files and .sln files are not recognized (#16662)
Problem:    .csx files and .sln files are not recognized.
Solution:   Add filetype patterns. (Doug Kearns)
cfabad9bcf
2021-12-15 16:10:03 +01:00
ii14
576408ddde
fix(ui): close floating window on BufLeave event (#16557)
When buffer is visible in two splits simultaneously, BufHidden event is
not triggered, causing the floating window to remain on screen after
switching to another buffer.

Remove BufHidden event from close_events defaults, and close the window
if we changed the buffer to something other than the buffer that spawned
the floating window or the floating window buffer itself.
2021-12-15 07:53:09 -07:00
Nicolas Hillegeer
5ba45a7cd6
fix(quickfix): avoid O(N^2) when filling from string typval (#16654)
When filling a quickfix/loclist from a string-typed VimL variable, the
complexity is O(N^2) in the number of lines in the variable.

The problem is caused by using `xstrlcpy(3)` to copy the characters from
the current position up to the next newline into the quickfix/loclist
buffer in a loop.

strlcpy(3) returns the length of `src`, so by necessity it has to
compute `strlen(src)`. This means scanning the full rest of the typval
on every iteration while only copying a small fraction (up to the next
'\n').

This is not a problem whenever the srclen-to-copylen ratio is close to
1, which it usually is. But not in this case. Since we already
calculated exactly how many bytes we want to copy, we should be using
memcpy(3).

This problem is not present in Vim, as it uses `vim_strncpy`, a
`strncpy(3)`-alike, which stops at either `\0` or `n`, whichever comes
first.

The quickfix/loclist window can be filled using a:

  1. File (used by commands like :grep/:make/... to source directly
     from their errorfile)
  2. Buffer (used by :cbuffer and its variants)
  3. Typval
   a. String (used by :cexpr and its variants)
   b. List of strings (used by setqflist(), setloclist(), :cepxr and its
   variants)

This commit optimizes case (3a), especially when the typval is a long
string.

The pathological path is triggered by (e.g.) :grep enhancements as found
in https://gist.github.com/romainl/56f0c28ef953ffc157f36cc495947ab3:

    function! Grep(...)
        return system(join([&grepprg] + a:000), ' '))
    endfunction
    :cgetexpr Grep('foo')

It would've been better for Neovim to use `systemlist` here, before this
commit.
2021-12-15 07:47:11 -07:00
zeertzjq
ffe3003e02 fix(screenpos, float): add top and left border adjustment 2021-12-15 22:40:10 +08:00
zeertzjq
14ffcd190d
test: expect the correct screen in TUI paste: big burst of input (#16656) 2021-12-15 07:35:22 -07:00
Thomas Vigouroux
bdfea9d9ae
Merge pull request #16606 from clason/bump-treesitter
build(deps): bump tree-sitter commit
2021-12-14 15:19:21 +01:00
Christian Clason
cc4c8e7af6
vim-patch:8.2.3805: i3config files are not recognized (#16645)
Problem:    i3config files are not recognized.
Solution:   Add patterns to match i3config files. (Quentin Hibon,
            closes vim/vim#7969)
8176be1598
2021-12-14 14:01:37 +01:00