Commit Graph

21311 Commits

Author SHA1 Message Date
Carlo Cabrera
dca69c90d4 build(deps): support universal builds on macOS
CMake can handle building universal binaries on macOS using the
`CMAKE_OSX_ARCHITECTURES` variable. Let's pass this variable to the
relevant dep builds. We use the `LIST_SEPARATOR` argument to prevent the
shell from interpreting the `;` that CMake uses as a list separator.

For dependencies that don't build using CMake, we only need to make sure
that the compiler is invoked with the correct `-arch` flags. The
compiler does the rest.

The only exception to this is the LuaJIT build, which we handle
separately as a special case.
2022-06-25 14:13:35 +02:00
dundargoc
0d230d3f01 build: remove CMAKE_CROSSCOMPILING code #18914
This is rarely, if ever, used and certainly not tested. It's likely this
isn't functional anymore.
2022-06-25 14:13:21 +02:00
Carlo Cabrera
a59bade869 build(luajit): support universal builds on macOS
To build universal binaries on macOS, one typically only needs to pass
multiple `-arch` flags to `clang`.

Unfortunately, this strategy causes LuaJIT builds to fail. To work
around this, we build LuaJIT for each requested architecture
individually first and then use `lipo` to package each architecture
slice into a universal binary.

To be able to do this on an Intel macOS host or an M1 macOS host without
a Rosetta installation, we need some special flags in order to tell
LuaJIT that it is cross-compiling for a different target. See [1] for
details.

