aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/main.c
Commit message (Collapse)AuthorAge
...
* build(IWYU): fix includes for func_attr.hdundargoc2023-11-27
|
* build: enable IWYU on macdundargoc2023-11-27
|
* build(IWYU): replace most private mappings with pragmas (#26247)zeertzjq2023-11-27
|
* refactor: remove vim.h from more headers (#26244)zeertzjq2023-11-27
|
* refactor: move garray_T to garray_defs.h (#26227)zeertzjq2023-11-26
|
* build: suppress bugprone-reserved-identifier warningsdundargoc2023-11-21
| | | | | These are only used when running `make lintc` with ENABLE_ASAN_UBSAN enabled, which is why it wasn't caught by CI.
* build: adjust clang-tidy warning exclusion logicdundargoc2023-11-20
| | | | | | | Enable all clang-tidy warnings by default instead of disabling them. This ensures that we don't miss useful warnings on each clang-tidy version upgrade. A drawback of this is that it will force us to either fix or adjust the warnings as soon as possible.
* Merge pull request #25724 from luukvbaal/signmergebfredl2023-11-18
|\ | | | | refactor(sign): move legacy signs to extmarks
| * refactor(sign): move legacy signs to extmarksLuuk van Baal2023-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The legacy signlist data structures and associated functions are redundant since the introduction of extmark signs. Solution: Store signs defined through the legacy commands in a hashmap, placed signs in the extmark tree. Replace signlist associated functions. Usage of the legacy sign commands should yield no change in behavior with the exception of: - "orphaned signs" are now always removed when the line it is placed on is deleted. This used to depend on the value of 'signcolumn'. - It is no longer possible to place multiple signs with the same identifier in a single group on multiple lines. This will now move the sign instead. Moreover, both signs placed through the legacy sign commands and through |nvim_buf_set_extmark()|: - Will show up in both |sign-place| and |nvim_buf_get_extmarks()|. - Are displayed by increasing sign identifier, left to right. Extmark signs used to be ordered decreasingly as opposed to legacy signs.
* | vim-patch:9.0.1857: [security] heap-use-after-free in is_qf_win()zeertzjq2023-11-17
| | | | | | | | | | | | | | | | | | Problem: heap-use-after-free in is_qf_win() Solution: Check buffer is valid before accessing it https://github.com/vim/vim/commit/fc68299d436cf87453e432daa77b6d545df4d7ed Co-authored-by: Christian Brabandt <cb@256bit.org>
* | refactor: iwyu (#26062)zeertzjq2023-11-16
|/
* refactor: follow style guidedundargoc2023-11-13
| | | | | | - reduce variable scope - prefer initialization over declaration and assignment - use bool to represent boolean values
* build: remove PVSdundargoc2023-11-12
| | | | | | | We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
* refactor: remove redundant castsdundargoc2023-11-11
|
* refactor: move defaults into separate module (#25929)Gregory Anders2023-11-08
| | | | Move default mappings and autocommands into a separate module and add comments and docstrings to document each of the defaults.
* refactor: the long goodbyedundargoc2023-11-05
| | | | | | long is 32 bits on windows, while it is 64 bits on other architectures. This makes the type suboptimal for a codebase meant to be cross-platform. Replace it with more appropriate integer types.
* fix(startup): trigger UIEnter for the correct channel (#25860)zeertzjq2023-11-01
|
* feat(server): allow embed with listen (#25709)George Harker2023-11-01
| | | | | | connection from any channel or stdio will unblock remote_ui_wait_for_attach. Wait on stdio only if only —embed specified, if both —embed and —listen then wait on any channel.
* test(unit): move statusline tests to statusline_spec.lua (#25441)zeertzjq2023-09-30
|
* refactor: reorganize option header files (#25437)zeertzjq2023-09-30
| | | | | | - Move vimoption_T to option.h - option_defs.h is for option-related types - option_vars.h corresponds to Vim's option.h - option_defs.h and option_vars.h don't include each other
* build(iwyu): add a few more _defs.h mappings (#25435)zeertzjq2023-09-30
|
* refactor: remove longdundargoc2023-09-29
| | | | | long is 32-bits even on 64-bit windows which makes the type suboptimal for a codebase meant to be cross-platform.
* feat: NVIM_APPNAME supports relative paths #25233Rory Nesbitt2023-09-27
| | | | | | | | | | | | | | Problem: NVIM_APPNAME does not allow path separators in the name, so relative paths can't be used: NVIM_APPNAME="neovim-configs/first-config" nvim NVIM_APPNAME="neovim-configs/second-config" nvim Solution: Let NVIM_APPNAME be a relative path. Absolute paths are not supported. fix #23056 fix #24966
* fix(startup): stop TUI properly when quitting at swap dialog (#25337)zeertzjq2023-09-24
|
* fix(tui): make :cquit work properly with remote TUI (#25313)zeertzjq2023-09-23
|
* feat(remote): avoid --remote-ui infinite loop (#24465)shafouz2023-08-13
|
* fix(startup): make recovery mode work without --headless (#24477)zeertzjq2023-07-25
|
* fix(startup)!: "nvim -l" message does not end with newline #24215zeertzjq2023-07-01
| | | Close #24180
* fix(startup): don't truncate when printing with -l (#24216)zeertzjq2023-07-01
|
* fix(startup): "nvim -l foo.lua" may not set arg0 #24161Mike2023-06-26
| | | | | | | | | | | | | | | | | Problem: Using "nvim -l args.lua" without passing extra script args, does not set `_G.arg[0]`. Steps to reproduce: ``` cat > args.lua<<EOF vim.print(_G.arg, '') vim.print(vim.v.argv, '') EOF nvim --clean -l args.lua ``` Solution: Fix condition in command_line_scan.
* docs #22363Justin M. Keyes2023-06-19
| | | | | | | | | Co-authored by: zeertzjq <zeertzjq@outlook.com> Co-authored by: Steven Todd McIntyre II <114119064+stmii@users.noreply.github.com> Co-authored by: nobe4 <nobe4@users.noreply.github.com> - docs: mention --luadev-mod to run with lua runtime files When changing a lua file in the ./runtime folder, a new contributor might expect changes to be applied to the built Neovim binary.
* fix(remote): restore previous --remote-expr output formatting (#23988)zeertzjq2023-06-11
| | | | - Use tostring() as that's what print() uses internally. - Do not append trailing new line.
* fix(remote): make --remote-expr print to stdout (#23980)zeertzjq2023-06-11
|
* refactor(options): remove `getoption_T` and introduce `OptVal` (#23850)Famiu Haque2023-06-07
| | | | | | | | Removes the `getoption_T` struct and also introduces the `OptVal` struct to unify the methods of getting/setting different option value types. This is the first of many PRs to reduce code duplication in the Vim option code as well as to make options easier to maintain. It also increases the flexibility and extensibility of options. Which opens the door for things like Array and Dictionary options.
* fix(NVIM_APPNAME): show error message if $NVIM_APPNAME is invalidGhjuvan Lacambre2023-05-28
| | | Closes https://github.com/neovim/neovim/issues/23056.
* Merge pull request #23523 from 3N4N/fix/api-infobfredl2023-05-26
|\ | | | | fix(windows): set stdout to binary mode for "--api-info"
| * fix(windows): set stdout to binary mode for --api-infoEnan Ajmain2023-05-07
| | | | | | | | | | | | | | | | | | | | Problem: --api-info output is binary. Not setting the mode may cause the OS to impose unexpected eof. For Windows, it scatters extra '0d0a' words in the output. Solution: On Windows, set stdout to binary mode for --api-info. Fixes #20977
* | refactor(vim.secure): move to lua/secure.cLewis Russell2023-05-22
| |
* | build: add ubsan default optionsii142023-05-15
| | | | | | | | Use print_stacktrace=1 for UBSAN by default.
* | docs: small fixesdundargoc2023-05-13
|/ | | | | | | | | Co-authored-by: Christian Clason <c.clason@uni-graz.at> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: HiPhish <hiphish@posteo.de> Co-authored-by: Julio B <julio.bacel@gmail.com> Co-authored-by: T727 <74924917+T-727@users.noreply.github.com> Co-authored-by: camoz <camoz@users.noreply.github.com> Co-authored-by: champignoom <66909116+champignoom@users.noreply.github.com>
* fix(tui): position cursor at bottom-left before stopping (#23369)zeertzjq2023-04-28
| | | Fix #23361
* refactor(fs): now it is time to get rid of fs_loop and fs_loop_mutexbfredl2023-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here's the headline: when run in sync mode (last argument cb=NULL), these functions don't actually use the uv_loop_t. An earlier version of this patch instead replaced fs_loop with using main_loop.uv on the main thread and luv_loop() on luv worker threads. However this made the code more complicated for no reason. Also arbitrarily, half of these functions would attempt to handle UV_ENOMEM by try_to_free_memory(). This would mostly happen on windows because it needs to allocate a converted WCHAR buffer. This should be a quite rare situation. Your system is pretty much hosed already if you cannot allocate like 50 WCHAR:s. Therefore, take the liberty of simply removing this fallback. In addition, we tried to "recover" from ENOMEM in read()/readv() this way which doesn't make any sense. The read buffer(s) are already allocated at this point. This would also be an issue when using these functions on a worker thread, as try_to_free_memory() is not thread-safe. Currently os_file_is_readable() and os_is_dir() is used by worker threads (as part of nvim__get_runtime(), to implement require from 'rtp' in threads). In the end, these changes makes _all_ os/fs.c functions thread-safe, and we thus don't need to document and maintain a thread-safe subset.
* refactor(time): refactor delay with input checkingbfredl2023-04-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, there were three low-level delay entry points - os_delay(ms, ignoreinput=true): sleep for ms, only break on got_int - os_delay(ms, ignoreinput=false): sleep for ms, break on any key input os_microdelay(us, false): equivalent, but in μs (not directly called) - os_microdelay(us, true): sleep for μs, never break. The implementation of the latter two both used uv_cond_timedwait() This could have been for two reasons: 1. allow another thread to "interrupt" the wait 2. uv_cond_timedwait() has higher resolution than uv_sleep() However we (1) never used the first, even when TUI was a thread, and (2) nowhere in the codebase are we using μs resolution, it is always a ms multiplied with 1000. In addition, os_delay(ms, false) would completely block the thread for 100ms intervals and in between check for input. This is not how event handling is done alound here. Therefore: Replace the implementation of os_delay(ms, false) to use LOOP_PROCESS_EVENTS_UNTIL which does a proper epoll wait with a timeout, instead of the 100ms timer panic. Replace os_microdelay(us, false) with a direct wrapper of uv_sleep.
* refactor(env): remove unused mutexbfredl2023-04-20
| | | | | This was needed when TUI was a thread. lua code uses os_getenv only on the main thread.
* vim-patch:9.0.1007: there is no way to get a list of swap file nameszeertzjq2023-04-19
| | | | | | | | | | | | | | | | | | | | | Problem: There is no way to get a list of swap file names. Solution: Add the swapfilelist() function. Use it in the test script to clean up. Remove deleting individual swap files. https://github.com/vim/vim/commit/c216a7a21a25a701b84b79abc1ba6ab0baa3a311 vim-patch:9.0.1005: a failed test may leave a swap file behind Problem: A failed test may leave a swap file behind. Solution: Delete the swap file to avoid another test to fail. Use another file name. https://github.com/vim/vim/commit/d0f8d39d20f8d42f7451f781f7be0bcd20e06741 Cherry-pick test_window_cmd.vim changes from patch 8.2.1593. Remove FUNC_ATTR_UNUSED from eval functions as fptr is always unused. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.0397: :defer not tested with exceptions and ":qa!"zeertzjq2023-04-16
| | | | | | | | | | Problem: :defer not tested with exceptions and ":qa!". Solution: Test :defer works when exceptions are thrown and when ":qa!" is used. Invoke the deferred calls on exit. https://github.com/vim/vim/commit/58779858fb5a82a3233af5d4237a3cece88c10d4 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* refactor: remove redundant castsii142023-04-07
|
* refactor: add const and remove unnecessary casts (#22841)ii142023-04-01
|
* build(win): export extern symbols for use in FFI #22756luukvbaal2023-03-23
| | | | | Makes `extern` variables accessible through ffi on Windows. Follow-up to https://github.com/neovim/neovim/pull/15999
* vim-patch:8.2.1398: autoload script sourced twice if sourced directly (#22622)zeertzjq2023-03-11
| | | | | | | | | | | Problem: Autoload script sourced twice if sourced directly. Solution: Do not source an autoload script again. (issue vim/vim#6644) https://github.com/vim/vim/commit/daa2f36573db3e1df7eb1fdbc3a09a2815644048 Cherry-pick ret_sid changes from patch 8.2.0149. Use do_in_runtimepath() as that's what source_runtime() calls in Nvim. Co-authored-by: Bram Moolenaar <Bram@vim.org>