aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/terminal.c
Commit message (Collapse)AuthorAge
* vim-patch:8.1.1693: syntax coloring and highlighting is in one big file (#17721)Lewis Russell2022-03-18
| | | | | | | | | | | Problem: Syntax coloring and highlighting is in one big file. Solution: Move the highlighting to a separate file. (Yegappan Lakshmanan, closes vim/vim#4674) https://github.com/vim/vim/commit/f9cc9f209ede9f15959e4c2351e970477c139614 Name the new file highlight_group.c instead. Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* chore: fix typos (#17670)dundargoc2022-03-17
| | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(channel): fix channel consistencyerw72022-03-12
| | | | | | | - Fix the problem that chanclose() does not work for channel created by nvim_open_term(). - Fix the problem that the loopback channel is not released. - Fix the error message when sending raw data to the loopback channel.
* feat(term): use vterm_output_set_callback()Andreas Schneider2022-02-08
|
* fix(input): put modifiers back into typeahead buffer when neededzeertzjq2022-01-23
|
* feat(api): add support for lua function & description in keymapshadmansaleh2022-01-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Behavioral changes: 1. Added support for lua function in keymaps in -------------------------------------------- - nvim_set_keymap Can set lua function as keymap rhs like following: ```lua vim.api.nvim_{buf_}set_keymap('n', '<leader>lr', '', {callback = vim.lsp.buf.references}) ``` Note: lua function can only be set from lua . If api function being called from viml or over rpc this option isn't available. - nvim_{buf_}get_keymap When called from lua, lua function is returned is `callback` key . But in other cases callback contains number of the function ref. - :umap, nvim_del_keymap & nvim_buf_del_keymap clears lua keymaps correctly. - :map commands for displaing rhs . For lua keymaps rhs is displayed as <Lua function ref_no> Note: lua keymap cannot be set through viml command / functions. - mapargs() When dict is false it returns string in `<Lua function ref_no>` format (same format as :map commands). When dict is true it returns ref_no number in `callback` key. - mapcheck() returns string in `<Lua function ref_no>` format (same format as :map commands). 2. Added support for keymap description --------------------------------------- - nvim_{buf_}set_keymap: added `desc` option in opts table . ```lua vim.api.nvim_set_keymap('n', '<leader>w', '<cmd>w<cr>', {desc='Save current file'}) ``` - nvim_{buf_}get_keymap: contains `desc` in returned list. - commands like `:nmap <leader>w` will show description in a new line below rhs. - `maparg()` return dict contains `desc`.
* fix(terminal): correctly forward mouse eventszeertzjq2021-12-27
|
* Merge pull request #16596 from ↵Björn Linse2021-12-26
|\ | | | | | | | | dm1try/do_not_leave_terminal_mode_after_mouse_activation do not leave Terminal mode after entering to it using a mouse
| * fix(terminal): ignore left-release mouse actiondm1try2021-12-10
| | | | | | | | | | | | | | | | | | if it is not proccesed by the terminal program to prevent leaving Terminal mode after using a mouse for window switching closes #9483 closes #8691
* | fix(terminal): fix resize crash with pending scrollback (#14891)Sean Dewar2021-12-15
| | | | | | | | | | | | | | | | | | | | | | | | | | refresh_scrollback assumes pending scrollback rows exist only if the terminal window height decreased (or the screen was full). However, after accumulating scrollback, it's possible in some cases for the terminal height to increase before refresh_scrollback is called via invalidation (especially when the terminal buffer isn't initially displayed in a window before nvim_open_term), which may crash. As we'll have enough room for some scrollback rows, just append them to the top of the buffer until it fills the window, then continue with the previous logic for any remaining scrollback rows if necessary.
* | refactor(misc1): move out high-level input functions to a new file: input.cBjörn Linse2021-12-10
| | | | | | | | | | Possibly dialog code is messages.c could be moved here as well. misc1.c is now empty, so delete it.
* | Merge pull request #16414 from zeertzjq/terminal-no-invalid-rowsJames McCoy2021-12-09
|\ \ | |/ |/| fix(terminal): return early if there are no invalid rows
| * fix(terminal): return early if there are no invalid rowszeertzjq2021-12-08
| | | | | | | | Prevent on_lines emitting out-of-bounds line indexes.
* | fix(terminal): use coladvance() to calculate buffer cursor positionzeertzjq2021-12-08
|/
* vim-patch:8.2.3609: internal error when ModeChanged is triggered recursivelyMagnus Groß2021-11-18
| | | | | | | | | | | | Problem: Internal error when ModeChanged is triggered when v:event is already in use. Solution: Save and restore v:event if needed. https://github.com/vim/vim/commit/3075a45592fe76f2febb6321632a23e352efe949 In the vim codebase there is no occurrence of get_vim_var_dict(VV_EVENT) after the above patch, so in order to hold the same invariant in the neovim codebase we needed to replace more occurrences than the related vim patch.
* feat: trigger ModeChanged for terminal modesMagnus Groß2021-11-18
|
* refactor: reduce number of explicit char casts (#16077)dundargoc2021-11-16
| | | * refactor: reduce number of explicit char casts
* fix(terminal): free terminal if close_buffer() closes a closed terminal (#16264)zeertzjq2021-11-10
| | | | | | | Use the (currently unused) 'destroy' field of the terminal struct as a flag to indicate that the terminal's destruction is imminent (and therefore it's close callback should not be called again). Co-authored-by: Gregory Anders <greg@gpanders.com>
* refactor: saner options for uncrustify #16196dundargoc2021-10-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * refactor: general good option changes sp_deref = remove sp_not = remove sp_inv = remove sp_inside_paren_cast = remove mod_remove_duplicate_include = true sp_after_semi = add sp_after_semi_for = force sp_sizeof_paren = remove nl_return_expr = remove nl_else_brace = remove nl_else_if = remove * refactor: mod_remove_extra_semicolon = true * refactor: nl_max = 3 * refactor: sp_bool = force * refactor: sp_compare = force * refactor: sp_inside_paren = remove * refactor: sp_paren_paren = remove * refactor: sp_inside_sparen = remove * refactor: sp_before_sparen = force * refactor: sp_sign = remove * refactor: sp_addr = remove * refactor: sp_member = remove * refactor: nl_struct_brace = remove * refactor: nl_before_if_closing_paren = remove * refactor: nl_fdef_brace = force * refactor: sp_paren_comma = force * refactor: mod_full_brace_do = add
* refactor: remove redundant castsDundar Göc2021-10-07
|
* fix: set cursorlineopt=number in terminal mode (#15493)Yorick Peterse2021-10-06
| | | | | | | | | | When entering terminal mode, cursorlineopt is no longer entirely disabled. Instead, it's set to `number`. Doing so ensures that users using `set cursorline` combined with `set cursorlineopt=number` have consistent highlighting of the line numbers, instead of this being disabled when entering terminal mode. Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com>
* refactor: format with uncrustify #15842dundargoc2021-10-02
| | | | * refactor: format with uncrustify * refactor: convert function comments to doxygen
* refactor(map): remove extra-allocating map_new/map_free functionsBjörn Linse2021-08-22
| | | | | | | | | | Note: the reason for removing them is not that there after this refactor is no use of them, but rather that having them available is an anti-pattern: they manange an _extra_ heap allocation which has nothing to do with the functionality of the map itself (khash manages the real buffers internally). In case there happens to be a reason to allocate the map structure itself later, this should be made explicit using xcalloc/xfree calls.
* refactor(api): remove unneccesary indirection around handlesBjörn Linse2021-08-22
| | | | | These things are just maps to pointers, no need to perform a huge song and dance around it.
* feat(terminal): TermClose: set exit code in v:event.status #15406Gregory Anders2021-08-20
| | | Closes #4713
* vim-patch:8.0.1309: cannot use 'balloonexpr' in a terminalJan Edmund Lazo2021-05-06
| | | | | | | Problem: Cannot use 'balloonexpr' in a terminal. Solution: Add 'balloonevalterm' and add code to handle mouse movements in a terminal. Initial implementation for Unix with GUI. https://github.com/vim/vim/commit/51b0f3701ecb440aa72ab6017c1df6940c0e0f6f
* Merge pull request #14027 from ↵Björn Linse2021-04-02
|\ | | | | | | | | dylanarmstrong/fix/13955-empty-paste-in-term-segfault fix: segfault when pasting in term with empty buffer
| * chore: move check for paste sizeDylan Armstrong2021-04-02
| |
* | api: allow open non-current buffer as terminal (+ xmas bonus)Björn Linse2021-03-12
| | | | | | | | vim.api.nvim_chan_send(vim.api.nvim_open_term(0), io.open("/path/to/smile.cat", "r"):read("*a"))
* | state: throttle batched event processing when input is availableBjörn Linse2021-03-08
|/ | | | | | | before, calling vim.schedule() from inside an event would execute the scheduled callback immediately after this event without checking for user input in between. Break event processing whenever user input or an interrupt is available.
* Add termpastefilter optionerw72021-02-04
| | | | | Change to specify a character to be filtered as an option when pasting on the terminal.
* Change to filter control characters when pasting a terminal windowerw72021-02-04
| | | | | | | Change to filter the following control characters in the same way as xterm. \x00-\x07, \x0b-\x0c, \x0e-\x1f
* Add support for bracketed paste mode in terminal windowserw72021-02-04
|
* api: add API for themesBjörn Linse2020-11-01
| | | | | | | | | | co-author: hlpr98 <hlpr98@gmail.com> (dict2hlattrs function) orange is sus?? NOVEMBER DAWN erase the lie that is redraw_later()
* terminal: fix terminal attribute overflowerw72020-07-29
| | | | fixes #11548
* terminal: preserve mode when using <Cmd>wincmd in terminal mode (#12254)Ghjuvan Lacambre2020-06-22
|
* terminal: disable 'scrolloff' (fixes flicker)Justin M. Keyes2020-05-04
| | | | | | | | | | Besides the special-case in get_scrolloff_value(), it makes sense for 'scrolloff' and 'sidescrolloff' to reflect the correct values (for plugins, scripts, …). ref 53d607af9c53accfd634435908fb79061f1212b9 ref #11915 ref #12230
* Merge #12155 ':ls filter by terminal, lastused'Justin M. Keyes2020-04-26
|\
| * vim-patch:8.0.1651: cannot filter :ls output for terminal buffersRob Pilling2020-04-19
| | | | | | | | | | | | Problem: Cannot filter :ls output for terminal buffers. Solution: Add flags for terminal buffers. (Marcin Szamotulski, closes vim/vim#2751) https://github.com/vim/vim/commit/0751f51a5b428805a8c1e9fe529693d032bec991
* | terminal: Fix mouse coordinates issue (#12158)erw72020-04-21
|/ | | | | | Offsets of window were not taken into account when sending mouse coordinates to the terminal. Therefore, when nu or rnu is set, the mouse coordinates sent to the terminal were not correct. Change it to send the correct coordinates by subtract window offset from col.
* terminal: preserve support for g:terminal_color_X = "#1234ab"Björn Linse2019-11-02
|
* terminal: enable pass through indexed colors to TUIBjörn Linse2019-11-02
|
* Remove "highbright bold" conversion. Fixes #11190Björn Linse2019-10-10
| | | | | | When using TUI host terminal should take care of this (regardless if 'termguicolors' is active or not). For GUI the behavior doesn't make sense (GUI should display bold attr as bold always).
* autocmds: TermEnter, TermLeave #8550Usama Hameed2019-09-14
| | | fix #8428
* syntax, TUI: support "strikethrough"Jaskaran Singh2019-09-13
| | | | | | fix #3436 Includes: vim-patch:8.0.1038: strike-through text not supported
* terminal: fix rgb rendering of palette colorsBjörn Linse2019-09-10
| | | | | | | | | | simplify handling of default colors nvim is always true color internally, remove ui_rgb_attached() check. Fix "runtime termguicolors" test. The test actually reflected broken behavior in (parent) nvim: nvim_ui_set_option("rgb", true) was not respected by existing :terminal instances, so all 16-palette colors became dark blue.
* lint / test groupingDaniel Hahler2019-09-10
|
* Changes for new VTermColor structPaul "LeoNerd" Evans2019-09-10
|
* paste: WIP #4448Justin M. Keyes2019-08-27
|
* ui: transmit "blend=" property of highlight attributesBjörn Linse2019-08-18
|