Commit Graph

438 Commits

Author SHA1 Message Date
dundargoc
fc8c77a69f
ci: split ci.yml into a test workflow and a build test workflow (#22302)
Having a workflow that only builds neovim without running all of the
tests is a cheap way to test the build still works without burning too
much CI time.
2023-02-18 10:47:22 +01:00
dundargoc
fe1e6b82f4
ci: inline test.sh to run_tests.sh (#22198)
This will get rid of the common/ directory.
2023-02-10 00:42:37 +01:00
dundargoc
ffd216e869
build: create test/CMakeLists.txt and move test-related code (#22179)
Having a clear separation between build code and test code makes it
easier to get a higher-level understanding of how the neovim build
works.
2023-02-08 23:46:39 +01:00
dundargoc
d6d3a92013
build: replace check-single-includes with clang-tidy (#22061)
Clang-tidy already does what check-single-includes does automatically on
top of its regular linting. It is also generator independent, so it
doesn't take an eternity to run on slower generators such as Visual
Studio.
2023-02-08 18:16:48 +01:00
dundargoc
4d2c1004e9
build: prefer -D <variable>=<value> over -D<variable>=<value> (#22164)
This makes it easier to see that -D is referring to the entire
"<variable>=<value>", rather than only <variable>. It also help syntax
highlighters highlight built-in variables.
2023-02-08 11:00:16 +01:00
Enan Ajmain
645daaf5e9
build(Windows): make bundling nvim-qt optional (#21866)
Closes https://github.com/neovim/neovim/issues/14552.
2023-02-08 10:08:18 +01:00
dundargoc
f9826e1dff
build: stop relying on CMAKE_BUILD_TYPE to determine the build type (#22051)
Any logic involving CMAKE_BUILD_TYPE is automatically broken as it won't
work with multi-config generators. The only exception is if we
explicitly check whether the current generator is single-config as well.
Instead, use generator expressions or cmake variables that allows to set
options for certain build types only such as
INTERPROCEDURAL_OPTIMIZATION_<CONFIG>.

Opt to generate all headers with optimization level O2 with no debug
information for all build types as that is the simplest way to make it
behave the same for all generators.
2023-02-03 00:00:15 +01:00
dundargoc
ebd2372f92
refactor: use flexible arrays instead of the length-of-one trick (#22072)
The "length-of-one" trick, where the last element of a struct is an
array of size 1, but extra size is allocated when calling malloc where
it uses more than 1 element in the array, cause problems with some
compilers. Some compilers set _FORTIFY_SOURCE=2 by default which
incorrectly considers it as an overflow. More information:
https://github.com/neovim/neovim/issues/223#issuecomment-1413828554

Using flexible array members allows us to to properly convey to the
compiler that its size may be larger than 1. This also enables us to
remove lengthy workarounds that are unreliable, as they depend on
CMAKE_BUILD_TYPE which isn't defined for multi-config generators.

Closes: https://github.com/neovim/neovim/issues/223
2023-02-02 23:56:25 +01:00
dundargoc
533bdcb25e
build: remove unnecessary file generation (#22099)
paths.lua.in doesn't rely on any generator expressions, so it's safe to
remove file(GENERATE).
2023-02-02 12:27:48 +01:00
bfredl
13aa23b62a refactor(tests): run unittests using main nvim binary in interpreter mode
This allows us to get rid of the separate "nvim-test" target
2023-01-31 19:28:26 +01:00
dundargoc
27b81af19c
refactor!: remove has("debug") (#22060)
This value can not be relied on as it doesn't work for
multi-configuration generators. I don't think this undocumented option
is used much, if at all, so I think we should remove it.
2023-01-30 19:06:32 +01:00
dundargoc
930125647f
build: enable ccache project-wide (#22045)
Currently, only the nvim target uses ccache but not libnvim or
unittests. It is generally a good idea to operate on targets rather than
globally, but this is an exception as there isn't a target where we
don't want to use ccache on.
2023-01-29 17:02:34 +01:00
dundargoc
322c83896d
build: remove unnecessary unit test code (#21940)
The files generated by test/includes/CMakeLists.txt have been unused
since commit c49e22d396. The unittests include the headers in
test/includes directly without any processing, meaning that the
CMakeLists.txt file is no longer necessary.
2023-01-24 00:03:25 +01:00
Lewis Russell
f08051c2e6
feat!: make iconv a non-optional dep 2023-01-23 16:33:45 +00:00
Arnout Engelen
cb757f2663
build: make generated source files reproducible #21586
Problem:
Build is not reproducible, because generated source files (.c/.h/) are not
deterministic, mostly because Lua pairs() is unordered by design (for security).

https://github.com/LuaJIT/LuaJIT/issues/626#issuecomment-707005671
https://www.lua.org/manual/5.1/manual.html#pdf-next
> The order in which the indices are enumerated is not specified [...]
>
>> The hardening of the VM deliberately randomizes string hashes. This in
>> turn randomizes the iteration order of tables with string keys.

Solution:
- Update the code generation scripts to be deterministic.
    - That is only a partial solution: the exported function
      (funcs_metadata.generated.h) and ui event
      (ui_events_metadata.generated.h) metadata have some mpack'ed
      tables, which are not serialized deterministically.
    - As a workaround, introduce `PRG_GEN_LUA` cmake setting, so you can
      inject a modified build of luajit (with LUAJIT_SECURITY_PRN=0)
      that preserves table order.
    - Longer-term we should change the mpack'ed data structure so it no
      longer uses tables keyed by strings.

Closes #20124

Co-Authored-By: dundargoc <gocdundar@gmail.com>
Co-Authored-By: Arnout Engelen <arnout@bzzt.net>
2023-01-23 01:26:46 -08:00
dundargoc
9220755302
build: remove clint error suppression #21782
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/clint
https://github.com/neovim/doc/blob/main/ci/clint-errors.sh
2023-01-13 15:48:10 -08:00
dundargoc
a0b2c124a3
build: include our libraries before system libraries (#21746)
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
2023-01-12 16:49:17 +01:00
dundargoc
438b4361cc
build: use modern cmake (#21589)
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.
2023-01-10 18:49:57 +01:00
dundargoc
623dad1a2c build: remove workaround for old luajit versions
Luajit version 2.1.0-beta3 was released 2017, there's no reason to use
such an old version on macOS. Also, the version check doesn't work
anymore as LUAJIT_VERSION seems to not be defined anywhere.
2023-01-08 10:58:51 +01:00
bfredl
9fdcbbb406 feat(tui): graduate the +tui feature
This was previously disabled due to build issues on windows.
Any reasonable platform can now be expected to have the necessary
interfaces to build and run the TUI subsystem.

Runtime quality issues of using the TUI (on any new platform) are not
relevant here. Just run Nvim in an external UI instead of the TUI as always.
2022-12-31 13:25:26 +01:00
bfredl
43e8ec92de fix(tui): more work in the TUI 2022-12-31 13:25:26 +01:00
Tom Churchman
a7332ba9b4
fix(tui): set cursor color param as string when required #21407
Problem:
See #20628. Terminals supporting cursor color changing usually set the
"user-defined" `Cs` terminfo capability. Most terminals expect the parameter to
the capability to be a string (in hex format like `#0099ff` or like
`rgb:00/99/ff`), others may expect a number.

Nvim currently can't handle string parameters, causing terminals to receive
a bogus command.

Unfortunately, as the `Cs` capability is "user-defined", there's no strict
format. The parameter it takes isn't really standardized. It seems most
terminals in use follow xterm; iTerm appears to be an exception.

Solution:
Use the `Cs` capability more reliable by following terminfo and
sending the color in hex format, at the cost of using unibilium string vars.
Alternatively, could revert 34d41baf8a
and hardcode the specific format required by terminals, instead of reading
terminfo.

Fixes #20628
Fixes #19607
2022-12-18 15:10:47 -08:00
bfredl
4b02291f81
Merge pull request #20157 from dundargoc/build/iwyu
build: allow IWYU to fix includes for all .c files
2022-11-15 10:55:07 +01:00
dundargoc
66360675cf build: allow IWYU to fix includes for all .c files
Allow Include What You Use to remove unnecessary includes and only
include what is necessary. This helps with reducing compilation times
and makes it easier to visualise which dependencies are actually
required.

Work on https://github.com/neovim/neovim/issues/549, but doesn't close
it since this only works fully for .c files and not headers.
2022-11-15 10:30:03 +01:00
dundargoc
2755510f78 ci(windows): treat compiler warnings as errors
Reduce the warning level from 3 to 1 and fix all warnings.
2022-11-14 20:17:04 +01:00
dundargoc
502b5ee10f build(lint): add more shell scripts to lintsh 2022-11-01 18:37:21 +01:00
dundargoc
aeb87f8b4a build: add EXCLUDE option to add_glob_target
EXCLUDE filters out all elements containing regex, meaning it works on
both files and directories.

Also rename add_glob_targets to add_glob_target since only one target is
being created.
2022-11-01 18:34:14 +01:00
dundargoc
1d625a3cf7
build: remove python linting #20851
This includes both the `lintpy` make target and for CI. We're actively
trying to reduce our python usage, so this only seems to give warnings
for unimportant things such as exceeding the line after deleting python
code.
2022-10-29 10:42:10 -07:00
dundargoc
5046b4b4ad
ci: add cirrus to isCI function to skip tests (#20526)
The environment variable CIRRUS_CI is manually passed to RunTests.cmake
as it doesn't get passed when using cmake script mode.
2022-10-17 17:16:31 +02:00
Justin M. Keyes
09dffb9db7
docs: various #12823
- increase python line-length limit from 88 => 100.
- gen_help_html: fix bug in "tag" case (tbl_count => tbl_contains)

ref #15632
fix #18215
fix #18479
fix #20527
fix #20532

Co-authored-by: Ben Weedon <ben@weedon.email>
2022-10-09 05:21:52 -07:00
dundargoc
2f80839cfe
build: only generate compilation database for the nvim target (#20449)
Some tools like clang-tidy get confused and repeat unnecessary work if
there are multiple entries with the same name.

This will only generate a compilation database for cmake version 3.20
and above. Generating a compilation database is only necessary for
development, so we don't need to maintain compatibility with the minimum
required version.

Closes https://github.com/neovim/neovim/issues/10632
2022-10-02 17:17:40 +02:00
bfredl
4396c3ef2c version bump 2022-09-30 17:26:25 +02:00
bfredl
d367ed9b23 NVIM v0.8.0
BREAKING CHANGES
- Remove 'insertmode' 'remap' and 'terse' options
- highlight: Rename attributes to match Vim (#19159)
- highlight: Error on invalid names and allow '.' and '@'
- terminal: Drop winpty, require Windows 10 #18253
- treesitter: Use @foo.bar style highlight groups
- treesitter: Do not merge queries by default (#20105)

FEATURES
- runtime: Enable filetype.lua by default (#19216)
- Add `undo!`
- Add "prerelease" to version dict
- Click support for 'statusline', 'winbar' #18650
- Add preview functionality to user commands
- allow cmdheight=0 (EXPERIMENTAL) #16251
- Stdpath('run'), /tmp/nvim.user/ #18993
- Add 'mousescroll' option (#12355)
- Allow :wincmd to accept a count (#19815)
- Multibuffer preview support for inccommand
- Man: Port to Lua (#19912)
- api: Ui options relevant for remote TUI
- api: Add `nvim_parse_cmd` And `nvim_cmd`
- api: Support handling stdin stream in remote ui
- api: Add `group_name` to `nvim_get_autocmds`
- api: Enable nvim_exec_autocmds to pass arbitrary data (#18613)
- api: Support pattern array for exec_autocmds
- api: Add `unsilent` to command APIs
- api: Add replace_keycodes to nvim_set_keymap (#19598)
- api: Add support for :horizontal modifier
- api: Add "move" to nvim_input_mouse
- api/ui: "ui_watched" option for ui-side extmarks
- build: Add_glob_target runs only on changed files #19070
- checkhealth: Check for slow shell #17829
- defaults: Session data in $XDG_STATE_HOME #15583
- defaults: Search selection by * and # in visual mode (#18538)
- defaults: Nnoremap & :&&<CR> #19365
- defaults: enable mouse by default (set mouse=nvi)  #19290
- diagnostic: Pass diagnostics as data to DiagnosticChanged autocmd (#20173)
- docs: Gen_help_html.lua
- edit: Insert an unsimplified key using CTRL-SHIFT-V
- treesitter: Full support for spelling
- filetype: Convert more patterns to filetype.lua
- filetype: Remove side effects from vim.filetype.match (#18894)
- filetype: Expand environment variables in filetype patterns (#20145)
- fs: Add vim.fs functions: parents() dirname() basename() dir() find() normalize()
- highlight: Implement CurSearch highlight
- highlight: Support scoped @spam.eggs.baked_beans groups
- input: Delay all simplifications
- l10n: Turkish translations #19441
- l10n: Improve zh_CN translations (#19483)
- lsp: Remove capabilities sanitization (#17814)
- lsp: Show feedback on empty hover response (#18308)
- lsp: Options to filter and auto-apply code actions (#18221)
- lsp: Add vim.lsp.buf.format (#18193)
- lsp: Add logging level "OFF" (#18379)
- lsp: Add LspAttach and LspDetach autocommands
- lsp: Add filter to vim.lsp.get_active_clients()
- lsp: Option to reuse_win for jump actions (#18577)
- lsp: Add a start function (#18631)
- lsp: Send didChangeConfiguration after init (#18847)
- lsp: Defaults: tagfunc, omnifunc, formatexpr (#19003, #19677)
- lsp: Allow passing custom list handler to LSP functions that return lists (#19213)
- lsp: Provide feedback if server can't compute rename result (#19546)
- lsp: Add range option to code_action; deprecate range_code_action (#19551)
- lsp: Disable exit_timeout by default (#19672)
- lsp: Add tcp support
- lua: Vim.deprecate() #18320
- lua: Vim.cmd() with kwargs acts like nvim_cmd() #18523
- lua: Allow some vim script functions to run in fast callbacks
- lua: Measure require in --startuptime
- lua: Allow vim.cmd to be indexed (#19238)
- lua: Print source locations of lua callbacks (#19597)
- lua: Add vim.iconv (#18286)
- lua: Vim.ui_attach to get ui events from lua (EXPERIMENTAL)
- man.vim: List command flags in "gO" outline #17558
- mappings: Do not replace existing mapping for simplified form
- mappings: Allow special keys and modifiers in <Cmd> mapping
- mapset: Support restoring "replace_keycodes" and "desc"
- mapset: Support restoring Lua callback (#20024)
- marks: Restore viewport on jump #15831
- nvim_create_user_command: Pass structured modifiers to commands
- pum: Pretend 'mousemoveevent' is set when showing right-click menu
- server: Set $NVIM, unset $NVIM_LISTEN_ADDRESS #11009
- server: Instance "name", store pipes in stdpath(state)
- term: Add support for libvterm >= 0.2
- terminal: Implement <c-\><c-o> for terminal mode
- terminal: Recognize underdouble and undercurl
- terminfo: Bump built-in terminfo entries (#18570)
- treesitter: Allow customizing language symbol name
- treesitter: Add ability to retreive a tree/node given a range
- treesitter: Upstream node methods from nvim-treesitter
- treesitter: Include language in invalid query error (#14053)
- treesitter: Bundle Lua parser and queries
- treesitter: Add viml parser and queries
- treesitter: Add injections
- treesitter: Add vim.treesitter.start(), enable for Lua
- treesitter: Bundle :help parser and queries
- tui: Query terminal for CSI u support (#18181)
- tui: Recognize keypad keys when using kitty keyboard protocol
- tui: Try terminfo for [re]set_cursor_color OSC #19255
- tui: Allow grid and host to disagree on ambiguous-width chars (#19686)
- tui: Recognize sidescroll events (#19992)
- tui: Support 'mousemoveevent'
- ui: Add `'winbar'`
- ui: Clear message history explicitly with msg_history_clear event
- ui: Make right-click menu work properly with ext_multigrid
- ui: Allow to set the highlight namespace per window
- ui: Use msg_grid based implementation for cmdheight=0
- ui-ext: Make 'mousemoveevent' a ui_option
- eval: Make Lua Funcref work as method and in substitute() (#20217)
- eval: Input() support any type for "cancelreturn" in a dict (#19357)

BUG FIXES
- Show autocmd output when F is in shortmess (#18251)
- Has() should preserve v:shell_error #18280
- Suppress "is a directory" messages with shortmess 'F' (#18296)
- Display global statusline correctly with ext_messages
- Correct nlua_wait error message #18867
- Right-click in clickable statusline #19252
- Remote UI may get invalid 'pumblend' value #19379
- Assertion failure when requiring missing module in autocmd
- api: Nvim_eval_statusline should validate input #18347
- api: Check error after getting win/buf handle (#19052)
- api: Check for inclusive buffer line index out of bounds correctly (#19056)
- api: Change default value of 'pattern' in nvim_exec_autocmds (#19115)
- api: Do not switch win/buf if getting option in current win/buf (#19383)
- api: Make nvim_set_hl(ns=0, ...) redraw screen properly
- api: Nvim_set_hl bail out on invalid group name (#20021)
- api: Notify dict watchers on nvim_set_var and vim.g setter
- api/command: Fargs behavior when no arguments are passed (#19862)
- autocmds: Separate command from desc (#18617)
- buffer: Disable buffer-updates before removing from window #18933
- build: Missing definitions for sizeof macros #16393
- build: Only pass -municode if MINGW #19049
- build: Strip trailing newline from variable (#19084)
- build: Don't disable byte precompilation on debug builds
- build: Fails if git is missing #19366
- charclass: Make behavior with empty str match latest Vim (#19749)
- checkhealth: Skip vim.health #18816
- ci: Remove 2000ms blocking wait in many plugin/lsp_spec.lua tests
- cmd: Make :-tabmove work with modifiers (#18447)
- cmdheight=0: Various issues part3 #19816
- cmdline: Fix passing -1 as char
- cmdline: Trigger CmdlineEnter and ModeChanged earlier (#19474)
- cmdline: Do not trigger completion at wrong time (#19920)
- cmdline: Don't send invalid cursor with incsearch and cmdheight=0
- column: Move sign sentinel after inserting/deleting lines (#20400)
- completion: Remove wrong FUNC_ATTR_NONNULL_ALL (#19627)
- diagnostic: Use nvim_exec_autocmds to trigger DiagnosticChanged (#18188)
- diagnostic: Check for negative column value (#18868)
- diagnostic: Remove buf from cache on `BufWipeout` (#20099)
- diagnostic: Populate data key in DiagnosticChanged autocmd in reset (#20207)
- docs: Correct obsolete note about 'writedelay' in dev docs
- docs: Remove internal function from docs
- edit.c: Indentkeys double indent after "!" #12894
- eval: Check for v:lua when calling callback (#19855)
- eval/f_getmatches: Return empty list for invalid win argument (#18893)
- events: Make CursorHold behave as documented
- ex_cmds: Correct flags for :const (#19387)
- exceptions: Restore `did_throw` (#20000)
- exmode: Do not throttle messages when pressing enter to print line
- extmarks: Make virt_lines always start at 0 virtcol
- filetype: Fix and improve filetype patterns
- fillchars: Change fallback after setcellwidths()
- float: Make `screen*()` functions respect floating windows
- float: Fix glitch when making float window with border a split
- float: Fix mouse drag position if float window turned to a split
- folds: Fix fold regression with :move (#18685)
- folds: Fix fold remains when :delete makes buffer empty (#19673)
- ftdetect: Source plugins in autogroup (#18237)
- gen_vimdoc.py: Handle missing luajit
- getchar: Flush screen before doing a blocking wait
- handlers: More specific error messages (#16772)
- health: Correct shada file path #18603
- health: Handle non-existent log file #18610
- highlight: Use ctermbg/fg instead of bg/fg when use_rgb=false #18982
- highlight: Add missing 'nocombine' to nvim_get_hl apis (#19586)
- highlight: Set the window namespace when redrawing statusline
- hl: Set Normal hl group sg_attr value #18820
- hl: Return cterm fg/bg even if they match Normal #18981
- inccommand: Do not try to preview an ambiguous command (#18827)
- inccommand: Avoid crash if callback changes inccommand option (#18830)
- inccommand: Clear cmdpreview state if preview is not shown (#18923)
- inccommand: Skip split window if not enough room #18937
- inccommand: Never preview if parsing command failed (#18944)
- inccommand: Parse the command to check if it is previewable
- inccommand: Deal with unsynced undo (#20041)
- input: Allow Ctrl-C to interrupt a recursive mapping even if mapped (#18885)
- input: Fix macro recording with ALT and special key (#18917)
- input: Use correct grid when restoring cursor for <expr> mapping (#19047)
- input: Do no reinterpret mouse keys with ALT modifiers
- input: Use click number of last click for mouse drag (#20300)
- inspect: Escape identifiers that are lua keywords (#19898)
- keywordprg: Default to :help if set to empty string (#19983)
- l10n: Improve zh_CN and zh_TW translations (#19969)
- log: Back even again
- logging: Skip recursion, fix crash #18764
- logging: Make logmsg() thread-safe again
- logging: Try harder to resolve Nvim "name" #19016
- lsp: Unify progress message handling (#18040)
- lsp: Fix unnecessary buffers being added on empty diagnostics (#18275)
- lsp: Fix infinite loop in resolved_capabilities deprecation message (#18333)
- lsp: Add missing bufnr argument (#18382)
- lsp: Fix rename capability checks and multi client support (#18441)
- lsp: Detach spawned LSP server processes (#18477)
- lsp: Perform client side filtering of code actions (#18392)
- lsp: Only send diagnostics from current buffer in code_action() (#18639)
- lsp: Respect global syntax setting in open float preview (#15225)
- lsp: Include cancellable in progress message table (#18809)
- lsp: Adjust offset encoding in lsp.buf.rename() (#18829)
- lsp: Set buflisted before switching to buffer (#18854)
- lsp: Fix multi client handling in code action (#18869)
- lsp: Small bugs in snippet-parser #18998
- lsp: Pcall nvim_del_augroup_by_name (#19302)
- lsp: Abort pending changes after flush when debouncing (#19314)
- lsp: Don't attach a client in lsp.start() if there is none (#19328)
- lsp: Account for initializing servers in vim.lsp.start (#19329)
- lsp: Move augroup define to if statement (#19406)
- lsp: Set workspace.configuration capability (#19548)
- lsp: Send didOpen if name changes on write (#19583)
- lsp: Prevent unexpected position jumps (#19370)
- lsp: Avoid  ^M character in hover window on Windows (#19640)
- lsp: Set end_col in formatexpr (#19676)
- lsp: Handle multiple clients with incremental sync (#19658)
- lsp: Fix some type annotations in lsp.rpc (#19714)
- lsp: Avoid pipe leaks if lsp cmd isn't executable (#19717)
- lsp: Handle nil client in onexit callback (#19722)
- lsp: Fix nil value error in get_group (#19735)
- lsp: Clean the diagnostic cache when buffer delete (#19449)
- lsp: When buffer detach remove buffer from client attached buffers (#20081)
- lsp: Schedule removal of client object (#20148)
- lsp: Support `false` result in handlers (#20252)
- lsp: Out of bounds error in lsp.util.apply_text_edits (#20137)
- lsp: Use correct function name in deprecated message (#20308)
- lsp: Create missing directory before creating file (#19835)
- lua: Don't mutate opts parameter of vim.keymap.del (#18227)
- lua: Stop pending highlight.on_yank timer, if any (#18824)
- lua: Highlight.on_yank can close timer in twice #18976
- lua: Clear got_int when calling vim.on_key() callback (#18979)
- lua: Don't leak memory on error
- lua: Double entries in :lua completion #19410
- lua: Make it possible to cancel vim.wait() with Ctrl-C (#19217)
- lua: Make ui_attach()/ui_detach() take effect immediately (#20037)
- lua: Make vim.str_utfindex and vim.str_byteindex handle NUL bytes
- lua: Free vim.ui_attach callback before lua close (#20205)
- lua: Fix architecture-dependent behavior in usercmd "reg" (#20384)
- mac: Use same $LANG fallback mechanism as Vim
- mac: Add CoreServices to flake.nix #18358
- man.vim: Q in "$MANPAGER mode" does not quit #18443
- maparg: Remove double allocation (#20033)
- mappings: Fix double-free when unmapping simplifiable Lua mapping
- mapset: Remove existing abbreviation of same lhs (#20320)
- mark: Set mark fnum from buffer (#19195)
- mark: Mark without a view restores at topline #19224
- mark: Fix unexpected cursor movements (#19253)
- mark: Give correct error message when mark is in another buffer (#19454)
- menu: Make :menu still print header when there are no menus
- messages: Add color when showing nvim_echo in :messages history
- messages: Do not crash on cmdheight=0 and g< redisplay
- messages: Validate msg_grid before silent! message with cmdheight=0
- mksession: Don't store floats in session #18635
- mouse: Click on global statusline with splits (#19390)
- mouse: Fix using uninitialized memory with K_MOUSEMOVE (#19480)
- mpack: Make sure a `bool` always is a `bool`
- normal: Fix segfault with bracket command jumping to a mark
- options: Properly free string options (#19510)
- options: Mark `winhighlight` as list style  (#19477)
- packaging: Remove excess forward slash in Wix Patch (#18121)
- paste: Ignore mappings in Cmdline mode (#18114)
- path: Path_is_url returns false for "foo:/" #19797
- powershell: Filter ":!" commands with args #19268
- pum: Make right drag in anchor grid to select work in multigrid UI (#19382)
- query: Fix unnatural order for inherits in treesitter queries (#20298)
- redraw: Make sure :redraw! redraws command line
- redraw: Handle switching to a tabpage with larger p_ch value
- redraw: Avoid unnecessary redraws and glitches with floats+messages
- redraw: Make redrawdebug=nodelta handle all the cases
- rpc: Break nvim_error_event feedback loop between two nvim instances
- runtime/genvimvim: Omit s[ubstitute] from vimCommand #18480
- screen: Restart win_update() if a decor provider changes signcols (#18768)
- screen: Check for col instead of vcol when drawing fold (#19572)
- session: Respect sessionoptions=terminal #19497
- shared: Avoid indexing unindexable values in vim.tbl_get() (#18337)
- signs: Priority of extmark signs (#19718)
- source: Make changing 'shellslash' change expand() result
- source: Fix expand('<sfile>') no longer works for Lua
- spell: Make setting 'encoding' clear word list
- spell: Correct spell move behavior without "noplainbuffer" (#20386)
- startup: Nvim with --clean should not load user rplugins
- substitute: Subtract number of backslashes later
- tabpage: Check if ROWS_AVAIL changed for resize (#19620)
- terminal: Invalid pointer comparison #18453
- terminal: Do not trim whitespace that is actually in the terminal (#16423)
- terminal: Scrollback delete lines immediately #18832
- terminal: Coverity USE_AFTER_FREE #18978
- terminal: Crash if TermClose deletes own buffer #19222
- terminal: Avoid reading over the end of cell.chars (#19580)
- terminal: Skip aucmd_win when checking terminal size (#19668)
- terminal: Adopt altscreen test for libvterm 0.2 changes
- terminfo: Disable smglr for vtpcon and conemu (#18855)
- termopen: Avoid ambiguity in URI when CWD is root dir (#16988)
- tests: Fix some screen.lua warnings
- tests: Fix some issues with ui/inccommand_spec.lua causing slowness
- tests: Unreliable parser_spec #18911
- tests: Check for EOF on exit of nvim properly
- tests: Missing clear() #18927
- tests: Remove misleading $TEST_PATH segment #19050
- tests: Remove irrelevant usage of display-=msgsep
- tests: Use pending_c_parser when needed
- tests: Indicate in test logs when nvim exit times out
- tmpdir: Invalid tempname() if username has slashes #19323
- treesitter: Create new parser if language is not the same as cached parser (#18149)
- treesitter: Bump match limit up
- treesitter: Offset directive associates range with capture (#18276)
- treesitter: Correct region for string parser (#18794)
- treesitter: New iter if folded
- treesitter: Don't error when node argument of predicate is nil (#19355)
- treesitter: Free memory on removing parser (#19933)
- treesitter: More efficient node:root()
- treesitter: Make it get_captures_at_position
- treesitter: Do not link @error by default
- treesitter: Don't support legacy syntax in start()
- treesitter: Use the right loading order for base queries (#20117)
- treesitter: Prevent endless loop on self-inheritence
- treesitter: Return full metadata for get_captures_at_position (#20203)
- ts: Do not clobber spelloptions (#20095)
- tui: Update modifyOtherKeys reporting (#18158)
- tui: Disable extended keys before exiting alternate screen (#18318)
- tui: Piping nodejs to nvim breaks input handling #18932
- tui: Resize at startup #17795
- tui: Add fixups for hterm family #19078
- tui: Handle padding requirements for visual bell (#20238)
- ui: Require window-local value to show winbar on floating windows (#18773)
- ui: Do not call showmode() when setting window height (#18969)
- ui: Set redraw_cmdline when setting window height (#19630)
- ui: Don't allow decor provider with ns_id==0
- ui: Ui compositor does not correctly free event callbacks
- ui: Allow redrawing statusline when msgsep is used (#20337)
- ui: Redraw end of buffer if last line is modified (#20354)
- unittests: Coredump when running unit tests #18663
- usercmd: Also check for whitespace after escaped character (#19942)
- version.c: Mark N/A vim patches #18587
- vim.ui.input: Accept nil or empty "opts"  #19109
- window: Close floats first when closing buffer in other tab (#20284)
- window: Fix equalization with cmdheight=0 (#20369)
- windows: Stdpath("state") => "nvim-data" #18546
- windows: Exepath, stdpath return wrong slashes #19111
- winhl: Do not crash when unsetting winhl in just opened window
- Make :undo! notify buffer update callbacks (#20344)
- eval: Make Vim functions return inner window width and height (#19743)

BUILD SYSTEM
- Bump Doxyfile to minimum required version 1.9.0 #18118
- Bump msgpack to 4.0.0
- Enable EXITFREE on Debug builds (#17783)
- Add formatting targets for c and lua files (#19488)
- clang-format: Align with project style #18192
- clint: Remove all python2-isms with pyupgrade
- clint: Remove "function size is too large" warning
- clint: Remove rules for includes, whitespace, tabs #18611
- cmake: Simplify and speed up the uninstall target
- cmake: Simplify def_cmd_target function
- cmake: Use glob_wrapper instead of file(GLOB in main CMakeLists
- cmake: Fix static `libintl` test on macOS
- deps: Bump LuaJIT, Luv and libuv
- deps: Support universal builds on macOS
- deps: Bump tree-sitter to v0.20.7 (#20067)
- deps: Bump tree-sitter parsers
- deps: Bump required libvterm to v0.3 (#20222)
- deps: Require libtermkey version 0.22
- deps: update neovim-qt, win32tools.zip

PERFORMANCE
- Only redraw for CurSearch when it is currently in use
- highlight: Allocate permanent names in an arena for fun and cache locality
- highlight: Use binary search to lookup RGB color names
- map: Visit only one hash bucket instead of all, like an actual hash table
- memory: Get rid of extraneous heap allocations
- memory: implement arena memory allocation with a shared freelist
- memory: Use an arena for RPC decoding and some API return values
- messages: Don't call ui_flush() per message line in various places
- treesitter: Use a reuse list for query cursors
- ui: Reduce allocations when encoding and decoding "redraw" events
- ui: Avoid ui_flush() work in headless mode

REFACTOR
- checkhealth: Rename to vim.health, move logic to Lua #18720
- Add pure attribute to pure functions
- Replace char_u variables and functions with char
- Enable -Wconversion warning for all Nvim source files
- Add warnings for deprecated functions (#18662)
- Change type of linenr_T from long to int32_t
- Use nvim_get/set_option_value for vim.{b,w}o
- Remove functions marked for deprecation in 0.8 (#19299)
- Rename function prefix mb to the more accurate utf_cp (#19590)
- Remove some unused includes
- Change remaining sourcing_name/sourcing_lnum to exestack
- Change FALSE/TRUE to false/true
- api: Use a hashy hash for looking up api method and event names
- api: Use a unpacker based on libmpack instead of msgpack-c
- api: restructure api/vim.c and api/private/helpers.c code in separate files
- api: Remove redundant fields of CmdParseInfo
- aucmd: Call define_autocmd() directly for default autocmds
- ci: Cleanup release.yml #19132
- cmd: Format do_one_cmd()
- cmd: Hoist out some code into functions
- cmd: Unify execute_cmd with do_one_cmd
- decor: Use decor levels properly
- drawline.c: Factor out utf8 multibyte check
- eval: Use Hashy McHashFace instead of gperf
- eval.c: Resolve all clint issues (#19774)
- eval/funcs.c: Resolve all clint errors
- events: Remove unnecessary fudging of updating_screen
- ex_cd: Add an early return to fix clint warning
- ex_docmd.c: Resolve most clint errors (#19775)
- filetype: Allow vim.filetype.match to accept buf and filename (#19114)
- highlight: Make hlattrs2dict always use pre-allocated dict
- log: Simplify log_path_init #18898
- log: Use msg_schedule_semsg #18950
- lsp: Remove redundant client cleanup (#18744)
- lsp: Make the use of local aliases more consistent
- lsp: Use autocmd api (#19407)
- lsp: Factor out read_loop function
- lsp: Encapsulate rpc uv handle
- lsp: Extract rpc client from rpc.start
- lua: Replace hard-coded gsub with vim.pesc() (#18407)
- lua: Reformat with stylua 0.14.0 (#19264)
- lua: Git-blame-ignore stylua update PR (#19273)
- lua: Replace vim.cmd use with API calls (#19283)
- map: Simplify free_all_mem handling
- map: Statically initialize maphash array
- map: Simplify add_map params
- normal: Convert function comments to doxygen format
- object: Get rid of redundant FIXED_TEMP_ARRAY
- ops: Doxygen docstrings #17743
- option: DRY get/set option value #19038
- plines: Use a struct for chartabsize state
- provider: Use list comprehension #19027
- regexp_nfa.c: Match where Vim calls fopen() (#18778)
- runtime: Convert dist#ft functions to lua (#18247)
- runtime: Convert more dist#ft functions to lua (#18430)
- runtime: Convert the remaining dist#ft functions to lua (#18623)
- runtime: Port remaining patterns from filetype.vim to filetype.lua (#18814)
- runtime: Refactor filetype.lua (#18813)
- runtime: Port scripts.vim to lua (#18710)
- setcellwidths: Use TV_LIST_ITEM_NEXT properly
- signs: Handle non-sign attrs separately (#19784)
- tests: Introduce testprg()
- treesitter: Get_{nodes,captures}_at_{position,cursor}
- typval: Change FC_CFUNC abstraction into FC_LUAREF
- ui: Simplify stdin handling
- uncrustify: Format all c code under /src/nvim/
- vim.opt: Remove del arg
- vim.opt: Unify vim.bo/wo building
- vim.opt: Optimize append/prepend/remove
- Format runtime with stylua
2022-09-30 17:15:13 +02:00
James McCoy
c7cc6591c1
Merge pull request #20381 from cryptomilk/asn-vterm
build(deps): require libvterm version 0.3
2022-09-29 07:00:44 -04:00
Andreas Schneider
6917a2e569 build(deps): require libvterm version 0.3 2022-09-28 10:13:48 +02:00
Andreas Schneider
6427dc8ab6 build(deps): require libtermkey version 0.22
Reduces #ifdef code.
2022-09-28 09:41:18 +02:00
Justin M. Keyes
ede66a0b85
fix: cleanup contrib/ #20304
- YouCompleteMe is unnecessary since Nvim LSP works well.
- vim-addon-local-vimrc is not needed since we added `.editorconfig`.
- Inline flake8 arguments. Eventually we will remove all python code,
  don't need a top-level `.flake8` file meanwhile.
2022-09-23 09:02:16 -07:00
dundargoc
6d557e324f
vim-patch:8.1.0941: macros for MS-Windows are inconsistent (#20215)
Problem:    Macros for MS-Windows are inconsistent, using "32", "3264 and
            others.
Solution:   Use MSWIN for all MS-Windows builds.  Use FEAT_GUI_MSWIN for the
            GUI build. (Hirohito Higashi, closes vim/vim#3932)
4f97475d32
2022-09-18 09:17:15 +08:00
Dundar Göc
b9aafb85e6 build: replace deprecated CMAKE_COMPILER_IS_GNUCC variable
Instead use the recommended form `CMAKE_C_COMPILER_ID MATCHES "GNU"`
2022-09-08 14:15:13 +02:00
dundargoc
42aeb5c5b1 build: remove unnecessary policy related code
Having cmake version 3.10 as the required minimum version ensures these
are set to new by default.
2022-09-08 14:15:13 +02:00
dundargoc
6e3a69b4cf
build: consistently set build type regardless of generator or platform #19760
Change the default build type to always be Debug, and allow only four
predefined build types: Debug, Release, RelWithDebInfo and MinRelSize.
Furthermore, flags meant for single-configuration generator (make,
ninja) will not be used for multi-configuration generators (visual
studio, Xcode), and flags meant for multi-configuration generators will
not be used for single-configuration generators.

This will allow Debug builds to be built with MSVC which requires that
all dependencies are also built with the Debug build type to avoid
runtime library mismatch.

The correct way to specify build type (for example Release) for
single-configuration generators (Make and Ninja) is to run

cmake -B build -D CMAKE_BUILD_TYPE=Release
cmake --build build

while for multi-configuration generators (Visual Studio, Xcode and Ninja
Multi-Config) is to run

cmake -B build
cmake --build build --config Release

Passing CMAKE_BUILD_TYPE for multi-config generators will now not only
not be used, but also generate a warning for the user.

Co-authored-by: dundargoc <gocundar@gmail.com>
2022-09-06 07:52:39 -07:00
dundargoc
8ce7e7409f
build: add formatting targets for c and lua files (#19488)
The targets will only format files that have been changed in current
branch compared to the master branch. This includes unstaged, staged and
committed files.

Add following make and cmake targets:
formatc   - format changed c files
formatlua - format changed lua files
format    - run formatc and formatlua

Remove scripts/uncrustify.sh as this deprecates it.
2022-08-02 12:32:57 +02:00
Christian Clason
9e15bdde3b
build(macos): use consistent MACOSX_DEPLOYMENT_TARGET (#19430)
Use the same logic for both deps (including LuaJIT, for which setting
this variable is mandatory) and Nvim: either the eponymous environment
variable if set, or the current software version if not.

Removes annoying warnings when building locally on macOS.
2022-07-19 16:10:59 +02:00
dundargoc
2b04aaad94
build: drop -Wsuggest #19177
Disable -Wsuggest compile flags by default.

Although the flags are useful to see what the compiler thinks we can
improve on, it adds a lot of noise to the build output. That makes it
harder to spot actual issues that may be flagged.

Closes https://github.com/neovim/neovim/issues/19160
2022-07-02 14:47:22 -07:00
dundargoc
9b4d0137b8
build: move lint target to cmake #19169
This will ensure less verbose output and faster linting.
2022-07-01 09:15:04 -07:00
dundargoc
37af46bb4c
feat(build): add_glob_target runs only on changed files #19070
The general idea is that add_glob_targets creates a "touch file", a
dummy file that acts as a dependency in order to check which files are
outdated since the last time the target was run.

Remove RunUncrustify.cmake as it's no longer necessary. It was initially
introduced to silence its noisy output. The per-file targets will
suppress the noisy output from uncrustify, except for the very first
run.

Also remove DefCmdTarget.cmake since add_glob_target already
incorporates its functionality.
2022-06-30 05:10:05 -07:00
Justin M. Keyes
f05a2891d3 build: rename build-related dirs
Problem:
Dirs "config", "packaging", and "third-party" are all closely related
but this is not obvious from the layout. This adds friction for new
contributors.

Solution:
- rename config/ to cmake.config/
- rename test/config/ to test/cmakeconfig/ because it is used in Lua
  tests: require('test.cmakeconfig.paths').
- rename packaging/ to cmake.packaging/
- rename third-party/ to cmake.deps/ (parallel with .deps/)
2022-06-28 04:02:29 -07:00
Justin M. Keyes
eab8b998e9
build: move man/ to src/man/ #19119
Problem:
man/ contains source files for manpage generation, it doesn't need to
live at the project root.

Solution:
Move it to src/man/.
2022-06-27 01:02:02 -07:00
bfredl
cb58b673e5 fix(build): don't disable byte precompilation on debug builds
This special casing is redundant since long, as you can disable
the binary cache regardless of build type with the --luamod-dev flag
2022-06-25 19:24:48 +02:00
Justin M. Keyes
f977f9445f refactor(tests): introduce testprg()
Also:
- Add a describe('shell :!') section to system_spec.
- Make the test for #16271 work on systems without powershell.
2022-06-25 08:27:17 -07:00
Dundar Goc
636a309981 build(cmake): simplify def_cmd_target function
Instead of appending to a command output, append to an existing target
instead. The primary benefit is intermediary ...-cmd targets aren't
needed, we can instead append commands to the relevant target directly.
2022-06-19 18:34:28 +02:00
Dundar Goc
cd1b2998d3 build(cmake): simplify and speed up the uninstall target
More specifically, replace exec_program with file(REMOVE ...) so that
the uninstall target is run during the build stage instead of the
configure stage, significantly speeding up the target.

The code snippet that was removed is taken from the cmake FAQ
https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake.
However, this uses undocumented features such as IMMEDIATE when calling
configure_file, which is an artifact from cmake 2.x (it's so old it's
difficult to find information on it). Similarly, this particular code
snippet has been around for a long time and originated from the cmake
mailing lists. Based on this I believe the in-file was a workaround for
the limitations of cmake back then and that it's not required anymore.
2022-06-19 18:34:28 +02:00
Dundar Goc
668591ae04 build(cmake): remove unnecessary globbing with file
There's no need to use globbing since there's only one file.
2022-06-19 18:34:28 +02:00
Dundar Goc
8a6f728315 build(cmake): remove unnecessary *-prereqs targets
Running the tests on their own works just fine.
2022-06-19 18:34:28 +02:00
Justin M. Keyes
605631ac29
build(lint): set some linters as non-fatal #19018
luacheck and clint are the most important, and they are bundled.
The others are nice-to-have, and not always available (and not bundled),
so make them optional. This allows the "lint" target to function as
a convenient and low-hassle handle for contributors.

We still get the full power of lint in CI.

TODO: bundle uncrustify (and then set it as required for "lint")?
2022-06-18 11:10:10 -07:00
dundargoc
3c7b91da10
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-12 15:11:14 -07:00
Justin M. Keyes
f90174c98c
build(lint): fix luacheck not found #18940
Problem:
Since 6d57bb89c1 #18543, luacheck is not found on some systems when
running the "lintlua" target.

Solution:
- Move the find_program() to the top-level CMakeLists.txt
- Define a def_cmd_target() function with fewer assumptions than the old
  lint() function.
- Move "lintuncrustify" to src/nvim/CMakeLists.txt so it can reuse the
  $LINT_NVIM_SOURCES already defined there.
- Make the lint targets _fatal_ by default. There is little reason for
  the "lint" umbrella target defined in Makefile to exist if it's going
  to ignore the absence of the actual linters.
- For now, keep the uncrustify call in a separate cmake script so that
  it can be silenced (too noisy).
2022-06-12 15:08:01 -07:00
dundargoc
6d57bb89c1
build: add a cmake target for all used linters #18543
* build: move the logic for linters to cmake
Cmake is our source of truth. We should have as much of our build
process there as possible so everyone can make use of it.

* build: remove redundant check for ninja generator
The minimum cmake version as of writing this is 3.10, which has ninja
support.
2022-06-09 08:09:24 -07:00
Gregory Anders
802a23926d
build: require exact Lua version when using PREFER_LUA (#16633) 2022-05-25 08:11:53 -06:00
Dundar Goc
a4c0c07043 revert: "ci: remove mingw job #18580"
This partially reverts commit f8af81445b.

The mingw parts of cmake was removed to see if it was still used
(ref: https://github.com/neovim/neovim/pull/18580). It turns out it is,
so this will fix that.

Closes: https://github.com/neovim/neovim/issues/18597
2022-05-17 17:07:45 +02:00
dundargoc
f8af81445b
ci: remove mingw job #18580
Unnecessary CI builds increase the change of spurious failures, which are costly
noise. Of course, we should fix all legitimate bugs, but we also cannot
micro-manage every platform, so there needs to be a clear motivation for the CI
builds that we maintain.

Reasons against maintaining a mingw CI job:
1. The windows mingw build is slow.
2. Failures:
    - https://github.com/neovim/neovim/issues/18494
    - https://github.com/neovim/neovim/issues/18495
3. The mingw artifact is 10x bigger than the windows MSVC artifact:
   https://github.com/neovim/neovim/issues/10560
4. Our releases publish the MSVC (not mingw) artifact for Windows users:
   https://github.com/neovim/neovim/releases
5. Non-MSVCRT has limitations documented by libuv: http://docs.libuv.org/en/v1.x/process.html
   > On Windows file descriptors greater than 2 are available to the child process only if the child processes uses the MSVCRT runtime.

Closes https://github.com/neovim/neovim/issues/18551
2022-05-15 15:59:58 -07:00
bfredl
36613b888b refactor(eval): use Hashy McHashFace instead of gperf
this removes gperf as a build dependency
2022-05-12 20:01:04 +02:00
zeertzjq
21abb24bd0 ci: add a check with -funsigned-char 2022-05-06 08:49:26 +08:00
erw7
5f3018fa1a
refactor(terminal)!: drop winpty, require Windows 10 #18253
Problem:
winpty is only needed for Windows 8.1. Removing it reduces our build and code
complexity.

Solution:
- Remove winpty.
- Require Windows 10.

closes #18252
2022-04-26 21:17:06 -07:00
bfredl
10693a9e8a fix(ci): workaround bug in msgpackparse() on windows caused by api level bump 2022-04-25 16:30:20 +02:00
bfredl
a8d5a9e819 version bump 2022-04-15 13:43:50 +02:00
bfredl
333ba6569d NVIM 0.7
BREAKING CHANGES

* Support for Python 2 is dropped. For Python 3, the minimum supported version is 3.6. Legacy `:pythonx` commands are still available, and always uses the python 3 provider.

* api: Existing usages of `nvim_buf_set_text` that use negative line numbers will be off-by-one.
* highlight: signature of `vim.highlight.range` was changed.

* input: distinguish between some input keys which previously were synonyms. This will break some exiting mappings.

- `<cr>`, `<tab>` and `<esc>` are no longer considered equivalent to `<c-m>`, `<c-i>` and `<c-[`> respectively. In case the terminal or GUI supports distinguishing these keys, these can now be mapped separately. But even if the terminal only can send one code you might still need to change what variant is used in the config.

FEATURES

Core APIs:

* api: add support for lua function & description in keymap
* api: add api and lua autocmds
* api: nvim_clear_autocmd
* api: pass args table to autocommand callbacks
* api: remove Lua autocommand callbacks when they return true
* api: implement nvim_{add,del}_user_command
* api: implement nvim_buf_get_text
* api: add nvim_get_option_value

* highlight: ns=0 to set :highlight namespace
* highlight: support for blend in nvim_set_hl
* api: add strikethrough, nocombine to set_hl
* api: relax statusline fillchar width check

Lua:

* lua: add vim.keymap
* lua: add vim.spell
* lua: add proper support of luv threads
* lua: make :lua =expr print result of expr
* lua: handle lazy submodules in `:lua vim.` wildmenu completion
* lua: add notify_once()
* lua: add support for multiple optional types in vim.validate
* lua: show proper verbose output for lua configuration
* lua: more conversions between LuaRef and Vim Funcref
* lua: support converting nested Funcref back to LuaRef
* call __tostring on lua errors if possible before reporting to user

* filetype.lua
* filetype.lua: add support for files under .git
* filetype.lua: add support for patch files
* filetype.lua: add support for tmux.conf files
* filetype.lua: add support for txt files
* filetype.lua: Add typescript extension to filetype detection
* filetype.lua: fix .cc file not detected
* filetype.lua: fix .env file not detected
* filetype: convert patterns for mail buffers
* filetype: support scripts.vim with filetype.lua

UI and decorations:

* decorations: support signs
* extmarks: add strict option
* api: expose extmark more details
* api: expose extmark right_gravity and end_right_gravity
* use nvim_buf_set_extmark for vim.highlight
* statusline: support multibyte fillchar
* add support for global statusline

Treesitter:

* ui: allow conceal to be defined in decorations and tree-sitter queries
* tree-sitter: allow Atom-style capture fallbacks
* treesitter: add more default groups to highlight map
* treesitter: multiline match predicates
* treesitter: set allocator when possible
* ts: add support for multiline nodes in get_node_text
* ts: expose minimum language version to lua
* runtime: add query filetype

LSP and diagnostic:

* diagnostic: add "code" to the diagnostic structure
* diagnostic: allow retrieving current diagnostic config
* lsp,diagnostic: open folds in jump-related functions
* lsp: add buf_detach_client
* lsp: add handler for workspace/workspaceFolders
* lsp: dynamically generate list title in response_to_list
* lsp: enable default debounce of 150 ms
* lsp: skip or reduce debounce after idle
* lsp: use `vim.ui.select` for selecting lsp client

Initial work to support remote TUI (and ui client library):

* ui_client: connect to remote ui
* ui_client: implement event handlers
* ui_client: handle resize events
* ui_client: implement async paste handling
* ui_client: pass user input to remote server

* --headless: add on_print callback to stdioopen
* add autocommand event when search wraps around
* add vim.tbl_get
* autocmd: add Recording autocmds
* autocmd: populate v:event in RecordingLeave
* completion: support selecting item via API from Lua mapping
* eval/method: partially port v8.1.1993
* eval/method: partially port v8.1.1996
* eval/method: partially port v8.1.2004
* eval: partially port v8.2.0878
* eval: port emsg from v8.2.3284
* events: add DirChangedPre
* events: support SIGWINCH for Signal event
* hardcopy: check gui colours for highlights first
* highlight: support color names for cterm
* ignore nore on <Plug> maps
* input: delay some conversions to vgetc()
* input: enable <tab>/<c-i>, <cr>/<c-m>, <esc>/<c-[> pairs unconditionally
* keymap: add F38-F63 keys
* keymap: return nil from an expr keymap
* mappings: considering map description when filtering
* provider: remove support for python2 and python3.[3-5]
* remote: add basic --remote support
* runtime: import cleanadd.vim from Vim
* runtime: include Lua in C++ ftplugin
* runtime: new checkhealth filetype
* term: use vterm_output_set_callback()
* test: use nvim_exec in helpers.source()
* trigger ModeChanged for terminal modes
* tui: add error logging
* tui: add support for `CSI 4 : [2,4,5] m`
* tui: enable CSI u keys
* vim-patch.sh: support additional args for -s

Performance Improvements

* lsp: request only changed portions of the buffer in changetracking
* only redraw concealed line if cursor has moved horizontally
* pre-compile embedded Lua source into bytecode
* screen: reduce cursorline redrawing when jumping around
* treesitter: cache query parsing
* api: elide luaref copy when setting 'callback' in nvim_set_keymap

BUG FIXES

* --headless: do not block on press-enter prompts when no UI
* <Nop> not shown in :map commands
* add forkpty for SunOS variants
* add STRNLEN compatability macro
* anonymous sid not working
* api, lua: return NIL on failure to find converted function
* api/nvim_win_call: share common win_execute logic
* api: allow empty list for cterm in nvim_set_hl
* api: allow nvim_buf_set_extmark to accept end_row key
* api: convert blob to NUL-terminated API string
* api: correctly handle negative line numbers for nvim_buf_set_text
* api: correctly pass f-args for nvim_create_user_command
* api: delete all autocmds with the same ID
* api: force redefinition of user commands by default
* api: highlight attribute for underline
* api: improve autocmd error handling
* api: include event in get_autocmds
* api: make nil value in nvim_set_option_value clear local value
* api: nvim__set_hl_ns causes extra redraws
* api: nvim_win_set_cursor() redraw for cursorline and statusline
* api: re-route nvim_get_runtime_file errors
* api: use changedir_func() in nvim_set_current_dir()
* api: validate command names in nvim_add_user_command
* api: validate user_command name
* append test for checking zero width node range
* aucmd_win: always make aucmd_win the last window
* aucmd_win: ensure aucmd_win stays floating
* autocmd: clean up autocmds only when needed
* autocmd: restore autocmd showing behavior
* autoload variables not loaded with vim.g & nvim_get_var
* bounds check for underdot
* build: check for empty value of LUAC_PRG
* build: check that LuaJIT has required modules for compilation
* build: install luajit modules on windows
* channel: fix channel consistency
* check for interrupt in nvim_echo, write_msg and nlua_print
* checkhealth: make provider checkhealth output more consistent
* ci/backport: check for event_name == "pull_request_target"
* ci: provide necessary permissions for calling workflow
* clang/'Dead store': do not assign endcol
* close floating windows when calling win_close()
* completion: prevent K_LUA from closing pum
* completion: update submode message when selecting from API
* correct vertical dragging room calculation with global statusline
* coverity/175977: big parameter passed by value
* coverity/188749: nullify pointer to fix use-after-free
* coverity/340720: error if nvim_eval_statusline given invalid winid
* coverity: dead code and operands don't affect result
* decorations: do not put empty virt_text
* define NAME_MAX from _XOPEN_NAME_MAX
* diagnostic: allow setting arbitrary config values
* diagnostic: assert that diagnostics have line number and column
* diagnostic: clamp diagnostics on negative line numbers
* diagnostic: escape special chars in file names
* diagnostic: improve validation for list arguments
* diagnostic: make `open_float` respect global diagnostic options
* diagnostic: only set default handler config if unset
* diagnostic: resolve nil opts tables
* diagnostic: respect "if_many" source option for virtual text
* diagnostic: set effective buffer number for DiagnosticChanged autocmd
* diagnostic: set effective buffer number in autocmd (again)
* diagnostic: use botright copen for qflist
* diff: make algorithm work for vim.diff
* do not cast offset to char_u
* do not pass aucmd to the callback
* do not save K_EVENT as lastc in Insert mode
* docs: add bufnr and user_data to diagnostic-structure
* docs: spelling in new underlines docs
* don't include pty.h on SunOS
* don't use cfsetspeed, use i and o variants
* enable filetype detection and syntax highlighting with --clean
* eval/method: add missing method support for existing built-ins
* eval: v:lua support for `-` in module names
* event-loop: call vpeekc() directly first to check for character
* event-loop: check if executed register has ended
* event-loop: duplicate display updating logic in vgetorpeek()
* events: make v:event readonly in more events
* ex_normal: spam \n in Ex mode only if in Cmdline mode
* extmarks: fix signs
* extmarks: splice extmarks on accepting spell
* filetype.lua: always return a string in getline helper function
* filetype: expand tildes in filetype patterns
* filetype: fix foam pattern detection
* filetype: match negative priority patterns after extensions
* filetype: match on <afile> rather than <abuf>
* filetype: normalize slashes in file paths
* filetype: set default ft_ignore_pat in filetype.lua
* float: do not switch window before deleting last listed buffer
* float: don't always switch window when deleting last listed buffer
* float: handle buffer deletion with floating windows
* float: make laststatus=1 behave consistently with floating windows
* healthcheck: handle empty reports
* health: do not run external processes in a shell
* highlight: accept NONE as a color name
* highlight: allow globals to be cleared
* highlight: always update window highlight if highlight changed
* inccommand: do not change reg_prev_sub when previewing
* input: do not translate scroll keys into multiclicks
* input: fix clearing of reg_executing
* input: never escape CSI bytes
* input: put modifiers back into typeahead buffer when needed
* input: remove reinterpreted ALT/META chords from recorded macro
* keymap: don't coerce false to ''
* keywordprg: retain terminal buffer after K
* line continuation: set growsize to correct value
* lsp and diagnostic highlight priority
* lsp: always split text edits on \r, \r\n, and \n
* lsp: always use target bufnr in location handler
* lsp: avoid attaching to unloaded buffers
* lsp: avoid nil workspace/symbol query
* lsp: call config on_exit handler before context is cleared
* lsp: correct prefix when filterText is present
* lsp: correctly align start and end range to codepoints during incremental sync
* lsp: create lsp requests with position offsets considering client encoding
* lsp: ensure pending changes are flushed on skipped debounce
* lsp: explicitly pass bufnr in didSave handler
* lsp: fetch offset_encoding from client in references
* lsp: fix `nil`-index behavior for UTF-8 in `_str_*index_enc` methods
* lsp: fix applying multiple out-of-range TextEdits
* lsp: fix lookup of boolean values in workspace/configuration
* lsp: forward offset_encoding in rename handler
* lsp: forward offset_encoding to apply_text_edits
* lsp: handle insertion of previous line
* lsp: handle negative activeSignature in signatureHelp
* lsp: only send valid params in executeCommand
* lsp: pass offset_encoding in formatexpr()
* lsp: progress handlers should return vim.NIL on error
* lsp: resolve bufnr for get_lines
* lsp: resolve nil bufnr
* lsp: respect all of 'fixeol', 'eol', and 'binary' applying edits
* lsp: set tabSize from 'shiftwidth', not 'softtabstop'
* lsp: start incremental sync range at previous newline character
* lsp: strictly enforce passing offset encoding
* lsp: suppress ContentModified errors from UI
* lsp: use "text" filetype for plaintext
* lsp: use botright copen for all handlers
* lua: don't use nlua_error when exiting early
* lua: print multiple return values with =expr
* lua: restore priority of the preloader
* lua: stricter type check when calling API function
* make mode() return correct value in ex mode
* man.vim: fix search function on some systems
* man.vim: support calling :Man without a section again
* msgpack#strptime: use calendar.timegm to get seconds since epoch
* ops: str_to_reg passing NULL to memcpy
* options: disallow empty 'fdc' and 'scl'
* paste: avoid edges cases caused by empty chunk
* paste: deal with eol and eof in Visual mode
* paste: deal with trailing new line in chunk
* paste: don't move cursor past the end of pasted text in Normal mode
* paste: escape control characters in Cmdline mode
* paste: use getcmdtype() to determine whether in cmdline mode
* prompt: add missing changes from v8.1.0036
* pty_process_win/wait_eof_timer_cb: also check for proc->out.did_eof
* pum_redraw: use grid_puts_len() to truncate the text
* PVS/V1019: compound assignment expression is used inside condition
* PVS/V560: ignore false "conditional expression is always false"
* PVS/V583: the '?:' operator always returns one and the same value
* query.lua: check empty table for lines
* quickfix: avoid O(N^2) when filling from string typval
* remote: make compile again
* remote: report connection error, missing return values
* remote: report on missing wait commands, typecheck lua results
* remote: respect silent in error reporting
* remote: use STATIC_CSTR_AS_STRING
* resolve nil arguments to API functions
* respect os_proc_children rv of pid not found
* runtime: add missing release metadata
* runtime: add syntax file for query
* runtime: check markdownError before syn-clear
* screen: do not do syntax highlighting at filler or folded lines
* screen: do not draw filler lines post eof if already at last row
* screen: do not update syntax_last_parsed when drawing folded line
* screen: don't put empty sign text in line number column
* screenpos, float: add top and left border adjustment
* screen: truncate double-width character correctly
* screen: truncate when overwriting right half of a double-width char
* set nested before executing callback
* set RedrawingDisabled before entering aucmd_win
* signcol: always trigger a redraw
* signcol: handle edge case with maximum value
* signcol: update cursor when signcol changes
* skip libutil on SunOS
* substitute: properly check for empty command line
* syntax.c: correct hunk from Vim patch 8.0.0647
* syntax: remove trailing spaces in vim.vim
* tabpage: correct check for failure to close window
* termdebug: handle exiting during startup properly
* terminal: correctly forward mouse events
* terminal: fix resize crash with pending scrollback
* terminal: ignore left-release mouse action
* terminal: return early if there are no invalid rows
* terminal: use coladvance() to calculate buffer cursor position
* test: only use buffer completion in popupmenu timer test
* tests: update legacy tab switch test to be sane
* translation: po file for Russian
* translation: po file for Ukrainian
* ts: escape lang when loading parsers
* tui: avoid using uninitialized memory in kitty
* tui: correct CSI sequence
* tui: end streamed paste correctly when key buffer is empty
* tui: remove `ESC NUL` forced escape
* ui: close floating window on BufLeave event
* ui: inccomand performance degradation
* ui: make window resize commands manage cmdheight
* update last cursor on first CursorMoved
* uri: change scheme pattern to not include the comma character
* use normal! <C-L> in default <C-L> mapping
* vim-patch.sh: fix N/A files patterns
* win_close: count the window the be closed instead of curwin
* win_split_ins: do not fail when oldwin is not valid
2022-04-15 13:38:44 +02:00
Lewis Russell
fcd57980f9
chore: add additional compiler flags (#17815)
Added:
  - -Wdouble-promotion
  - -Wmissing-noreturn
  - -Wmissing-format-attribute
  - -Wsuggest-attribute={pure,const,malloc,cold}

Resolves: #343
2022-03-24 12:14:04 +01:00
Dundar Göc
6379389cbb build(cmake): fix policy warning 2022-03-04 17:16:40 +01:00
James McCoy
55ab76a1c0
build: bump minimum version of luv to 1.43.0
This is required for the recent addition of lua loop threading
(luv_set_thread).
2022-02-27 09:06:55 -05:00
Henry Fraser
087aad3dcd ci: improved cpack packaging
Addresses: #12571

- Added the following installers through CMake files:
    - Windows NSIS.
    - Windows MSI.
    - Windows zip.
    - MacOs tarball.
    - Linux tarball.
    - Linux Deb package.
- Tweaked pipeline CPack commands to build using new CMakeLists.txt configuration file.
- Added icons and relevant packaging files.
- Updated notes.md to reflect new installation instructions.

This isn't meant to be the perfect solution, it's simply a first pass at using a
simple packaging system to build Windows installers. A Debian package has also
been added since it's very easy but other packages have been left out due to
limiting the scope. Hopefully we can build further upon this and improve it
over time with code signing, better icons and more user-friendly installation
graphics and so on.
2022-02-24 19:54:44 +10:00
Thomas Vigouroux
b1e0aa60f9
feat(treesitter): set allocator when possible
Adds a new cmake check to keep this backwards compatible with the
different versions of tree-sitter.
2022-01-09 10:17:46 +00:00
Shadman
e402103911
chore(build): compile lua only on release builds (#16859) 2022-01-03 12:44:30 -07: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
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
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
Gregory Anders
7b910a1716 chore: bump API version 2021-12-04 14:04:23 -07:00
Björn Linse
7229afcd60 version bump 2021-11-30 18:38:40 +01:00
Björn Linse
e65b724451 NVIM 0.6.0
BREAKING CHANGES

* 32-bit windows builds are no longer provided.

* **build deps**: use libuv 1.42.0 upstream for WIN32 (#15889) (f6c0a37), closes #15889
  * removes Windows 7 support
  * removes support for mouse and alternate buffers in TUI for Windows 8 and 8.1

* **lsp/diagnostic:** highlight groups and signs for LSP diagnostics renamed (e.g. `LspDiagnosticsDefaultWarning` to `DiagnosticWarn`) (a5bbb93)

* **diagnostic:** make DiagnosticChanged a first class autocmd (#16098) (150a592), closes #16098
  * `au User LspDiagnosticsChanged` autocommands are not supported. Use the new first-class DiagnosticChanged event instead.

* **lua**: `register_keystroke_callback` => `on_key` (#15460) (69fe427)
  * **note**: this breaking change was included in 0.5.1

FEATURES

* **:source, nvim_exec:** defer script item creation until s:var access (da9b0ab)
* **:source, nvim_exec:** support script-local variables (d4ed51e), closes #13143 #11507
* **lua:** add trimempty optional parameter to vim.split (5fa26e2)
* **lua:** add vim.str_utf_{start,end} (#16129) (2230b57)
* **lua:** add vim.str_utf_pos function (d752cbc)
* **lsp:** aggregate code actions from all clients (#15121) (c36df20)
* **api:** add lua C bindings for xdiff (#14536) (3d3c0c6)
* **api:** evaluate statusline string #16020 (9086938)
* **api:** named marks set, get, delete #15346 (49fdc62)
* **api:** nvim_get_chan_info: include "argv" for jobs #15537 (0603eba), closes #15440
* **api:** win_viewport also sends line_count #15613 (086631c)
* **api:** support :terminal input callback in lua (9e41e82)
* **ci:** add backport PR action (#14766) (6cc456d)
* **decorations:** allow more than one stacked highlight in a virt_text (1495d36)
* **decorations:** support virtual lines (392c658) (8d7816c)
* **diagnostic:** move vim.lsp.diagnostic to vim.diagostic and support other sources (a5bbb93)
* **diagnostic:** add 'prefix' option to open_float (#16321) (3c74ba4)
* **diagnostic:** add option to include diagnostic source (d43151e)
* **diagnostic:** allow 'prefix' option to return highlight (cc48837)
* **diagnostic:** allow customized diagnostic messages (#15742) (d999c96)
* **diagnostic:** match(), tolist(), fromlist() #15704 (e61ea77)
* **diagnostic:** update jumplist on goto_next/prev (#15942) (b55944e)
* **diagnostic:** use `scope = 'line'` by default for `open_float()` (#16456) (217f9f8), closes #16453
* **diagnostic:** support severity_sort (32c0631)
* **checkhealth:** provide function for command line completion (8b43b07)
* **f_chansend:** support Blob data argument (7e9ea08)
* **job:** add parameter to close stdin (eb7f24b)
* **keywordprg:** use :terminal for external commands #15398 (a90513c), closes #2995 #2761
* **lsp:** add 'focus' option to open_floating_preview (#16465) (fff8827)
* **lsp:** add a registry for client side code action commands (6c03601)
* **lsp:** add client command support to codelens (#15820) (19a77cd)
* **lsp:** add codeAction/resolve support (#15818) (ec4731d)
* **lsp:** add exit_timeout flag (#16070) (80456cf)
* **lsp:** add formatexpr (#16186) (52fa1d2)
* **lsp:** add lsp healthcheck (e268026)
* **lsp:** add per-client commands (#16101) (519d8de)
* **lsp:** add tagfunc (#16103) (f940e7a)
* **lsp:** add warning message for large log size (e6777a7)
* **lsp:** allow configuring zindex for floating windows (#15086) (c487a73)
* **lsp:** allow diagnostics to be disabled for a buffer (#15134) (1aeb945)
* **lsp:** allow root_dir to be nil (#15430) (ff0833c)
* **lsp:** highlight active parameter in signature help (#15018) (af26371)
* **lsp:** improve vim.lsp.util.apply_text_edits (#15561) (41cfba6)
* **lsp:** include original request params in handler ctx (187579f)
* **lsp:** jump to diagnostics by position (#14795) (ea39ff5)
* **lsp:** Make line diagnostics display prettier (e43dbfd)
* **lsp:** make list handlers configurable (#15199) (3e00d4f)
* **lsp:** support textDocument/prepareRename (#15514) (c1f573f)
* **lsp:** use uv_spawn to check if server executable (#16430) (1a60580)
* **lsp:** use vim.ui.select() in codelenses (#16004) (e7ea54a)
* **lsp:** utilize textEdit.range for startbyte in omnifunc (#15957) (e9d6f7c)
* **lua:** add lua-cjson as vendored dependency (8decc9f)
* **lua:** add vim.mpack for msgpack support in lua (eaf661d)
* **lua:** allow passing handles to vim.b/w/t (6c5e7bd)
* **lua:** convert binary string with NULs to Blob (de9df82)
* **lua:** document support of packages with v:lua syntax (9dd371b)
* **lua:** enable stack traces in error output (#16228) (03b805a)
* **lua:** expose lua-cjson as vim.json (30fed27)
* **lua:** make vim.mpack support vim.NIL and vim.empty_dict() (0f59666)
* **match:** allow hl group to be defined after :match command (fca52f5)
* **msgpack:** convert Blobs to BIN strings (af6f454)
* **health:** support lua healthchecks (9249dcd), closes #15632
* **shada:** restore Blob globals properly (ef729fb)
* **terminal:** TermClose: set exit code in v:event.status #15406 (50b30de), closes #4713
* **treesitter:** add next, prev sibling method (1400841)
* **treesitter:** allow to set highlight priority for queries (242608e)
* **ui:** add `opt.kind` to `vim.ui.select` (#15838) (7ae86c1)
* **ui:** add vim.ui.input and use in lsp rename (#15959) (16d4af6)
* **ui:** add vim.ui.select and use in code actions (#15771) (63fde08)
* **vim script:** support calling v:lua as a method (b2994e3)

CHANGES

* **defaults:** auto-create backup dir (4600193)
* **defaults:** inccommand=nosplit #15395 (7215d35)
* **defaults:** set undo points in <C-U> and <C-W> (#15400) (2cb8db3)
* **defaults:** limit syntax cost on CmdwinEnter #15401 (622a36b), closes #6289 #6399
* **defaults:** map CTRL-L to search highlights, update diffs #15385 (0aa8128)
* **defaults:** map Y to y$ #13268 (5a111c1), closes #416 #6289
* **defaults:** remove 'options' from viewoptions #15397 (3954537), closes #6289
* **defaults:** set hidden (f6c72b7)
* **defaults:** set nojoinspaces (d417e67)
* **defaults:** switchbuf=uselast #15394 (4ba7495)
* **runtime:** add packages as `"/pack/*/start/*"` patterns to &rtp (9df7e02)
* **startup:** load builtin plugins with --clean #15893 (c7a63f3), closes #15605
* **terminal:** set cursorlineopt=number in terminal mode (#15493) (c61a386)
* **window:** skip non-focusable floats for :windo (#15378) (e8631cb)

PERFORMANCE IMPROVEMENTS

* **api:** avoid spurious allocations when converting small objects (705e8f1)
* **highlight:** use a hashtable for highlight group names (bb4b4d7)
* **lua:** optimize vim.deep_equal #15236 (4b452d4)
* **lua:** don't use regexes inside lua require'mod' (ea2023f), closes #15147 #15497
* **lsp:** improve json deserialization performance (#15854) (912a6e5)
* **map:** reduce double pointer indirection to single pointer indirection (9e651a9)
* **treesitter:** avoid string lookup of highlight name in hot loop (2460f0a)

FIXES

* **:source, nvim_exec:** handle Vimscript line continuations #14809 (6188926), closes #14807
* **:source:** copy curbuf lines to memory before sourcing #15111 (afdc9e6)
* allow str_utfindex second argument to be an explicit nil  (#16448) (512ec46)
* **api:** fix crash after set_option_value_for() #15390 (8b0e6cc), closes #14097 #13577
* **api:** fix nvim_buf_set_extmark (2338345)
* **autocmd:** fix conditions in block_autocmds, unblock_autocmds #15372 (29712ae), closes #6279
* **buffer_updates:** cleanup test behavior (54b2c68)
* **buffer_updates:** handle :delete of the very last line in buffer (8335e26)
* **buffer_updates:** handle :sort of already sorted buffer (ef687d3)
* **buffer_updates:** make `lockmarks` not affect extmarks and buffer updates. fixes #12861 (7d171b1)
* **bufupdates:** send correct updates for visual paste (1423146)
* **build:** add an env var to re-enable the colors (5087347)
* **build:** call find_package(Threads) before using its variables (f446ab3)
* **build:** export symbols on Windows (aa644b7)
* **build:** fix build failure in MinGW (0503e17)
* **build:** make vendored libmpack and libmpack-lua build properly (2a08aef)
* **channel:** throw error if sending to internal channel w/o terminal (3b89fee)
* **checkhealth:** duplicate checks if module name has "-" #15935 (a36c6e5)
* **checkhealth:** mitigate issues with duplicate healthchecks #15919 (acd5e83), closes #15259
* **ci:** disable broken test on openbsd on all CI due to resource constraints (a3e2636)
* **ci:** re-run GHA for ready_for_review events (#15377) (c6ef956)
* **decorations:** crash when :bdelete (extmark_free_all) after clear_namespace (cd353aa), closes #15212
* **defaults:** "syntax sync maxlines=1" on CmdwinEnter #15552 (5f8518b), closes #15401
* **defaults:** do not map Y in visual-mode #15387 (54726e8), closes #13268
* **diagnostic:** allow floats to be focusable (#16093) (427bac6)
* **diagnostic:** change default severity_sort order (938ed45)
* **diagnostic:** clamp line numbers in setqflist and setloclist (5b0d8f8)
* **diagnostic:** correctly handle folder level diagnostics (f87779a)
* **diagnostic:** deepcopy diagnostics before clamping line numbers (2abc799)
* **diagnostic:** do not focus floats in goto functions (#16433) (b5b025f)
* **diagnostic:** don't clamp line numbers in setqflist (0341c68)
* **diagnostic:** don't return nil when callers expect a table (#15765) (057606e)
* **diagnostic:** don't use nil col if missing from qflist (#16357) (5e46f64)
* **diagnostic:** error on invalid severity value (#15965) (d5dd0aa)
* **diagnostic:** fix navigation with diagnostics placed past end of line (34bb5fa)
* **diagnostic:** fix option resolution in open_float (#16229) (fd34784)
* **diagnostic:** fix wrong data type in setqflist() (3fd1450)
* **diagnostic:** get line count per buffer when clamping (c59f200)
* **diagnostic:** handle an unknown or missing client (#16242) (1fdbd29)
* **diagnostic:** handle diagnostics placed past the end of line (#16095) (a2994c8)
* **diagnostic:** make set() go through cache when calling show() (d93f47d)
* **diagnostic:** only update decorations for loaded buffers (#15715) (924e8e4)
* **diagnostic:** preserve fields from LSP diagnostics via user_data (#15735) (17b7968)
* **diagnostic:** remove useless highlight links (#15683) (c13242c), closes #15585
* disable clipboard when test registers (dd63d93)
* **docgen:** add tagfunc.lua (0746f00)
* **doc:** various fixes #15604 (4eb1ebb)
* **eval:** add the vimscript-1 feature to has() (18b32fc)
* **eval:** checking for a non-empty string is too strict (#15987) (1dbbaf8)
* **eval:** fix has('wsl') #16153 (16d06fa), closes #12642 #16143
* **eval:** fixup for empty modifier in fnamemodify (#16368) (a7ad509), closes #16367
* **extmark:** fix missing virt_lines when using id param of set_extmark (995dbd2)
* **extmarks:** splice extmarks on nv_Undo #15920 (e069361)
* **fileio:** replace characters over INT_MAX with U+FFFD (#16354) (a2e5c2f), closes #11877
* **float:** fix potential heap corruption in win_redr_border (de670f3)
* **float:** redraw if w_border_adj changed (7ff1bc1)
* **heath/provider.vim:** using list as string #16007 (5365f24), closes #15988
* **highlight:** remove syncolor.vim, always include syntax colors (9afa0d2), closes #15176 #12573 #15205
* **inccommand:** ignore trailing commands only for *previewed* command #15638 (1f8c91b), closes #8796 #7494
* include ci/ in exported tarball (d6f03aa), closes #15856
* **input:** never reinterpret unmapped ALT- chrods in Terminal mode (#16222) (5ce35ab)
* **input:** resolve isolated (non-ALT/META) mappings #13109 (c4857b6), closes #13042 #13086 #15869
* **jobwait:** always drain process event queues #15402 (3c081d0), closes #15349
* **lsp_spec:** tests depended on previous session (069d1de)
* **lsp:** accept file URIs without a hostname (a2c2a08)
* **lsp:** add done flag to messages returned in util.get_progress_messages() (#15985) (45fa70a)
* **lsp:** add placeholder cancel function (#16189) (4da0351)
* **lsp:** add textDocument/prepareRename to capability map (#15961) (fcc11d5), closes #15899
* **lsp:** adjust legacy show diagnostic functions to use correct scope (#16106) (dc6c9fe)
* **lsp:** allow diagnostic.clear to accept nil bufnr (#15137) (4ed2d4f)
* **lsp:** avoid duplicates in client attached buffers (#16099) (c5525f2)
* **lsp:** avoid serializing boolean as key (#15810) (96614f8)
* **lsp:** change rpc start notify level to warn (#16467) (04c7b55)
* **lsp:** change signature of buf_highlight_references (#16345) (eb3d591)
* **lsp:** correctly parse LSP snippets #15579 (516775e), closes #15522
* **lsp:** default to UTF-16 in make_position_params (2e3a474)
* **lsp:** do not index nil client in progress (#16262) (8f31b21)
* **lsp:** do not invoke handlers for unsupported methods (#15926) (d288daa)
* **lsp:** don't update active_clients on exit_timeout (#16192) (98f5782)
* **lsp:** enable additional capabilities (#15470) (5d63354)
* **lsp:** ensure buffers are re-attached on rename (#16266) (ee3a58d)
* **lsp:** Ensure users get feedback on references/symbols errors or empty results (256570a)
* **lsp:** expose ContentModified error code to callbacks (#15262) (3f09732)
* **lsp:** fix cursor row after textEdits (#16038) (bd2f61c)
* **lsp:** gracefully handle nil workspaceFolders (#16284) (0ecc58c)
* **lsp:** guard textDocument/codeAction command logic #15769 (433bda4)
* **lsp:** improve symbols_to_items performance (#16197) (5ad15c9)
* **lsp:** Include client name in handler error messages (#15227) (24f2b9e)
* **lsp:** pass bufnr for async formatting (#15084) (c31bc6e)
* **lsp:** persist diagnostic config for clients (bcc9ba5)
* **lsp:** prevent double <text> for cached plaintext markup (910967e)
* **lsp:** restore diagnostics extmarks on buffer changes (#15011) (77b33e4)
* **lsp:** rewrite incremental sync (#16252) (2ecf0a4)
* **lsp:** send buffer contents joined on fileformat-specific linebreak (#16334) (134a638)
* **lsp:** send textDocument/didChange for each buffer (#16431) (3451121)
* **lsp:** support duplicate params in signature help (#15032) (9132b76)
* **lsp:** update lsp-handler signature in call_hierarchy (#15738) (8164adc)
* **lsp:** update workspace/applyEdit handler signature (#15573) (3f526fe)
* **lua:** fix vim.deepcopy for metatables & cycled tables (#16435) (eb876a0)
* **lua:** preserve argument lists which are not lists (6896d22)
* **man.vim:** ensure buftype=nofile after :tag or :stag #15675 (29bc648), closes #15650
* **man.vim:** filetype=man is too eager #15488 (2548a9e), closes #15487 #15487
* **mouse:** fix mouse drag positions on multigrid #12667 (0dcfd0e), closes #15091
* **mouse:** correct dragged position in composed layout (810da1a)
* **multigrid:** mouse events crash neovim (28ac6c0)
* **nvim_open_win:** crash if autocmds delete buffer/window #15549 (0c06da1), closes #15548
* **options:** using :set fillchars should clear local value (7528bce)
* prevent K_EVENT from stopping Select mode CTRL-O #15688 (5f144ef)
* **provider:** compare versions as number, not string (python 3.10 support) #15937 (e16adbf), closes #14586
* **screen:** make display_tick monotonic up to 2^64. fixes #16152 (9e88c9c)
* **screen:** missing search highlights when redrawing from timer #15380 (db695cc), closes #13074 #14064
* **shared:** do not treat empty tables as list in deep extend (#15094) (526fc60)
* **sign:** reset auto sign column with minimum in float win minimal style (c8f57f6)
* **startup:** init.lua: set $MYVIMRC to absolute path #15748 (c76cddf)
* **termdebug:** replace mapset with nvim_set_keymap (#15699) (4d7dcbe)
* **termdebug:** replace term_getline with getbufline #15598 (11289ad)
* **terminal:** close without ! if the job is stopped (55defa1), closes #4683
* **terminal:** free terminal if close_buffer() closes a closed terminal (#16264) (14def4d)
* **test/dumplog:** tostring(rv) before formatting as string (ddaa0cc)
* **tests:** use isolated XDG_DATA_HOME in startup tests (8e663e2)
* **treesitter:** do not map hl_group when no mapping is set (f489d98)
* **treesitter:** run predicates more often in iter_matches (458f2aa)
* **tui:** extend smglr ignores to smglp and smgrp (#16239) (3ba800f)
* **tui:** remove obsolete $NVIM detection #15791 (4414584), closes #12937 #11390
* **tutor:** formatting, layout #15098 (c52ec8f), closes #15088
* **ui:** use nowait for q mapping in floating window (#16427) (c132144)
* **v:lua:** fix emsg when calling v:lua directly (da9005a)
* **vim-patch.sh:** run nvim with -u NONE -n #16179 (97ae0ab)
* **vim.opt:** vimL map string values not trimmed (#14982) (4906156)
* **window:** win_close from other tabpage #15454 (90b2da1), closes #15313
* **windowing:** positioning of relative floats (9065730)
2021-11-30 18:20:42 +01:00
Jakub Łuczyński
035d82e0d3
build: update cmake min version to 3.10 #16065
* build(cmake): update cmake min version to 3.10
* ci: test cmake minimum required version
* build(cmake): remove some legacy includes
  * Since version 3.5 cmake_parse_arguments is implemented natively.
2021-10-19 19:19:33 -07:00
Justin M. Keyes
736299bf22 build(lint): check scripts/*.lua 2021-09-19 16:36:08 -07:00
Björn Linse
62d67de598 version bump 2021-07-02 18:12:11 +02:00
Björn Linse
a5ac2f45ff NVIM v0.5.0
This release represents ~4000 commits since v0.4.4, the previous
non-maintenance release. Highlights include builtin support for LSP, new APIs
for extended marks (with byte resolution tracking of changes) and buffer
decorations, as well as vast improvements to lua as a plugin and configuration
language. Experimental support for tree-sitter as a syntax engine is also
included, building on the new core APIs for byte tracking and decorations.

FEATURES:

New API functions:
  nvim_exec: execute multiline vim script blocks
  nvim_get_hl_id_by_name: Gets a highight definition by name
  nvim_exec_lua: new name for nvim_execute_lua
  nvim_notify: Notify the user with a message
  nvim_get_runtime_file: Find files in runtime directories
  nvim_get_all_options_info: Get option information for all options
  nvim_get_option_info: Get option information for one option
  nvim_echo: Echo a message with highlights
  nvim_open_term: Open a virtual terminal in a buffer
  nvim_chan_send: send data to a channel. (like chansend() but supports lua strings)
  nvim_set_decoration_provider: callback driven decoration API for a namespace

  nvim_buf_set_text: Set/replace a character range in a buffer
  nvim_buf_delete: Delete the buffer. |:bwipeout|
  nvim_buf_get_extmark_by_id: Returns position for a given extmark id.
  nvim_buf_get_extmarks: get extmarks in traversal order.
  nvim_buf_set_extmark: Creates or updates an extmark.

  nvim_buf_del_extmark: Removes an extmark.
  nvim_buf_call: call a function with buffer as temporary current buffer

  nvim_win_hide: Closes the window and hide the buffer it contains |:hide|
  nvim_win_call: Calls a function with window as temporary current window.

New UI events:
  redraw.screenshot
  redraw.win_viewport

Lua:
  767cd8b17 #12235 startup: add init.lua as an alternative user config
  687eb0b39 #14686 feat(startup): Source runtime/plugin/**/*.lua at startup
  #14686 runtime: allow lua in various runtime search paths such as
         syntax/ ftdetect/ indent/ ftplugin/ compiler/ colors/
  43956dea5 #13479 lua: Add vim.opt and fix scopes of vim.o
  1407899c3 #12268 lua: Add buffer, window and tab accessors
  be662fe5c lua: vim.wait implementation
  2b663c061 #14213 viml: embed Lua syntax highlighting
  901dd79f6 feat: add completion to ':lua'
  82688973 lua: complete methods in metatables
  342148525 runtime: propagate lua parsing errors while using "require"
  aaca2c1c4 #13276 feat(lua): improve error message to make it actionable
  c60c7375f startup: handle autoload and lua packages during startup
  3ccdbc570 #12536 lua: add vim.register_keystroke_callback
  971a191c4 lua: Add ability to pass lua functions directly to vimL
  91e41c857 #12401 lua: add vim.highlight.range
  f2894bffb #12279 lua: Add highlight.on_yank
  ae5bd0454 #11969 lua: add tbl_deep_extend
  ea4127e9a lua: metatable for empty dict value
  dab40f43b Add v:lua.func() vimL syntax for calling lua
  678a51b1d Lua: vim.validate()
  474d0bcbf lua: vim.rpcrequest, vim.rpcnotify, vim.NIL
  8ee7c94a9 lua: add vim.fn.{func} for direct access to vimL function
  d0d38fc36 #11442 Lua: vim.env, vim.{g,v,w,bo,wo}

Tree-sitter:
  Note: tree-sitter is considered experimental for 0.5. There's remaining
  bugs for buffer parsing, as well as known performance issues for
  large files and injected (nested) languages.

  e93342629 #10124 Tree-sitter API for lua
  440695c29 tree-sitter: implement query functionality and highlighting prototype
  8bea39f37 feat(treesitter): allow injections to be configured through directives
  929f19414 feat(treesitter): add offset predicate for language injection
  cd75d3289 #14200 feat: treesitter checkhealth
  1a631026a feat(treesitter): add language tree
  d3f544002 treesitter: runtime queries
  3c5141d2c #13008 treesitter: add string parser
  9437327d5 treesitter: use new on_bytes interface
  e4b5efa51 treesitter: use decoration provider API
  d6209a7b8 fix: Add a test and it is so pretty
  836c31032 feat(ts): bump tree-sitter to v0.20.0

LSP client:
  00dc12c5d #11336 lua LSP client: initial implementation
  d5aaad14e #11430 Followup improvements to LSP
  ee7ac469c #11578 LSP: Use async completion for omnifunc.
  070bd3ea2 #11604 LSP: shrink API, improve docs
  25afa10f9 #11669 Merge 'LSP: differentiate diagnostic underline by severity'
  e956ea767 #11777 LSP: show diagnostic in qf/loclist
  dd8b29cfe #11838 LSP: set InitializeParams.rootPath value
  0c5d2ffeb #11837 Merge 'LSP: fixes, improve test visibility'
  ca8699378 #11638 LSP: implement documentHighlight
  220a2b05c LSP/references: Add context to locations returned by server
  ccb038dc6 LSP/completion: add textEdit support
  da6f38ab3 #12313 LSP: Add workspace.applyEdit client capabilities
  f559e5249 #11607 LSP: Add textDocument/codeAction support
  0d83a1c43 #12638 LSP: Feature/add workspace folders
  fd507e278 #13641 LSP: window/showMessageRequest
  e467d2939 LSP: Move workspace/configuration handler from nvim-lspconfig to core
  2bdd553c9 feat(lsp): Add codelens support

UI:
  f8134f2fd screen.c: remove fold_line special case
  c146eddc8 experimental support for per-window color schemes
  a1508c9f6 nvim__screenshot (dump TUI state to file)
  08fe10010 terminal: enable pass through indexed colors to TUI in rgb mode
  5a8569942 tests/ui: make screen.lua use "linegrid" representation internally
  8fe19d9d8 screen: make ui_compositor aware of the intended size of a float
  54ce1010e extmark: add new flexible "decorations" abstraction
  4781333a7 decorations: allow virt_text overlay at any column
  bdebe8516 decorations: use extmark column adjustments for buffer highlights
  7b488314d decorations: Allow highlights beyond end of line hl_eol
  425bc438a decorations: add additional styling of virt_text overlays
  edb5864a2 floats: z-index
  243820ebd floats: add borders (MS-DOS MODE)
  5b6edc852 feat(float): add rounded borders preset
  4a36ec6da #14310 float: add "solid" border style

vim patches:
  around ~1000 vim patches and runtime updates got merged. Hooray!
  Changes include improvements to quickfix, prompt buffers, incsearch,
  display of search counts, and much much more.

various features and changes:
  858c05613 #12809 Support for :perl, :perlfile, :perldo and perleval()
  bc86f76c0 api/buffer: add "on_bytes" callback to nvim_buf_attach
  19b623708 jobstart now supports env/clear_env
  ef7c6b972 Support specifying "env" option for termopen()
  7c4f34966 #13287 switch from travis to github actions
  24db59ca8 feat: implement BufModified autocmd
  b83d8223f implement Scroll autocommand
  8caf84130 Lower "closed by the client" message level to INFO
  7de276b87 bump libvterm to 0.1.4
  097ec71bd #14096 aarch64/linux: fix build by updating LuaJIT
  bd5f0e969 #12531 support autoread using tui focus tracking
  8a1276005 #12382 Add v:event.visual during `TextYankPost`
  802f8429d api(nvim_open_win): add "noautocmd" option

FIXES:
  21444552c BugFix(clipboard): Fix block paste not working properly
  01493e799 #14413 api: fix nvim_exec() silencing behaviour
  9699f3be1 fix(doc): Add '/site' to stdpath('data') example in `:help 'rtp'`
  581b2bcde screen: fix problem with p_ch
  eae4b1e5c luaref: fix leaks for global luarefs
  409b2711f fix: segfault when pasting in term with empty buffer
  cf6c23fb0 #14273 fix plenty of errors discovered by clang
  21035cff9 #14500 fix plenty of errors discovered by coverity
  bca19138b #13987 tui: fix possibility of evaluating uninitialized variables
  9f2335937 fix_cursor: do not change line number when edit will not impact cursor row
  33f92fe02 fix(pty): Always use $TERM from the job's env dict
  6249059d4 checkhealth: fix terminfo problems on Windows
  397be5d38 #12811 UI: fix cursor not displayed after hiding and un-hiding
  87afc9031 screen.c: fix an issue with wrap and folds
  b419e39a2 screen.c: fix last character on foldtext
  2ea312769 #13688 screen.c: fix display of signcolumn=auto in diffs
  c2d288e29 Fix screen terminal family issues
  314b222c2 #14127 Fix click on foldcolumn with vsplit
  e65d0e53b vim.fn: throw error when trying to use API function
2021-07-02 17:54:29 +02:00
Christian Clason
7e8a8482e8 fixup(ts): put ts_query_cursor_set_match_limit behind feature guard
This is a fixup for #14915, which used the above-mentioned call to
restore the behavior of the pre-release version of tree-sitter to
that of 0.19.5. However, this function was introduced after 0.19.5,
breaking distro builds that link against 0.19.5 instead of the tag
specified in neovim's build script.

Now the function should only be called when it is available _and_
needed. Once tree-sitter is bumped to 0.19.6 (when this is released),
this guard can be removed again.

Fixes #14923 (among others)
2021-06-29 17:15:12 +02:00
Oliver Marriott
e2bc0bf665
fix(ci): adjust DEPS_INSTALL_DIR on OpenBSD to avoid pkg-config bug (#14803)
Also bumps to OpenBSD 6.9 and updates packages.

Co-authored-by: glacambre <code@lacamb.re>
2021-06-13 14:03:47 -04:00
brian.orwe
84f10a7970 Add uninstall target for make and others 2021-03-16 15:33:39 +03:00
erw7
b2f1969f82 option: fix problem with fileignorecase not being set properly 2021-02-25 13:50:30 +09:00
Tae Won Ha
27ddaa39db
Do not set pagezero_size and image_base for LuaJIT >= 2.1.0-beta3
This is properly handled in LuaJIT now and setting causes "Malformed
Mach-o file" error when running the resulting binary on arm64 Macs.
2020-12-13 21:03:27 -05:00
dm1try
3421485253 runtime: propagate lua parsing errors while using "require" 2020-12-10 10:53:28 +01:00
James McCoy
86eba08a4b
build: Rename TRAVIS_CI_BUILD variable to CI_BUILD 2020-11-13 13:36:56 -05:00
James McCoy
1451b14873
Align naming of FindTreeSitter cmake file and variables
`find_package(Foo ...)` expects to find a file FindFoo.cmake and the
resulting variables to be named `Foo_...`.  If those don't all match up,
then the detection does not work properly.

Closes #13262
2020-11-09 15:15:03 -05:00
Thomas Vigouroux
3eb241d831
bundle: move tree-sitter as a bundled dep
fixup! bundle: move tree-sitter as a bundled dep

fixup! bundle: move tree-sitter as a bundled dep
2020-11-03 10:39:35 +01:00
James McCoy
37fa8d3f44
Disable -Wimplicit-fallthrough for funcs.generated.h
This is code generated by gperf, so there's nothing we can do about it.
The code does have /*FALLTHROUGH*/ comments but clang doesn't recognize
them.
2020-08-23 20:59:39 -04:00
Thomas Vigouroux
e10f9151dc treesitter: remove utf8proc dependency 2020-04-18 09:21:03 +02:00
Andreas Schneider
0504f2f88d cmake: Check for -fno-common and use it if available 2020-02-23 09:49:33 +01:00
erw7
4d0dfb8f75 build/MSVC: fix gettext multibyte issue #11774
Problem:  On Windows with the MSVC build, gettext-translation
          "Questa è già la" displays as "Questa <e8> gi<e0> la".
Solution: Fix iconv detection iconv when building gettext.
          So HAVE_ICONV is correctly defined when building nvim.

* fix gettext mb chars on MSVC
* fix libintl detection failure on MSVC

fixes #11749
2020-01-28 00:56:26 -08:00
Daniel Hahler
7d66a02b88
build: CMakeLists: do not set MIN_LOG_LEVEL with C flags (#11498)
Fixes https://github.com/neovim/neovim/issues/11496.
2019-12-02 17:12:51 +01:00
Marco Hinz
1cb4674547
api: add nvim_buf_get_virtual_text() (#11354)
This adds the missing partner function of nvim_buf_set_virtual_text().
2019-11-10 16:38:04 +01:00
vincowl
ec5776d92d build: add -fstack-protector* to linker #11292
Needed by chromeOS.
fixes #11228
2019-10-26 12:36:26 -07:00
Justin M. Keyes
019c8d13dd
build/doc/CI: remove/update quickbuild references #11258 2019-10-19 18:04:08 -07:00