| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
| |
Command "live preview" is fundamentally a non-recursive concept
("preview of a preview" is not useful). Maintaining this as a
global is less awkward and closer to what we actually want to
express, vs adorning exarg_T, CommandLineState, etc.
|
|
|
|
|
|
| |
References #5445
See https://github.com/neovim/neovim/pull/5445#issuecomment-252529766
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`lib/queue.h` implements a basic queue. `event/queue.c` implements
a specialized data structure on top of lib/queue.h; it is not a "normal"
queue.
Rename the specialized multi-level queue implemented in event/queue.c to
"multiqueue", to avoid confusion when reading the code.
Before this change one can eventually notice that "macros (uppercase
symbols) are for the normal queue, lowercase operations are for the
multi-level queue", but that is unnecessary friction for new developers
(or existing developers just visiting this part of the codebase).
|
| |
|
|
|
|
| |
also allow handle==0 meaning curbuf/curwin/curtab
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Factor out a helper function to set b:term_title, and call it during
terminal initialization as well, to set the initial title to the term://
URL.
This makes it much easier to use b:term_title in a statusline, with just
`setlocal statusline=%{b:term_title}`, rather than needing an expression
to handle the unset case.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Current name is inappropriate for the following reasons:
1. It is often masked by local `loop` variables.
2. It cannot be searched for. There are many `loop` variables where `loop` is
some local variable. There are many cases when “loop” word is used in
a comment.
3. It is in any case bad idea to use a generic name as a name of the global
variable. Best if global has module prefix: this is why it is in `main.h`:
`main_loop` both stands for “a main loop” and “a loop defined in `main.*`”.
Since I have no idea how to list every occurrence of this variable method used
to rename it is “remove it from globals.h, try to compile, fix errors”. Thus if
some occurrence was hidden under false `#if` branch it was not replaced.
|
|\
| |
| | |
Fix guessing incorrect color index in terminal
|
| |
| |
| |
| | |
This should fix issue #2323
|
| | |
|
|/ |
|
|\
| |
| | |
Adjust terminal text color if it is bold
|
| |
| |
| |
| | |
Now the terminal should also correctly output true color codes
|
|\ \
| | |
| | | |
Make TermClose event return the associated buffer
|
| |/
| |
| |
| |
| |
| |
| | |
<abuf> from the TermClose event now returns the correct buffer number.
Prior to this change it would always return the buffer number of the current
buffer, which is obviously wrong in an async environment.
|
|/ |
|
|
|
|
|
| |
process_interrupts() checks get_real_state() so we can avoid some
housekeeping of mapped_ctrl_c in terminal-mode.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vim-patch:7.4.569
vim-patch:7.4.573
Helped-by: @glts https://github.com/neovim/neovim/pull/2621
Problem: Having CTRL-C interrupt or not does not check the mode of the
mapping. (Ingo Karkat)
Solution: Use a bitmask with the map mode. (Christian Brabandt)
https://github.com/vim/vim/commit/651863c94a882a97aec7968fc87a638ff78e56ff
Problem: Mapping CTRL-C in Visual mode doesn't work. (Ingo Karkat)
Solution: Call get_real_state() instead of using State directly.
https://github.com/vim/vim/commit/5000869712f799d9ca25c0e45dc21d332edae5f4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Background: Vim internally prefers to represent ALT/META chords as
single-byte keys, by setting the high bit of the key byte.
extract_modifiers() _discards_ the meta/alt modifier, but we need it for
libvterm and libtermkey.
Closes #2440
Closes #3727
Closes #2017
References #2277
References #2254
https://github.com/neovim/neovim/issues/2017#issuecomment-140423557
> We [not libtermkey] are setting the high bit for some reason
https://github.com/neovim/neovim/issues/176#issuecomment-77834715
> libvtermkey requires the leading esc to parse alt/meta
https://github.com/neovim/neovim/pull/3246#issuecomment-136328450
> A program could do better than the current logic on some terminals, by
> asking for pure 8bit mode (S8C1T) and then immediately querying the
> mode again. If the result comes back as an 8bit single-byte CSI, then
> it can presume the mode setting was successful, and now the ESC prefix
> byte won't be seen in multibyte sequences; only as an Alt- prefix or
> a real Escape key. On such a terminal, it could therefore avoid
> needing to use that waiting timeout.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds switch cases for K_FOCUSGAINED and K_FOCUSLOST to the
input handling functions in ex_getln.c and terminal.c. The handling is
identical to what's found in edit.c (just calling apply_autocmds).
If one enters cmdline-mode by feeding `:` and sends a focuslost event (by
leaving the window for example) the text `<FocusLost>` will be inserted
into the command line. There is similar behaviour in terminal mode. This
patch corrects this behavior to fire the apropriate autocmd instead.
Fixes #3714
|
|
|
|
|
|
| |
- Create `TerminalState` structure containing data used in terminal mode
- Extract `terminal_execute` from `terminal_enter` and use it with
`state_enter`.
|
|
|
|
|
|
|
| |
Since vimscript can close buffers at any time, it is possible that a
refresh_timer_cb will be called with an invalid buffer, but there's no way to
detect this if only a reference is stored because the memory can be reused by
the allocator. Use buf_T->handle which is guaranteed to be unique.
|
|
|
|
| |
Close #3332
|
|
|
|
|
| |
It makes more sense to let the user application terminal emulator
decide how to render bold text.
|
|
|
|
|
| |
Since close_cb may free the terminal structure, save the "wipe" flag before
calling it.
|
|
|
|
|
|
|
| |
After @250aca4f8938 it is possible that terminal_close will be called without
invoking the close_cb(which normally destroys the terminal structure). If this
happens, the terminal buffer will already be deleted so there's no need to call
`bwipeout!`.
|
|
|
|
|
|
|
|
|
|
|
| |
It is possible for a processed event in the input loop of
terminal_enter() to destroy the terminal. But this is undetected by the
function and it still tries to use the freed terminal.
Use a reference count to delay the freeing of the terminal until
terminal_enter() returns.
Fixes #3112
|
|
|
|
|
|
|
|
|
|
| |
- Improve the implementation of deferred/immediate events.
- Use the new queue module to change how/when events are queued/processed by
giving a private queue to each emitter.
- Immediate events(which only exist to break uv_run recursion) are now
represented in the `loop->fast_events` queue.
- Events pushed to child queues are propagated to the event loop main queue and
processed as K_EVENT keys.
|
|
|
|
|
| |
When a terminal closed, make sure it is refreshed before the Terminal structure
is freed. Also extract `refresh_terminal` from `on_refresh`.
|
|
|
|
|
|
| |
- Declare poll timer in Loop structure instead of a loop_poll_events local
variable.
- Move deferred event management to input.c
|
|
|
|
|
|
|
|
|
|
| |
- Add event loop abstraction module under src/nvim/event. The
src/nvim/event/loop module replaces src/nvim/os/event
- Remove direct dependency on libuv signal/timer API and use the new abstraction
instead.
- Replace all references to uv_default_loop() by &loop.uv, a new global variable
that wraps libuv main event loop but allows the event loop functions to be
reused in other contexts.
|
|
|
|
|
| |
dict_set_value() returns the replaced Object in a dictionary. Here
the Object is unused and needs to be freed.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
We already use wrappers for allocation, the new `xfree` function is the
equivalent for deallocation and provides a way to fully replace the malloc
implementation used by Neovim.
|
|\
| |
| | |
[RFC] coverity/108870: Missing break in switch
|
| | |
|
|/
|
|
|
|
|
|
|
| |
The JobActivity event got replaced by callback functions provided to
jobstart() or termopen().
It got removed here:
https://github.com/neovim/neovim/commit/6e7757ad51dfe3b2de857ff8a8688718ff6115ac
|
|
|
|
| |
Signed-off-by: Michael Reed <m.reed@mykolab.com>
|
|
|
|
|
|
|
| |
These highlight groups replace the old mechanism of setting:
- {g,b}:terminal_focused_cursor_highlight
- {g,b}:terminal_unfocused_cursor_highlight
|
|\
| |
| | |
[RFC] terminal: Handle loss of focus in event loop.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The fallowing test (reduced), submitted by @mhinz may free term->buf,
leaving the pointer dangling.
```vim
let s:buf = -1
function! s:exit_handler()
execute 'bdelete!' s:buf
endfunction
vnew
let s:buf = bufnr('%')
let id = termopen('sleep 1', { 'on_exit': function('s:exit_handler') })
call s:test()
```
When the buffer is known to be closing, set term->buf to NULL, and check
buf_valid() in on_refresh().
Helped-by: Marco Hinz (@mhinz)
|
| |
| |
| |
| | |
fixes #2317
|
| |
| |
| |
| |
| |
| |
| |
| | |
Pressing <C-\> and then a mouse click will insert the click into the
terminal as if a keyboard button had been pressed.
Keep track of whether the last input was <C-\> and only call
terminal_send_key() if the next input is a key press.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
While in a terminal and insert mode, if an event caused loss of focus,
nvim would stay in the terminal event loop causing an inconsistent view
of internal state and/or segfault.
Remove the "term" argument from terminal_enter() as it only makes sense
to call it with curbuf->terminal. Terminate the loop when switched to a
different buffer.
fixes #2301
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem : Dead initialization @ 1119.
Diagnostic : Real issue.
Rationale : `obj` is immediately assigned another value through
GET_CONFIG_VALUE macro.
Resolution : Don't initialize.
Helped-by: oni-link <knil.ino@gmail.com>
|