Commit Graph

19897 Commits

Author SHA1 Message Date
Björn Linse
2ae63161e8
Merge pull request #16725 from VVKot/vim-8.1.0040
vim-patch:8.1.0040: warnings from 64-bit compiler
2021-12-25 19:32:13 +01:00
James McCoy
fb14e2a8d6
fix(msgpack#strptime): use calendar.timegm to get seconds since epoch
datetime.datetime.timestamp does not exist on Windows and
datetime.datetiem.strftime('%s') is not supported, since '%s' is a POSIX
format.  Instead, use the recommended `calendar.timegm(obj.utctimetuple())`.
2021-12-25 12:11:34 -05:00
James McCoy
9e93e5c0c8
Merge pull request #16786 from jamessan/cancel-previous-ci
ci: cancel in-progress CI if a PR is updated
2021-12-25 12:03:01 -05:00
James McCoy
094c3f2b54
ci: cancel in-progress CI if a PR is updated
[skip ci]
2021-12-25 11:11:54 -05:00
dundargoc
4f95224907
vim-patch:8.2.3873: go.mod files are not recognized (#16757)
Problem:    go.mod files are not recognized.
Solution:   Check for the file name. (closes vim/vim#9380)
82b3b4c6cf
2021-12-25 15:17:55 +01:00
Björn Linse
3e81c1f9b5
Merge pull request #16762 from zeertzjq/grid-truncate-pum-double-width
Truncate double-width character at the end of popup menu correctly
2021-12-25 13:36:37 +01:00
Maverun
d2f62b3164
chore(editorconfig): set max_line_length for .h and .in files (#16775) 2021-12-24 22:35:38 -07:00
Sean Dewar
70a68dc2c5
fix(options): disallow empty 'fdc' and 'scl' (#16765)
Empty string values for these options aren't actually allowed, but
check_opt_strings allows empty string options.

It so happens that 'scl' handles empty string like "auto", but empty 'fdc'
causes glitchiness (win_fdccol_count returns an incorrect value).

Just disallow empty string values for these options completely.
2021-12-24 22:30:34 -07:00
zeertzjq
a5d3dd9359 vim-patch:partial:0e6adf8a29d5
Update runtime files
0e6adf8a29
2021-12-25 11:31:54 +08:00
zeertzjq
cf609ce655 vim-patch:8.2.3784: the help for options is outdated
Problem:    The help for options is outdated.
Solution:   Include all the recent changes.
7b1463bca3

This is the only applicable hunk.
2021-12-25 11:31:54 +08:00
zeertzjq
42cf76fd0a vim-patch:8.2.3780: ":cd" works differently on MS-Windows
Problem:    ":cd" works differently on MS-Windows.
Solution:   Add the 'cdhome' option. (closes vim/vim#9324)
29f3a45915
2021-12-25 11:31:54 +08:00
zeertzjq
ccc4d83507 vim-patch:partial:6c391a74fe90
Update runtime files
6c391a74fe
2021-12-25 08:36:32 +08:00
zeertzjq
7fa8411d8b vim-patch:partial:6aa57295cfbe
Update runtime files
6aa57295cf
2021-12-25 08:32:58 +08:00
zeertzjq
8eff0ca6d5 vim-patch:8.2.2468: not easy to get the full command name from a shortened one
Problem:    Not easy to get the full command name from a shortened one.
Solution:   Add fullcommand(). (Martin Tournoij, closes vim/vim#7777)
038e09ee76
2021-12-25 07:42:06 +08:00
zeertzjq
903ec5bd85 vim-patch:8.2.3882: more duplicated code in f_getreginfo()
Problem:    More duplicated code in f_getreginfo().
Solution:   Also use getreg_get_regname(). (closes vim/vim#9398)
d3f00f54bf
2021-12-24 21:20:34 +08:00
zeertzjq
125e870772 vim-patch:8.2.3879: getreg() and getregtype() contain dead code
Problem:    getreg() and getregtype() contain dead code.
Solution:   Remove the needless check. (closes vim/vim#9392)  Also refactor to put
            common code in a shared function.
51e64b2789
2021-12-24 21:20:34 +08:00
zeertzjq
4f70b31f7a refactor(pum_redraw): rename col -> grid_col
This is initialized to `col_off`, while in Vim this variable `col` that
is used in the same places is initialized to `pum_col`. This can cause
confusion in patch porting, and it caused Vim patch 8.2.1995 to be
ported incorrectly. (I reverted the incorrect part in the last commit
though.) Rename it to `grid_col` to make it clear that it is different
from Vim's `col` variable.
2021-12-24 08:06:27 +08:00
zeertzjq
e6d35b9e40 fix(pum_redraw): use grid_puts_len() to truncate the text
Nvim already resizes grid to the required width, so there is no need to
truncate the text in pum_redraw(). What's more, truncation is currently
done incorrectly because Vim patch 8.2.1995 was ported incorrectly.

This nearly reverts the truncation part of Vim patch 8.2.1995, but not
the part that reduces unnecessary calls to pum_redraw(). The original PR
https://github.com/vim/vim/pull/7306 didn't explain much about which
part of it actually reduces redraws.
2021-12-24 08:06:27 +08:00
zeertzjq
28dadd5a54 fix(screen): truncate when overwriting right half of a double-width char
Unlike the code above, this truncates the character in the same grid.
This is mainly for the pum scrollbar in the next commit.
2021-12-24 08:06:27 +08:00
zeertzjq
bc75544fac fix(screen): truncate double-width character correctly
The `c = '>';` is useless here, because it is not used later.
`u8c` should also need to be set to '>', and `u8cc` needs to be cleared.
2021-12-24 08:06:26 +08:00
Gregory Anders
0d7a97224f
chore: set max_line_length in editorconfig (#16755)
We established a while ago that 100 chars is our line length for both C
and Lua. Not all editorconfig plugins support the "max_line_length"
option, but many do (including all of the ones available for Vim/Neovim
to the best of my knowledge).
2021-12-23 06:46:57 -07:00
github-actions[bot]
bc27d807f3
docs: regenerate (#16742)
Co-authored-by: marvim <marvim@users.noreply.github.com>
2021-12-23 13:55:38 +01:00
James McCoy
7b8fbbdebe
Merge pull request #16754 from jamessan/vim-8.2.3874
vim-patch:8.2.3874
2021-12-22 17:34:36 -05:00
James McCoy
29141fc66a
vim-patch:8.2.3874: cannot highlight the number column for a sign
Problem:    Cannot highlight the number column for a sign.
Solution:   Add the "numhl" argument. (James McCoy, closes vim/vim#9381)
a80aad7174
2021-12-22 15:03:32 -05:00
zeertzjq
0c35fd5fcc
refactor: fix comment spacing in option.h (#16749) 2021-12-21 18:13:17 -07:00
Gregory Anders
33cd1ba00a
fix(api): make nil value in nvim_set_option_value clear local value (#16710)
For special options such as 'undolevels' and 'scrolloff', this sets the
local value to the special "unset" value (e.g. -12345 for 'undolevels').
2021-12-21 14:20:34 -07:00
Michael Lingelbach
1b04da52b3
feat(lsp): add buf_detach_client (#16250)
This allows the user to detach an active buffer from the language
client. If no clients remain attached to a buffer, the on_lines callback
is used to cancel nvim_buf_attach.
2021-12-21 10:53:34 -08:00
James McCoy
1062ea2cc5
Merge pull request #16736 from dundargoc/ci/remove-unused-typo-fix
ci: remove unused "squash typo" workflow
2021-12-20 17:52:19 -05:00
Dundar Göc
89a844a9c7 ci: remove unused "squash typo" workflow 2021-12-20 23:47:04 +01:00
James McCoy
9241c684e1
Merge pull request #16734 from zeertzjq/chdir-refactor
refactor: remove some chdir-related unnecessary calls and checks
2021-12-20 14:28:11 -05:00
Rishikesh Vaishnav
9625832372
fix(lsp): fix nil-index behavior for UTF-8 in _str_*index_enc methods (#16731)
Previously, the `_str_utfindex_enc` and `_str_byteindex_enc` helper functions would return `nil` when `offset_encoding == "utf-8"` and `index == nil`. Clearly, this doesn't reflect the expected behavior of the functions they're wrapping which would return the length of the line in this case. This should fix behavior with servers that use UTF-8 `offset_encoding` when applying text edits, formatting a range, and doing range code actions (though this isn't tested currently).
2021-12-20 08:54:05 -08:00
James McCoy
63b21ab30d
Merge pull request #16727 from dundargoc/docs/remove-good-first-issue-suggestion
docs: stop suggestion "good first issue" as a good first issue
2021-12-20 11:35:07 -05:00
zeertzjq
09c412837f refactor: remove some chdir-related unnecessary calls and checks
xmalloc() always retuns a valid pointer.

Calling os_chdir() with the same directory as the current one doesn't do
anything other than wasting time.
2021-12-20 18:58:13 +08:00
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