aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/globals.h
Commit message (Collapse)AuthorAge
* refactor: move some constants out of vim_defs.h (#26298)zeertzjq2023-11-29
|
* refactor: fix headers with IWYUdundargoc2023-11-28
|
* refactor: rename types.h to types_defs.hdundargoc2023-11-27
|
* vim-patch:8.2.4685: when a swap file is found for a popup there is no dialog ↵zeertzjq2023-11-25
| | | | | | | | | | | (#26207) Problem: When a swap file is found for a popup there is no dialog and the buffer is loaded anyway. Solution: Silently load the buffer read-only. (closes vim/vim#10073) https://github.com/vim/vim/commit/188639d75c363dffaf813e8e2209f7350ad1e871 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* 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.
* refactor: enable formatting for ternariesdundargoc2023-11-20
| | | | | | This requires removing the "Inner expression should be aligned" rule from clint as it prevents essentially any formatting regarding ternary operators.
* 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.2108: [security]: overflow with count for :s commandzeertzjq2023-11-17
|/ | | | | | | | | | | | | | | | | | | | Problem: [security]: overflow with count for :s command Solution: Abort the :s command if the count is too large If the count after the :s command is larger than what fits into a (signed) long variable, abort with e_value_too_large. Adds a test with INT_MAX as count and verify it correctly fails. It seems the return value on Windows using mingw compiler wraps around, so the initial test using :s/./b/9999999999999999999999999990 doesn't fail there, since the count is wrapping around several times and finally is no longer larger than 2147483647. So let's just use 2147483647 in the test, which hopefully will always cause a failure https://github.com/vim/vim/commit/ac63787734fda2e294e477af52b3bd601517fa78 Co-authored-by: Christian Brabandt <cb@256bit.org>
* refactor: replace manual header guards with #pragma oncedundargoc2023-11-12
| | | | | It is less error-prone than manually defining header guards. Pretty much all compilers support it even if it's not part of the C standard.
* 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.
* build(lint): remove unnecessary clint.py rulesdundargoc2023-10-23
| | | | | Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py.
* refactor(options): rename `empty_option` to `empty_string_option`Famiu Haque2023-10-17
|
* refactor: the long goodbyedundargoc2023-10-03
| | | | | | 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.
* refactor: move some structs out of buffer_defs.h (#24878)zeertzjq2023-08-26
|
* feat(api): allow win_close in cmdwin to close wins except previousSean Dewar2023-07-26
| | | | | | | | | | | Disallow closing the previous window from `nvim_win_close`, as this will cause issues. Again, no telling how safe this is. It also requires exposing old_curwin. :/ Also note that it's possible for the `&cmdheight` to change if, for example, there are 2 tabpages and `nvim_win_close` is used to close the last window in the other tabpage while `&stal` is 1. This is addressed in a later commit.
* refactor: remove longdundargoc2023-07-03
| | | | | long is 32-bits even on 64-bit windows which makes the type suboptimal for a codebase meant to be cross-platform.
* vim-patch:9.0.1621: FILETYPE_FILE is defined to the same value multiple ↵zeertzjq2023-06-09
| | | | | | | | | | | times (#23965) Problem: FILETYPE_FILE is defined to the same value multiple times. Same for a few similar macros. Solution: Define FILETYPE_FILE and others in feature.h only https://github.com/vim/vim/commit/c81dfaa69ceec9f6b88caf1dcdf2f859d4fcae47 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* revert: "refactor: eliminate `autocmd_fname_full` global"zeertzjq2023-06-07
| | | | This reverts commit 82cd0be2eaf71c0476e15c66ba3e83c76896d407.
* 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.
* vim-patch:9.0.1523: some error messages are not marked for translation (#23529)zeertzjq2023-05-08
| | | | | | Problem: Some error messages are not marked for translation. Solution: Surround the messages in _(). (closes vim/vim#12356) https://github.com/vim/vim/commit/276410e78f0b82e3123059383994d2f4c578dfbd
* vim-patch:8.2.1978: making a mapping work in all modes is complicatedzeertzjq2023-05-08
| | | | | | | | | | | | | Problem: Making a mapping work in all modes is complicated. Solution: Add the <Cmd> special key. (Yegappan Lakshmanan, closes vim/vim#7282, closes 4784, based on patch by Bjorn Linse) https://github.com/vim/vim/commit/957cf67d50516ba98716f59c9e1cb6412ec1535d Change docs to match Vim if it's wording is better. Change error numbers to match Vim. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.0250: slightly inconsistent error messageszeertzjq2023-05-05
| | | | | | | | | Problem: Slightly inconsistent error messages. Solution: Make it "Using a Float". (closes vim/vim#10959) https://github.com/vim/vim/commit/dde77a7c4d72622284dc5fb72557bde42c314fa6 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.4890: inconsistent capitalization in error messageszeertzjq2023-05-05
| | | | | | | | | Problem: Inconsistent capitalization in error messages. Solution: Make capitalization consistent. (Doug Kearns) https://github.com/vim/vim/commit/cf030578b26460643dca4a40e7f2e3bc19c749aa Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.3139: functions for string manipulation are spread out (#23316)zeertzjq2023-04-26
| | | | | | | | | Problem: Functions for string manipulation are spread out. Solution: Move string related functions to a new source file. (Yegappan Lakshmanan, closes vim/vim#8470) https://github.com/vim/vim/commit/a2438132a675be4dde3acbdf03ba1fdb2f09427c Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:9.0.0419: the :defer command does not check the function argumentszeertzjq2023-04-17
| | | | | | | | | | | | | Problem: The :defer command does not check the function argument count and types. Solution: Check the function arguments when adding a deferred function. https://github.com/vim/vim/commit/169003289fb4b2ad18fd7f5807e0d05efff0be85 Cherry-pick check_internal_func() from Vim, but use EvalFuncDef pointer as first argument. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.2857: Vim9: exception in ISN_INSTR caught at wrong level (#23131)zeertzjq2023-04-16
| | | | | | | | Problem: Vim9: exception in ISN_INSTR caught at wrong level. Solution: Set the starting trylevel in exec_instructions(). (closes vim/vim#8214) https://github.com/vim/vim/commit/ff65288aa89dcd50760ad942d58baff70c6e93e6 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.0370: cleaning up afterwards can make a function messyzeertzjq2023-04-16
| | | | | | | | | | | | Problem: Cleaning up afterwards can make a function messy. Solution: Add the :defer command. https://github.com/vim/vim/commit/1d84f7608f1e41dad03b8cc7925895437775f7c0 Omit EX_EXPR_ARG: Vim9 script only. Make :def throw E319 to avoid confusing behavior. Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.3783: confusing error for using a variable as a functionzeertzjq2023-04-16
| | | | | | | | | | Problem: Confusing error for using a variable as a function. Solution: If a function is not found but there is a variable, give a more useful error. (issue vim/vim#9310) https://github.com/vim/vim/commit/2ef9156b4284e4a52613c36e3d4667245273a28d Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:8.2.4883: string interpolation only works in heredoczeertzjq2023-04-15
| | | | | | | | | | | | Problem: String interpolation only works in heredoc. Solution: Support interpolated strings. Use syntax for heredoc consistent with strings, similar to C#. (closes vim/vim#10327) https://github.com/vim/vim/commit/2eaef106e4a7fc9dc74a7e672b5f550ec1f9786e Cherry-pick Test_Debugger_breakadd_expr() from Vim. Co-authored-by: LemonBoy <thatlemon@gmail.com>
* vim-patch:8.2.0103: using null object with execute() has strange effectszeertzjq2023-04-15
| | | | | | | | | Problem: Using null object with execute() has strange effects. Solution: Give an error message ofr Job and Channel. https://github.com/vim/vim/commit/e2a8f0773e91685843c062b1e48259712d5f2213 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* refactor: make error message definitions constii142023-04-05
| | | | message.c functions now take const char * as a format. Error message definitions can be made const.
* refactor: use bool type for global variables (#22842)ii142023-04-01
|
* feat(api): add filetype option nvim_get_option_valueLewis Russell2023-03-20
| | | | | - Also adjust the expr-mapping behaviour so normal commands and text changes are allowed in internal dummy buffers.
* refactor(getchar.c): change most char_u to uint8_t (#22444)zeertzjq2023-02-28
|
* fix: remove "Compiled by:" from :version/--version (#22316)dundargoc2023-02-18
| | | | The :version output is already crowded as is, the last thing we need is extraneous messages about who compiled it.
* refactor: replace char_u with char 25 (#21838)dundargoc2023-01-19
| | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with char 24 (#21823)dundargoc2023-01-18
| | | | | refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* Merge pull request #20945 from erw7/feat-more-exception-infozeertzjq2023-01-16
|\ | | | | feat(api): show more exception info
| * refactor: remove E5500, adjust testszeertzjq2023-01-16
| | | | | | | | | | | | Now with try_end() including more exception info, E5500 looks like redundant information. Adjust tests for more exception information.
* | fix(ui): re-organize tty fd handling and fix issuesbfredl2023-01-16
|/ | | | | | | - Use the correct fd to replace stdin on windows (CONIN) - Don't start the TUI if there are no tty fd (not a regression, but makes sense regardless) - De-mythologize "global input fd". it is just STDIN.
* build: remove clint error suppression #21782dundargoc2023-01-13
| | | | | | | | | | | | | | | 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
* feat(lua): exit 1 on Lua "-l" script errorJustin M. Keyes2023-01-05
|
* feat(lua)!: execute Lua with "nvim -l"Justin M. Keyes2023-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Nvim has Lua but the "nvim" CLI can't easily be used to execute Lua scripts, especially scripts that take arguments or produce output. Solution: - support "nvim -l [args...]" for running scripts. closes #15749 - exit without +q - remove lua2dox_filter - remove Doxyfile. This wasn't used anyway, because the doxygen config is inlined in gen_vimdoc.py (`Doxyfile` variable). - use "nvim -l" in docs-gen CI job Examples: $ nvim -l scripts/lua2dox.lua --help Lua2DoX (0.2 20130128) ... $ echo "print(vim.inspect(_G.arg))" | nvim -l - --arg1 --arg2 $ echo 'print(vim.inspect(vim.api.nvim_buf_get_text(1,0,0,-1,-1,{})))' | nvim +"put ='text'" -l - TODO? -e executes Lua code -l loads a module -i enters REPL _after running the other arguments_.
* feat!: remove hardcopyLewis Russell2023-01-03
| | | Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* fix(tui): more work in the TUIbfredl2022-12-31
|
* feat(tui): run TUI as external processhlpr982022-12-31
|
* vim-patch:9.0.1101: unused global variable (#21549)zeertzjq2022-12-27
| | | | | | | | Problem: Unused global variable. Solution: Remove the variable. (closes vim/vim#11752) https://github.com/vim/vim/commit/b536540ab3c13db629432c411e92c05c4a3808ba Co-authored-by: Bram Moolenaar <Bram@vim.org>
* feat(exrc): support .nvim.lua (#21436)Munif Tanjim2022-12-19
|
* vim-patch:9.0.1011: ml_get error when using screenpos()zeertzjq2022-12-06
| | | | | | | | | Problem: ml_get error when using screenpos(). Solution: Give an error for the line number. (closes vim/vim#11661) https://github.com/vim/vim/commit/99d19438cabaf13074229d9a32e3a4af9ce98744 Co-authored-by: Bram Moolenaar <Bram@vim.org>