aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
| * | refactor: move some mapping-related code to a separate file (#19061)zeertzjq2022-06-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This marks the following Vim patches as ported: vim-patch:8.1.1785: map functionality mixed with character input Problem: Map functionality mixed with character input. Solution: Move the map functionality to a separate file. (Yegappan Lakshmanan, closes vim/vim#4740) Graduate the +localmap feature. https://github.com/vim/vim/commit/b66bab381c8ba71fd6e92327d1d34c6f8a65f2a7 vim-patch:8.2.3643: header for source file is outdated Problem: Header for source file is outdated. Solution: Make the header more accurate. (closes vim/vim#9186) https://github.com/vim/vim/commit/a3f83feb63eae5464a620ae793c002eb45f7a838 Also cherry-pick a change for <unique> mappings from patch 8.2.0807. Rename map_clear_mode() to do_mapclear().
| * | Merge pull request #19058 from bfredl/minioptbfredl2022-06-23
| |\ \ | | | | | | | | perf(highlight): use binary search to lookup RGB color names
| | * | perf(highlight): use binary search to lookup RGB color namesbfredl2022-06-23
| | |/
| * | vim-patch:8.2.5152: search() gets stuck with "c" and skip evaluates to true ↵zeertzjq2022-06-23
| | | | | | | | | | | | | | | | | | | | | (#19064) Problem: search() gets stuck with "c" and skip evaluates to true. Solution: Reset the SEARCH_START option. (closes vim/vim#10608) https://github.com/vim/vim/commit/180246cfd1a5842c538fa8a4a0b520f1d95c90c7
| * | Merge pull request #19020 from echasnovski/screenchar-floatbfredl2022-06-23
| |\ \ | | | | | | | | fix(float): make `screen*()` functions respect floating windows
| | * | fix(float): make `screen*()` functions respect floating windowsEvgeni Chasnovski2022-06-23
| | | | | | | | | | | | | | | | Resolves #19013.
| * | | vim-patch:8.2.2068: transparent syntax item uses start/end of containing ↵zeertzjq2022-06-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | region (#19055) Problem: Transparent syntax item uses start/end of containing region. Solution: Do not change the startpos and endpos of a transparent region to that of its containing region. (Adrian Ghizaru, closes vim/vim#7349, closes vim/vim#7391) https://github.com/vim/vim/commit/b46f57e87b3706a8c4b97d8e03f7853a7938b061
| * | | vim-patch:8.2.5151: reading beyond the end of the line with lisp indentingzeertzjq2022-06-23
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Reading beyond the end of the line with lisp indenting. Solution: Avoid going over the NUL at the end of the line. https://github.com/vim/vim/commit/8eba2bd291b347e3008aa9e565652d51ad638cfa
| * | | vim-patch:8.2.5150: read past the end of the first line with ":0;'{"zeertzjq2022-06-23
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Read past the end of the first line with ":0;'{". Solution: When on line zero check the column is valid for line one. https://github.com/vim/vim/commit/f7c7c3fad6d2135d558f3b36d0d1a943118aeb5e
| * | | fix(input): use correct grid when restoring cursor for <expr> mapping (#19047)zeertzjq2022-06-23
| | | |
| * | | fix(api): check error after getting win/buf handle (#19052)Gregory Anders2022-06-22
| | |/ | |/|
| * | Merge pull request #19039 from bfredl/multicolorbfredl2022-06-22
| |\ \ | | | | | | | | perf: get rid of unnecessary allocations in highlight groups
| | * | perf(ui): remove spurious allocations from mode_style_array()bfredl2022-06-21
| | | |
| | * | perf(highlight): allocate permanent names in an arena for fun and cache localitybfredl2022-06-21
| | | |
| | * | refactor: remove atrocious HL_TABLE()[idx] syntax before I poke my eyes outbfredl2022-06-21
| | | |
| | * | refactor(highlight): get rid of syn_unadd_group()bfredl2022-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a sham. if the user does hi ExistingGroup guifg=AliceBlue invalidkey=foobar the "guifg" part will still be executed. No need to micro-manage the same case where ANewGroup is added instead.
| | * | perf(highlight): don't allocate duplicates for color namesbfredl2022-06-21
| | | |
| | * | perf(highlight): get rid of local memory allocations for "{key}={arg}"bfredl2022-06-21
| | | |
| * | | vim-patch:8.2.5132: :mkview test doesn't test much (#19045)zeertzjq2022-06-22
| | | | | | | | | | | | | | | | | | | | Problem: :mkview test doesn't test much. Solution: Save the view with the folds closed. (James McCoy, closes vim/vim#10596) https://github.com/vim/vim/commit/c829faa8211df52997c0b9ee49cdea0c8786b177
| * | | refactor(option): DRY get/set option value #19038Lewis Russell2022-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main motivation for this is for the buf and win cases which need to set up and restore context, and it's what specifically makes the semantics of options nuanced, and thus this should not be repeated more than once. - nvim_get/set_option_value now share argument validation.
| * | | build(cmake): use glob_wrapper instead of file(GLOB in main CMakeListsDundar Goc2022-06-21
| |/ / | | | | | | | | | | | | | | | | | | This will allow cmake to check if any directories needs re-globbing, in other words, if any new file has been added since last time cmake was run. This will (allegedly) make the configure stage slower but I have not noticed any difference so I believe this is well worth it.
| * | Merge pull request #18743 from gpanders/bowooptvalueGregory Anders2022-06-20
| |\ \ | | | | | | | | Add "buf" and "win" to nvim_get_option_value and use them in vim.bo and vim.wo
| | * | feat(api): add "buf" and "win" to nvim_get_option_valueGregory Anders2022-06-20
| | | | | | | | | | | | | | | | These mirror their counterparts in nvim_set_option_value.
| * | | Merge pull request #19030 from zeertzjq/vim-8.2.5138zeertzjq2022-06-21
| |\ \ \ | | | | | | | | | | vim-patch:8.2.{5107,5138}: various small issues
| | * | | vim-patch:8.2.5138: various small issueszeertzjq2022-06-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Various small issues. Solution: Various small improvments. https://github.com/vim/vim/commit/8088ae95bbed2085c5fb196850c4e4b8df55c989 N/A patches for version.c: vim-patch:8.2.5107: some callers of rettv_list_alloc() check for not OK Problem: Some callers of rettv_list_alloc() check for not OK. (Christ van Willegen) Solution: Use "==" instead of "!=" when checking the return value. https://github.com/vim/vim/commit/93a1096fe48e12095544924adb267e3b8a16b221
| * | | | perf(ui): reduce allocation overhead when encoding "redraw" eventsbfredl2022-06-20
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note for external UIs: Nvim can now emit multiple "redraw" event batches before a final "flush" event is received. To retain existing behavior, clients should make sure to update visible state at an explicit "flush" event, not just the end of a "redraw" batch of event. * Get rid of copy_object() blizzard in the auto-generated ui_event layer * Special case "grid_line" by encoding screen state directly to msgpack events with no intermediate API events. * Get rid of the arcane notion of referring to the screen as the "shell" * Array and Dictionary are kvec_t:s, so define them as such. * Allow kvec_t:s, such as Arrays and Dictionaries, to be allocated with a predetermined size within an arena. * Eliminate redundant capacity checking when filling such kvec_t:s with values.
| * | | Merge #19015 delete cmake codeJustin M. Keyes2022-06-19
| |\ \ \
| | * | | build(cmake): simplify def_cmd_target functionDundar Goc2022-06-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | fix(decorations): nvim_buf_set_extmark breaks conceal #19010ii142022-06-19
| |/ / / | | | | | | | | | | | | | | | | | | | | Closes #19007 Co-authored-by: bfredl <bjorn.linse@gmail.com> Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
| * | / fix(tui): piping nodejs to nvim breaks input handling #18932Kevin Sicong Jiang2022-06-19
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Piping NodeJS output into Neovim makes the editor unusable. This happens because NodeJS changes the tty state on exit after Nvim calls uv_tty_set_mode(). (May not always happen due to race condition.) This should have been fixed by 4ba5b4a86461 #13084. But some commands and functions (:sleep, system(), …) call ui_flush() internally, in particular the first tui_mode_change() is called before the end of startup. Steps to reproduce: 1. node -e "setTimeout(()=>{console.log('test')}, 1000)" | nvim -u NORC +"sleep 500m" - 2. The cursor key letters just overwrite the editor screen, and CTRL+C exits. Solution: Skip pending_mode_update during startup. Note: Delaying ui_flush() entirely could be a more general solution (emit a new UI event on VimEnter?). But "remote/coprocess TUI" #18375 could make all of this moot anyway. Fixes #18470
| * | fix(ci): noisy logs, unreliable test #19019Justin M. Keyes2022-06-18
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: 1. CI logs have too many (40+) logs mentioning SIGHUP: ``` WRN 2022-06-18T16:05:47.075 T3568.22499.0/c deadly_signal:177: got signal 1 (SIGHUP) WRN 2022-06-18T16:05:47.273 T3569.91095.0/c deadly_signal:177: got signal 1 (SIGHUP) WRN 2022-06-18T16:05:47.651 T3570.59545.0/c deadly_signal:177: got signal 1 (SIGHUP) ``` 2. TS parser test still sometimes fails on BSD CI. 3. remote_spec test fails too often. Solution: 1. Log deadly signals at INFO level. It hasn't been helpful in CI, and for local troubleshooting it's reasonable to adjust the loglevel as needed. 2. Adjust the TS parser test again. ref #18911 3. Skip the remote_spec test. The `--remote` feature was merged before it was fully formed and needs to be revisited.
| * build(lint): set some linters as non-fatal #19018Justin M. Keyes2022-06-18
| | | | | | | | | | | | | | | | | | | | 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")?
| * fix(terminal): coverity USE_AFTER_FREE #18978Justin M. Keyes2022-06-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Coverity reports use after free: *** CID 352784: Memory - illegal accesses (USE_AFTER_FREE) /src/nvim/buffer.c: 1508 in set_curbuf() 1502 if (old_tw != curbuf->b_p_tw) { 1503 check_colorcolumn(curwin); 1504 } 1505 } 1506 1507 if (bufref_valid(&prevbufref) && prevbuf->terminal != NULL) { >>> CID 352784: Memory - illegal accesses (USE_AFTER_FREE) >>> Calling "terminal_check_size" dereferences freed pointer "prevbuf->terminal". 1508 terminal_check_size(prevbuf->terminal); 1509 } 1510 } 1511 1512 /// Enter a new current buffer. 1513 /// Old curbuf must have been abandoned already! This also means "curbuf" may Solution: Change terminal_destroy and terminal_close to set caller storage to NULL, similar to XFREE_CLEAR. This aligns with the pattern found already in: terminal_destroy e897ccad3eb1e term_delayed_free 3e59c1e20d605
| * fix(logging): try harder to resolve Nvim "name" #19016Justin M. Keyes2022-06-18
| | | | | | | | | | | | | | | | | | | | | | Problem: If startup finishes (starting=false) before the logger ever happens to see a v:servername, we're stuck with the "?.<PID>" fallback name forever. Solution: Drop the `starting` condition. Discard the "?.<PID>" fallback after using it for the current log message. So logging will always check v:servername next time.
| * fix(highlight): use ctermbg/fg instead of bg/fg when use_rgb=false #18982Oliver Marriott2022-06-18
| | | | | | | | | | | | | | | | | | | | | | | | If `use_rgb` was false, we would attempt to set the `cterm_bg_color` to the variable `bg`, which is only retrieved from `bg` and `background` keys, not `ctermbg`. Same for `fg`. This means the values would be `-1` (the default, un-got value) and we'd always set the returned values to `0`. My understanding is `fg/bg` is always "gui" values, so instead we should be using `ctermbg` when needed. Nb: when looking around I think this function is currently *always* called with `use_rgb = true`.
| * vim-patch:8.2.5121: interrupt test sometimes failszeertzjq2022-06-18
| | | | | | | | | | | | | | | | Problem: Interrupt test sometimes fails. Solution: Use a different file name. https://github.com/vim/vim/commit/8d6420631c2bd73dbc1939c4bf04ab7bb39cc263 Add a modeline to test_interrupt.vim.
| * vim-patch:8.2.5120: searching for quotes may go over the end of the linezeertzjq2022-06-18
| | | | | | | | | | | | Problem: Searching for quotes may go over the end of the line. Solution: Check for running into the NUL. https://github.com/vim/vim/commit/2f074f4685897ab7212e25931eeeb0212292829f
| * vim-patch:8.2.5116: "limit" option of matchfuzzy() not always respected (#19005)zeertzjq2022-06-18
| | | | | | | | | | Problem: "limit" option of matchfuzzy() not always respected. Solution: Remove "else". (Kazuyuki Miyagi, closes vim/vim#10586) https://github.com/vim/vim/commit/47f1a55849a73cefe738a246798221e45448546a
| * fix(hl): return cterm fg/bg even if they match Normal #18981Oliver Marriott2022-06-16
| | | | | | | | | | | | | | | | | | | | Fixes #18980 - 831fa45ad84e is related but this doesn't regress that - The `cterm_normal_fg_color != ae.cterm_fg_color` comparison is originally carried from patch to patch starting all the way back in 29bc6dfabde2 where it was avoiding setting a HL attr. But `hlattrs2dict()` now is just informational.
| * Merge #8519 feat: name, test ids, sockets in stdpath(state)Justin M. Keyes2022-06-17
| |\
| | * feat(server): instance "name", store pipes in stdpath(state)Justin M. Keyes2022-06-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: - Unix sockets are created in random /tmp dirs. - /tmp is messy, unclear when OSes actually clear it. - The generated paths are very ugly. This adds friction to reasoning about which paths belong to which Nvim instances. - No way to provide a human-friendly way to identify Nvim instances in logs or server addresses. Solution: - Store unix sockets in stdpath('state') - Allow --listen "name" and serverstart("name") to given a name (which is appended to a generated path). TODO: - is stdpath(state) the right place?
| | * feat(logging): include test-id in log messagesJustin M. Keyes2022-06-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: 1. Log messages (especially in CI) are hard to correlate with tests. 2. Since b353a5c05f02 #11886, dumplog() prints the logs next to test failures. This is noisy and gets in the way of the test results. Solution: 1. Associate an incrementing id with each test and include it in log messages. - FUTURE: add v:name so Nvim instances can be formally "named"? 2. Mention "child" in log messages if the current Nvim is a child (based on the presence of $NVIM). BEFORE: DBG … 12345 UI: event DBG … 12345 log_server_msg:722: RPC ->ch 1: … DBG … 12345 UI: flush DBG … 12345 inbuf_poll:444: blocking... events_enabled=1 events_pending=0 DBG … 23454 UI: stop INF … 23454 os_exit:594: Nvim exit: 0 AFTER: DBG … T57 UI: event DBG … T57 log_server_msg:722: RPC ->ch 1: … DBG … T57 UI: flush DBG … T57 inbuf_poll:444: blocking... events_enabled=1 events_pending=0 DBG … T57/child UI: stop INF … T57/child os_exit:594: Nvim exit: 0
| * | vim-patch:8.2.5110: icon filetype not recognized from the first line (#18987)Christian Clason2022-06-16
| | | | | | | | | | | | | | | Problem: Icon filetype not recognized from the first line. Solution: Add a check for the first line. (Doug Kearns) https://github.com/vim/vim/commit/bf6614643f656d38d220c04befdcb1d35774853a
| * | fix(lua): clear got_int when calling vim.on_key() callback (#18979)zeertzjq2022-06-16
| |/
| * refactor(log): use msg_schedule_semsg #18950Justin M. Keyes2022-06-15
| |
| * vim-patch:8.2.5097: using uninitialized memory when using 'listchars' (#18974)zeertzjq2022-06-16
| | | | | | | | | | Problem: Using uninitialized memory when using 'listchars'. Solution: Use the length returned by mb_char2bytes(). (closes vim/vim#10576) https://github.com/vim/vim/commit/74ac29cecd56457ee93f3f71b31b7a2e6d9712d6
| * fix(ui): do not call showmode() when setting window height (#18969)zeertzjq2022-06-15
| |
| * docs: fix typos (#18866)dundargoc2022-06-15
| | | | | | | | | | | | | | docs: fix typos and similarly insignificant changes Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: smjonas <jonas.strittmatter@gmx.de> Co-authored-by: kanreki <32443233+kanreki@users.noreply.github.com>
| * Merge pull request #18947 from zeertzjq/vim-8.2.1897zeertzjq2022-06-14
| |\ | | | | | | vim-patch:8.2.{1897,1898,5088}
| | * vim-patch:8.2.5088: value of cmod_verbose is a bit complicated to usezeertzjq2022-06-14
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Value of cmod_verbose is a bit complicated to use. Solution: Use zero for not set, value + 1 when set. (closes vim/vim#10564) https://github.com/vim/vim/commit/cd7496382efc9e6748326c6cda7f01003fa07063 Omit has_cmdmod(): only used for Vim9 script