Commit Graph

24832 Commits

Author SHA1 Message Date
Jonas Strittmatter
b518aceaa8
feat(filetype): fall back to file extension when matching from hashbang (#22140)
If nothing matched in match_from_hashbang, also check the file extension table.
For a hashbang like '#!/bin/env foo', this will set the filetype to 'fooscript'
assuming the filetype for the 'foo' extension is 'fooscript' in the extension
table.
2023-02-13 16:04:16 -07:00
dundargoc
1d6bb0892b
build: remove ENABLE_COMPILER_SUGGESTIONS option (#22249)
We need higher level and more meaningful cmake options. Having a cmake
option for only controlling compiler flags is probably not worth it as
the same can be achieved with:

cmake -B build -D CMAKE_C_FLAGS=<compiler option>
2023-02-13 20:55:49 +01:00
dundargoc
bb9c673d2c
ci: automatically maximize MIN_LOG_LEVEL if CI detected (#22248)
Detect if on CI by checking that the CI environment variable is set to "true".
This is a common pattern among CI providers, including github actions and
cirrus.
2023-02-13 20:04:54 +01:00
Justin M. Keyes
84cf6a0a7e
ci(lintcommit): allow UPPER_CASE first word (#22245) 2023-02-13 18:26:27 +01:00
dundargoc
9de9bd4bed
ci: replace cmake script with bash script (#22246)
Bash has better error handling than cmake, and seem overall slightly
more suited to scripting than cmake.
2023-02-13 18:26:01 +01:00
Lewis Russell
d359f7a533
Merge pull request #22191 from lewis6991/feat/playground_imp
feat(treesitter): playground improvements
2023-02-13 10:54:03 +00:00
zeertzjq
89722ddfac
Merge pull request #22233 from zeertzjq/resize-screenclear
fix(ui): make sure screen is valid after resizing
2023-02-13 09:46:16 +08:00
zeertzjq
41ebe41b62 fix(ui-ext): force cursor update after resize in char-based UI
Neither ui/screen.lua nor Neovim Qt keep cursor position after resizing.
2023-02-13 08:50:54 +08:00
zeertzjq
c2375efe56 fix(ui): make sure screen is valid after resizing
Problem:
When not inside an Ex command, screen_resize() calls update_screen(),
which calls screenclear() and set the screen as valid. However, when
inside an Ex command, redrawing is postponed so update_screen() screen
doesn't do anything, and the screen is still invalid after the resize,
causing ui_comp_raw_line() to be no-op until update_screen() is called
on the main loop.

Solution:
Restore the call to screenclear() inside screen_resize() so that the
screen is invalid after screen_resize(). Since screenclear() changes
redraw type from UPD_CLEAR to UPD_NOT_VALID, it is called at most once
for each resize, so this shouldn't change how much code is run in the
common (not inside an Ex command) case.
2023-02-13 08:50:54 +08:00
dundargoc
5d3769ea23
ci: install dependencies with a single script (#22241)
It's easier if the os-specific installations are done by the script itself
2023-02-12 22:09:10 +01:00
dundargoc
5f72ab77bf
refactor: reduce scope of locals as per the style guide 3 (#22221)
refactor: reduce scope of locals as per the style guide
2023-02-12 18:48:49 +01:00
dundargoc
2b1c07a1d4
ci: remove unnecessary matrix from codeql workflow (#22239) 2023-02-12 18:12:17 +01:00
dundargoc
477d4bbf5f
ci: inline external environment scripts (#22237)
Scripts that define the build itself shouldn't be external as they lead
to hard to find bugs.
2023-02-12 18:08:37 +01:00
dundargoc
47638706a3
build: treat clang-tidy warnings as errors (#22238) 2023-02-12 17:41:54 +01:00
dundargoc
f573fcbc0d
build: don't check environment variable to detect CI (#22234)
Instead use the cmake option, which should act as the definitive source
to determine whether we use CI or not.
2023-02-12 14:42:00 +01:00
dundargoc
c099836168
ci: convert environment variables to matrix variables (#22224)
Having as few indirections as possible makes it easier to understand the
code.
2023-02-12 13:09:46 +01:00
dundargoc
e81b4274fc
ci: delete ci/ (#22227)
Having CI scripts that is separate from the build system causes
tremendous amounts of problems, headaches and bugs. Testing the validity
of the scripts locally become near impossible as time goes on as they're
only vetted if it works on whatever CI provider we happened to have at
the time, with their own quirks and behavior.

The extra indirection between "cmake <-> general CI scripts <-> GHA" is
also a frequent source of problems, as the orchestration needs to be
done with environment variables, cmake flags and github actions matrix
strategy. This combination has turned out to be exceptionally fragile.

Examples:
15394b6855
13aa23b62a
https://github.com/neovim/neovim/pull/22072#discussion_r1094390713

A lot of the code was inlined to .github/workflows/ci.yml without
further modifications. While this in itself doesn't integrate with our
build system any more than the current situation, it does
1. remove a level of indirection, and more importantly
2. allow us to slowly start integrating the CI into our build system now
   that all the relevant code is in one place.
2023-02-12 11:50:08 +01:00
dundargoc
3a5dddf24f
ci: show all logs at the end of a run (#22226)
* ci: show all logs at the end of a run

The current CI won't show the logs on error due to early exit. This will
at least show the logs, although for all tests at once.
2023-02-11 18:16:04 +01:00
Jonas Strittmatter
9668c166e8
fix(filetype): make vim.filetype.match() work with contents only (#22181)
Co-authored-by: Gregory Anders <greg@gpanders.com>
2023-02-11 08:08:33 -07:00
dundargoc
24ec0aaa7a
ci: don't delete core dumps at the start of the run (#22223)
There shouldn't be any core dumps before we have started testing.
2023-02-11 14:51:41 +01:00
dundargoc
27177e5819
refactor: reduce scope of locals as per the style guide (#22211) 2023-02-11 14:14:24 +01:00
glacambre
c5b34fa554 refactor: move init_default_autocmds to lua
The original motivation for this change came from developping
https://github.com/neovim/neovim/pull/22159, which will require adding
more autocommand creation to Neovim's startup sequence.

This change requires lightly editing a test that expected no autocommand
to have been created from lua.
2023-02-11 14:02:17 +01:00
glacambre
5ca6cf55f9 fix(helpers): restore channel id after a call to WITH_SCRIPT_CONTEXT
In https://github.com/neovim/neovim/pull/22214, init_default_autocmds
has been turned into a lua function call to nvim_create_augroup and
nvim_create_autocmd.

This introduced a strange regression: a test in vim_spec.lua started
failing with its last_set_chan value switching from 0 to
-9223372036854775808.

It turns out that -9223372036854775808 is the value of LUA_INTERNAL_CALL
and would be inherited as last_set_chan by options set from the command
line due to the WITH_SCRIPT_CONTEXT macro not restoring the channel id
(WITH_SCRIPT_CONTEXT is used by nvim_create_augroup).
2023-02-11 14:02:17 +01:00
zeertzjq
224a3c77ca
vim-patch:9.0.1295: the option initialization function is too long (#22222)
Problem:    The option initialization function is too long.
Solution:   Move code to separate functions. (Yegappan Lakshmanan,
            closes vim/vim#11966)

6c41bedeed

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-11 20:56:42 +08:00
dundargoc
883ec20d9f
ci: inline build commands and remove before_script.sh (#22202)
Abstracting the build commands to a separate script makes it more
difficult to reason about it and more error-prone.
2023-02-11 13:27:43 +01:00
dundargoc
b0d156c00b
ci: run lintcommit file from PR branch (#22219)
As the trigger type is no longer pull_request_target there is no longer
any risk of using the lintcommit script directly from the user PR.
2023-02-11 13:22:54 +01:00
zeertzjq
374955bcc5
vim-patch:9.0.1300: 'statusline' only supports one "%=" item (#22218)
Problem:    'statusline' only supports one "%=" item.
Solution:   Add support for multiple "%=" items. (TJ DeVries, Yegappan
            Lakshmanan, closes vim/vim#11970, closes vim/vim#11965)

3ec78f973f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-02-11 20:00:31 +08:00
zeertzjq
414ff7742f
Merge pull request #22217 from zeertzjq/vim-9.0.1298
vim-patch:9.0.{1298,1299}: c_CTRL-R_CTRL-R doesn't trigger incsearch
2023-02-11 19:28:26 +08:00
zeertzjq
f1fcdcc2c4 vim-patch:9.0.1299: change for triggering incsearch not sufficiently tested
Problem:    Change for triggering incsearch not sufficiently tested.
Solution:   Add a test case.  Simplify the code. (closes vim/vim#11971)

412e0e4ed9
2023-02-11 19:04:28 +08:00
zeertzjq
9437800d28 vim-patch:9.0.1298: inserting register on the cmdline does not trigger incsearch
Problem:    Inserting a register on the command line does not trigger
            incsearch or update hlsearch.
Solution:   Have cmdline_insert_reg() return CMDLINE_CHANGED when appropriate
            and handle it correctly. (Ken Takata, closes vim/vim#11960)

c4b7dec382

Co-authored-by: K.Takata <kentkt@csc.jp>
2023-02-11 19:04:27 +08:00
zeertzjq
7d58de11f4
fix(rpc)!: preseve files when stdio channel is closed (#22137)
BREAKING CHANGE: Unsaved changes are now preserved rather than discarded
when stdio channel is closed.
2023-02-11 18:25:01 +08:00
dundargoc
4be6c6cf0d
refactor: replace char_u with char (#21901)
refactor: replace char_u with char

Work on https://github.com/neovim/neovim/issues/459
2023-02-11 11:05:57 +01:00
dundargoc
ee87b848a2
ci: remove reviewers from the refactor label (#22216)
Anyone can review a refactor depending on what's being refactored.
2023-02-11 10:47:10 +01:00
Sizhe Zhao
165b07b269
docs: reword news.txt to ensure a consistent style (#22215) 2023-02-11 10:34:20 +01:00
dundargoc
7224c889e0
build: enable MSVC level 3 warnings (#21934)
MSVC has 4 different warning levels: 1 (severe), 2 (significant), 3
(production quality) and 4 (informational). Enabling level 3 warnings
mostly revealed conversion problems, similar to GCC/clang -Wconversion
flag.
2023-02-11 10:25:24 +01:00
dundargoc
c8c930ea78
refactor: reduce scope of locals as per the style guide (#22206) 2023-02-11 10:24:46 +01:00
zeertzjq
c9b0fe1f41
vim-patch:9.0.1297: wrong value for $LC_CTYPE makes the environ test fail (#22210)
Problem:    Wrong value for $LC_CTYPE makes the environ test fail.
Solution:   Unset $LC_CTYPE when running tests. (closes vim/vim#11963)

962d916435

Co-authored-by: WuerfelDev <dev@wuerfeldev.de>
2023-02-11 08:20:31 +08:00
bfredl
24aebbb3de
Merge pull request #21887 from bfredl/asanterror
build(ci): let ASAN print tracebacks for more errors (SIGABORT, SIGILL)
2023-02-10 22:32:44 +01:00
bfredl
87d0809545 build(ci): let ASAN print tracebacks for more errors (SIGABORT, SIGILL) 2023-02-10 22:14:45 +01:00
bfredl
b8ad1bfe8b
Merge pull request #22077 from bfredl/neolua_client
refactor(tests): integrate lua-client into core and use core for functionaltests
2023-02-10 20:51:36 +01:00
dundargoc
4c64cbe99f
build: mark uninteresting variables as advanced (#22208)
Only the most important variables should be shown by default.
2023-02-10 20:20:18 +01:00
bfredl
0837980db4 fix(client): wait for session to exit
This replicates the old native.pid_wait(self._pid)
call, except using the proper libuv pattern (run loop unitil exit
callback)
2023-02-10 20:19:04 +01:00
bfredl
f8f82901cd fix(tests): fixes for using vim.mpack and more ASAN 2023-02-10 20:19:04 +01:00
bfredl
d6279f9392 refactor(tests): move lua-client into core and use it for functionaltests
Eliminates lua-client and non-static libluv as test time dependencies

Note: the API for a public lua-client is not yet finished.
The interface needs to be adjusted to work in the embedded loop
of a nvim instance (to use it to talk between instances)
2023-02-10 20:19:04 +01:00
bfredl
84328bae08
Merge pull request #22194 from bfredl/noflush
refactor(ui): remove some superfluous redraw and ui_flush() calls
2023-02-10 20:09:14 +01:00
Lewis Russell
8a985d12dd fix(treesitter): don't trample parsers when filetype!=lang
This allows vim.treesitter.show_tree() to work on buffers where the
filetype does not match the parser language name e.g, bash/sh.
2023-02-10 16:15:56 +00:00
Lewis Russell
f5bad01869 feat(treesitter): playground improvements
- Render node ranges as virtual text
- Set filettype=query. The virtual text is to avoid parsing errors.
- Make sure highlights text is always in view.
2023-02-10 16:15:55 +00:00
dundargoc
e5d8220179
ci: simplify lintcommit output (#22204)
- Suggest reading CONTRIBUTING.md once, not for each commit failure
- Suggest using "fix" type if none of the provided types are appropriate
- Remove "dist" type. It's rarely used and can be replaced by using the
  "build" type
2023-02-10 17:03:01 +01:00
dundargoc
d5b1712dc4
ci: remove unnecessary environment variables (#22175) 2023-02-10 13:56:07 +01:00
dundargoc
827947447e
ci: split functionaltest-lua into two separate jobs (#22201)
More specifically, move the job testing the oldest supported cmake into
its own job. This opens the way for other jobs to use powerful and
advanced cmake features such as choosing which files to use with the -S
flag.

Removed testing from this job as this probably won't reveal anything
that other jobs already doesn't already show, since the only difference
is the cmake version.
2023-02-10 12:04:00 +01:00