aboutsummaryrefslogtreecommitdiff
path: root/src/nvim
Commit message (Collapse)AuthorAge
...
| * | | | | | | Merge pull request #26456 from gpanders/ignore-vim-runtimeGregory Anders2023-12-07
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | fix(terminal): ignore $VIM and $VIMRUNTIME in pty jobs
| | * | | | | | | fix(terminal): ignore $VIM and $VIMRUNTIME in pty jobsGregory Anders2023-12-07
| | | | | | | | |
| * | | | | | | | refactor(options): split `get_option_value()` into smaller functionsFamiu Haque2023-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Currently, `get_option_value()` returns 3 separate things: The actual value of the option, whether the option is hidden, and the option flags. This makes the function difficult to refactor, modify or otherwise reason about. Solution: Split `get_option_value()` into 3 functions, each with a single purpose. This also affects `get_option_value_for()`.
| * | | | | | | | fix(lua): allow nil values in serialized Lua arrays (#26329)Gregory Anders2023-12-07
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we convert a Lua table to an Object, we consider the table a "dictionary" if it contains only string keys, and an array if it contains all numeric indices with no gaps. While rare, Lua tables can have both strictly numeric indices and gaps (e.g. { [2] = 2 }). These currently cannot be serialized because it is not considered an array. However, we know the maximum index of the table and as long as all of the keys in the table are numeric, it is still possible to serialize this table as an array. The missing indices will have nil values.
| * | | | | | | perf(column): keep track of number of lines that hold up the 'signcolumn'Luuk van Baal2023-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The entire marktree needs to be traversed each time a sign is removed from the sentinel line. Solution: Remove sentinel line and instead keep track of the number of lines that hold up the 'signcolumn' in "max_count". Adjust this number for added/removed signs, and set it to 0 when the maximum number of signs on a line changes. Only when "max_count" is decremented to 0 due to sign removal do we need to check the entire buffer. Also replace "invalid_top" and "invalid_bot" with a map of invalid ranges, further reducing the number of lines to be checked. Also improve tree traversal when counting the number of signs. Instead of looping over the to be checked range and counting the overlap for each row, keep track of the overlap in an array and add this to the count.
| * | | | | | | refactor: object_to_vim() cannot failJustin M. Keyes2023-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the parent commit, object_to_vim() can't fail, so callers don't need to check its result.
| * | | | | | | feat(rpc): allow empty string key in msgpack => Vim conversionJustin M. Keyes2023-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Since e057b38e7037 #20757 we support empty key in JSON encode/decode, but we don't allow it in RPC object => Vim dict conversion. But empty string is a valid key in Vim dicts and the msgpack spec. Empty string key was disallowed in 7c01d5ff9286 (2014) but that commit/PR doesn't explicitly discuss it, so presumably it was a "seems reasonable" decision (or Vimscript didn't allow empty keys until later). Solution: Remove the check in `object_to_vim()`. Note that `tv_dict_item_alloc_len` will invoke `memcpy(…, 0)` but that's allowed by the C spec: https://stackoverflow.com/a/3751937/152142
| * | | | | | | Merge pull request #26438 from jamessan/log_spec-nameJames McCoy2023-12-07
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | fix(log): increase size of buffer for nvim instance name
| | * | | | | | | fix(log): increase size of buffer for nvim instance nameJames McCoy2023-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 16 bytes is not enough room for existing usage of the buffer by the tests, so the name may get truncated and cause log_spec test to fail: FAILED test/functional/core/log_spec.lua @ 30: log messages are formatted with name or test id test/helpers.lua:146: retry() attempts: 51 test/helpers.lua:155: Pattern "%.%d+%.%d/c +server_init:%d+: test log message" not found in log (last 100 lines): Xtest_logging: ERR 2023-11-24T23:36:34.252 T1274.2445945.0 server_init:57: test log message ERR 2023-11-24T23:36:34.275 T1274.2445945.0 server_init:57: test log message
| * | | | | | | | fix(terminal): never propagate $COLORTERM from outer env (#26440)zeertzjq2023-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If $COLORTERM is "truecolor" but the user sets 'notermguicolors', propagating $COLORTERM to :terminal usually doesn't work well.
| * | | | | | | | fix(inccommand): don't crash with "split" and 'n' flagzeertzjq2023-12-07
| | | | | | | | |
| * | | | | | | | fix(inccommand): save and restore '[ and '] marks (#26442)zeertzjq2023-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Undoing a change moves '[ and '] marks, so it is necessary to save and restore them.
| * | | | | | | | version.c: update (#26441)github-actions[bot]2023-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: marvim <marvim@users.noreply.github.com>
| * | | | | | | | fix(tui): use uv_timer_t instead of TimeWatcher for input (#26435)zeertzjq2023-12-07
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid scheduling on main loop. Fix #26425
| * | | | | | | Merge pull request #26381 from bfredl/delaycolorsbfredl2023-12-06
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | fix(startup): only send one default_colors_set event during startup
| | * | | | | | | fix(startup): only send one default_colors_set event during startupbfredl2023-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the color scheme is changed in a startup script, nvim used to send multiple default_colors_set events, one for the default color scheme and one for the user's chosen color scheme. This would cause flicker in some UI:s. Throttle this event until we actually start drawing on the screen. fixes #26372
| * | | | | | | | Merge pull request #26407 from gpanders/default-tgcGregory Anders2023-12-06
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | feat(defaults): enable 'termguicolors' by default when supported by terminal
| | * | | | | | | | feat(defaults): enable 'termguicolors' by default when supported by terminalGregory Anders2023-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable 'termguicolors' automatically when Nvim can detect that truecolor is supported by the host terminal. If $COLORTERM is set to "truecolor" or "24bit", or the terminal's terminfo entry contains capabilities for Tc, RGB, or setrgbf and setrgbb, then we assume that the terminal supports truecolor. Otherwise, the terminal is queried (using both XTGETTCAP and SGR + DECRQSS). If the terminal's response to these queries (if any) indicates that it supports truecolor, then 'termguicolors' is enabled.
| * | | | | | | | | fix(json): allow objects with empty keys #25564Emanuel2023-12-06
| | |/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Empty string is a valid JSON key, but json_decode() treats an object with empty key as ":help msgpack-special-dict". #20757 :echo json_decode('{"": "1"}') {'_TYPE': [], '_VAL': [['', '1']]} Note: vim returns `{'': '1'}`. Solution: Allow empty string as an object key. Note that we still (currently) disallow empty keys in object_to_vim() (since 7c01d5ff9286d262097484c680e3a4eab49e2911): https://github.com/neovim/neovim/blob/f64e4b43e1191ff30d902730f752875aa55682ce/src/nvim/api/private/converter.c#L333-L334 Fix #20757 Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
| * | | | | | | | fix(treesitter): don't forcefully open foldsJaehwang Jung2023-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: When `vim._foldupdate()` is invoked inside a scheduled callback, the cursor may have moved to a line with a closed fold, e.g., after `dd` on the line that is one line above a folded region. Then it opens the fold, which is unnecessary and distracting. Legacy foldexprs do not have this issue. Solution: Don't explicitly ope