[1] https://luajit.org/install.html#cross
2022-06-25 14:07:19 +02:00
William Boman
f2b465232d fix(lsp): make sure to always reset active codelens refreshes (#18331)
This fixes issues where subsequent calls to vim.lsp.codelens.refresh()
would have no effect due to the buffer not getting cleared from the
active_refresh table.

Examples of how such scenarios would occur are:
  - A textDocument/codeLens result yielded an error.
  - The 'textDocument/codeLens' handler was overriden in such a way that
    it no longer called vim.lsp.codelens.on_codelens().

(cherry picked from commit 94eb72cc44)
2022-06-25 12:31:58 +02:00
Mathias Fussenegger
b3d754ccd7 fix(lsp): fix multi client handling in code action (#18869)
Fixes https://github.com/neovim/neovim/issues/18860

(cherry picked from commit e4df1c9b9e)
2022-06-25 12:22:17 +02:00
Christian Clason
e820c6d7c3 Merge pull request #19069 from neovim/backport-19056-to-release-0.7
[Backport release-0.7] fix(api): check for inclusive buffer line index out of bounds correctly
2022-06-23 16:58:40 +02:00
zeertzjq
cf9c097f34 fix(api): check for inclusive buffer line index out of bounds correctly
(cherry picked from commit 01ee7152c5)
2022-06-23 13:40:46 +00:00
zeertzjq
3942a3f5d0 Merge pull request #19065 from neovim/backport-19064-to-release-0.7
[Backport release-0.7] vim-patch:8.2.5152: search() gets stuck with "c" and skip evaluates to true
2022-06-23 20:19:12 +08:00
zeertzjq
c0224b59da vim-patch:8.2.5152: search() gets stuck with "c" and skip evaluates to true
Problem:    search() gets stuck with "c" and skip evaluates to true.
Solution:   Reset the SEARCH_START option. (closes vim/vim#10608)
180246cfd1
(cherry picked from commit c527be5600)
2022-06-23 11:35:15 +00:00
zeertzjq
a05da1c05a Merge pull request #19053 from neovim/backport-19047-to-release-0.7
[Backport release-0.7] fix(input): use correct grid when restoring cursor for <expr> mapping
2022-06-23 07:00:23 +08:00
zeertzjq
17299b302c fix(input): use correct grid when restoring cursor for <expr> mapping
(cherry picked from commit 2d4c992dbe)
2022-06-22 22:04:40 +00:00
Christian Clason
2fe25ad06c Merge pull request #19037 from neovim/backport-19033-to-release-0.7
[Backport release-0.7] Update docs concerning $NVIM_LISTEN_ADDRESS
2022-06-21 10:28:13 +02:00
eyalk11
6349ec9e7c docs(deprecated): alternatives for $NVIM_LISTEN_ADDRESS
(cherry picked from commit 905093f6ae)
2022-06-21 08:26:22 +00:00
Christian Clason
7266150eff Merge pull request #19025 from neovim/extmark-conceal
[Backport release-0.7] fix(decorations): nvim_buf_set_extmark breaks conceal (#19010)
2022-06-19 20:46:06 +02:00
ii14
40e13c8d95 fix(decorations): nvim_buf_set_extmark breaks conceal #19010
Closes #19007

Co-authored-by: bfredl <bjorn.linse@gmail.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-06-19 19:39:14 +02:00
Christian Clason
38928b5cc2 Merge pull request #19023 from neovim/backport-18932-to-release-0.7
[Backport release-0.7] fix(tui): fix piping output make nvim unusable
2022-06-19 18:12:57 +02:00
Kevin Jiang
18e0d64666 fix(tui): fix piping output make nvim unusable
fix(tui): fix piping output make nvim unusable

(cherry picked from commit 72ce1f308b)
2022-06-19 15:23:13 +00:00
Christian Clason
d78447481c Merge pull request #19022 from neovim/ci-macos-release
[Backport release-0.7] ci(release): skip CoreServices system library on macOS (#19021)
2022-06-19 17:01:41 +02:00
Christian Clason
e2915709b0 ci(release): skip CoreServices system library on macOS (#19021)
Problem:
The release script bundles a system library (CoreServices) that was
added in #18294, which leads to errors on M1 since the architecture is
different from the Github runner.

Solution:
Skip CoreServices when bundling the libraries (as was done for the
CoreFoundation library that #18294 replaced with CoreServices).
2022-06-19 16:22:12 +02:00
Christian Clason
cd7ac0eb29 Merge pull request #19014 from neovim/backport-18982-to-release-0.7
[Backport release-0.7] fix: use ctermbg/fg instead of bg/fg when use_rgb is false
2022-06-18 18:51:48 +02:00
Oliver Marriott
433f3067a0 fix: use ctermbg/fg instead of bg/fg when use_rgb is false
(cherry picked from commit d76ecae4ae)
2022-06-18 15:36:50 +00:00
Christian Clason
30ae06c8fe Merge pull request #19009 from neovim/backport-18820-to-release-0.7
[Backport release-0.7] fix(hl): backport #18820, #18981, #18870
2022-06-18 15:03:56 +02:00
zbirenbaum
777d415da8 fix(highlight): let winhighlight use cursor 2022-06-18 14:14:24 +02:00
Oliver Marriott
f70e0832b1 fix(hl): return cterm fg/bg even if they match Normal #18981
Fixes #18980

- 831fa45ad8 is related but this doesn't regress that
- The `cterm_normal_fg_color != ae.cterm_fg_color` comparison is originally
  carried from patch to patch starting all the way back in 29bc6dfabd where it
  was avoiding setting a HL attr. But `hlattrs2dict()` now is just
  informational.
2022-06-18 13:21:01 +02:00
Oliver Marriott
ee210b0f74 fix(hl): DRY set_hl_group() sg_attr set
(cherry picked from commit 9747e984e1)
2022-06-18 11:18:39 +00:00
Oliver Marriott
512a8197c8 test(hl): Add Normal group set_hl/get_hl_by_name check
(cherry picked from commit 02f70c1638)
2022-06-18 11:18:39 +00:00
Oliver Marriott
79ca64a1ef fix(hl): set Normal hl group sg_attr value (fixes #18024)
(cherry picked from commit 03b4b07162)
2022-06-18 11:18:39 +00:00
Christian Clason
2ebc76b226 Merge pull request #19001 from neovim/backport-18861-to-release-0.7
[Backport release-0.7] fix(startup): nvim with --clean should not load user rplugins
2022-06-17 18:09:11 +02:00
bfredl
41709831ae fix(startup): nvim with --clean should not load user rplugins
runtime rplugins such like legacy script providers are not affected
by this change.

(cherry picked from commit aad20de5ab)
2022-06-17 15:17:41 +00:00
github-actions[bot]
fdd5178581 [Backport release-0.7] introduce $NVIM, unset $NVIM_LISTEN_ADDRESS (#18986)
feat(server): introduce $NVIM

PROBLEM
------------------------------------------------------------------------
$NVIM_LISTEN_ADDRESS has conflicting purposes as both a parameter ("the
current process should listen on this address") and a descriptor ("the
current process is a child of this address").

This contradiction means the presence of NVIM_LISTEN_ADDRESS is
ambiguous, so child Nvim always tries to listen on its _parent's_
socket. This is the cause of lots of  "Failed to start server" spam in
our test/CI logs:

    WARN  2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-4480-0
    WARN  2022-04-30… server_start:154: Failed to start server: address already in use: \\.\pipe\nvim-2168-0

SOLUTION
------------------------------------------------------------------------

1. Set $NVIM to the parent v:servername, *only* in child processes.
   - Now the correct way to detect a "parent" Nvim is to check for $NVIM.
2. Do NOT set $NVIM_LISTEN_ADDRESS in child processes.
3. On startup if $NVIM_LISTEN_ADDRESS exists, unset it immediately after
   server init.
4. Open a channel to parent automatically, expose it as v:parent.

Fixes #3118
Fixes #6764
Fixes #9336
Ref https://github.com/neovim/neovim/pull/8247#issuecomment-380275696
Ref #8696

(cherry picked from commit b9d97f5951)

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2022-06-16 18:30:08 -07:00
github-actions[bot]
ed9e6d19ab [Backport release-0.7] fix(treesitter): new iter if folded (#18990)
fix(treesitter): new iter if folded

(cherry picked from commit 8780076a78)

Co-authored-by: kevinhwang91 <kevin.hwang@live.com>
2022-06-16 19:08:48 +02:00
Christian Clason
05ce04e994 Merge pull request #18984 from neovim/fix-highlight-yank
backport highlight.on_yank timer fixes #18824 and #18976
2022-06-16 15:10:22 +02:00
zeertzjq
351b5969c1 vim-patch:8.2.5097: using uninitialized memory when using 'listchars' (#18985)
Problem:    Using uninitialized memory when using 'listchars'.
Solution:   Use the length returned by mb_char2bytes(). (closes vim/vim#10576)
74ac29cecd
2022-06-16 19:09:59 +08:00
notomo
fe42dea674 fix(lua): highlight.on_yank can close timer in twice #18976
check whether timer is closing in vim.defer_fn before closing
2022-06-16 12:27:59 +02:00
Wsevolod
f15d6094fc fix(lua): stop pending highlight.on_yank timer, if any (#18824)
When yanking another range while previous yank is still highlighted, the
pending timer could clear the highlight almost immediately (especially
when using larger `timeout`, i.e. 2000)
2022-06-16 12:26:03 +02:00
zeertzjq
5243cb8a4b Merge pull request #18975 from neovim/backport-18969-to-release-0.7
[Backport release-0.7] fix(ui): do not call showmode() when setting window height
2022-06-15 20:12:54 +08:00
zeertzjq
bf4df2a629 fix(ui): do not call showmode() when setting window height
(cherry picked from commit 756e65ae62)
2022-06-15 11:42:36 +00:00
zeertzjq
3cea4d6de9 Merge pull request #18942 from neovim/backport-18933-to-release-0.7
[Backport release-0.7] fix(buffer): disable buffer-updates before removing buffer from window
2022-06-13 07:44:20 +08:00
zeertzjq
05f6883ee2 fix(buffer): disable buffer-updates before removing buffer from window
There can be other places that access window buffer info (e.g.
`tabpagebuflist()`), so checking `w_closing` in `win_findbuf()` doesn't
solve the crash in all cases, and may also cause Nvim's behavior to
diverge from Vim.

(cherry picked from commit fa30ef1c31)
2022-06-12 22:02:42 +00:00
zeertzjq
1dba6cf8f0 Merge pull request #18918 from neovim/backport-18917-to-release-0.7
[Backport release-0.7] fix(input): fix macro recording with ALT and special key
2022-06-10 17:57:09 +08:00
zeertzjq
0c9d666205 fix(input): fix macro recording with ALT and special key
(cherry picked from commit d6b309e20b)
2022-06-10 09:14:45 +00:00
James McCoy
fc4e4b38b2 Merge pull request #18905 from neovim/backport-18903-to-release-0.7
[Backport release-0.7] test(ts): skip test if C parser is not available
2022-06-08 21:11:27 -04:00
James McCoy
bd3bb128c0 test(ts): skip test if C parser is not available
(cherry picked from commit 6b0595d7cc)
2022-06-09 01:10:36 +00:00
zeertzjq
d317cb2322 Merge pull request #18886 from neovim/backport-18885-to-release-0.7
[Backport release-0.7] fix(input): allow Ctrl-C to interrupt a recursive mapping even if mapped
2022-06-07 13:10:43 +08:00
zeertzjq
1496f4212b fix(input): allow Ctrl-C to interrupt a recursive mapping even if mapped
(cherry picked from commit 56895cf4de)
2022-06-07 04:45:25 +00:00
zeertzjq
f0f63502ce Merge pull request #18873 from neovim/backport-18872-to-release-0.7
[Backport release-0.7] vim-patch:8.2.5058: input() does not handle composing characters properly
2022-06-06 06:32:46 +08:00
zeertzjq
df19f086ba Merge pull request #18874 from neovim/backport-18831-to-release-0.7
[Backport release-0.7] ci(provider): skip perl provider tests on macos
2022-06-06 06:32:07 +08:00
Dundar Goc
0e10b17164 ci(provider): skip installing perl provider on macOS
The macOS CI jobs fail to properly install the perl provider, making the
entire thing fail.

(cherry picked from commit 79bf507449)
2022-06-05 22:04:01 +00:00
zeertzjq
6768784feb vim-patch:8.2.5058: input() does not handle composing characters properly
Problem:    input() does not handle composing characters properly.
Solution:   Use mb_cptr2char_adv() instead of mb_ptr2char_adv().
            (closes vim/vim#10527)
e3a529bc87

Cherry-pick all of Test_input_func() from patch 8.2.0316.

(cherry picked from commit 84ed71f319)
2022-06-05 21:46:39 +00:00
zeertzjq
2146a48587 Merge pull request #18751 from neovim/backport-18138-to-release-0.7
[Backport release-0.7] vim-patch:8.2.4767: openscad files are not recognized
2022-05-26 10:52:58 +08:00