diff options
author | ZyX <kp-pav@yandex.ru> | 2016-05-30 20:55:29 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2016-05-30 20:58:15 +0300 |
commit | 77540a04582927e842c7d5522bb862756da2cbba (patch) | |
tree | aa9f9ef561e5b2a165cb3e1c092b39be87973925 /src/nvim/terminal.c | |
parent | 748898b4dd992c5a5d15a0e1f9f047fc42ba4fd3 (diff) | |
download | rneovim-77540a04582927e842c7d5522bb862756da2cbba.tar.gz rneovim-77540a04582927e842c7d5522bb862756da2cbba.tar.bz2 rneovim-77540a04582927e842c7d5522bb862756da2cbba.zip |
*: Rename main loop variable from loop to main_loop
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.
Diffstat (limited to 'src/nvim/terminal.c')
-rw-r--r-- | src/nvim/terminal.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index 104cc47cda..df5e03880a 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -63,6 +63,7 @@ #include "nvim/map.h" #include "nvim/misc1.h" #include "nvim/move.h" +#include "nvim/main.h" #include "nvim/state.h" #include "nvim/ex_docmd.h" #include "nvim/ex_cmds.h" @@ -163,9 +164,9 @@ static VTermColor default_vt_bg_rgb; void terminal_init(void) { invalidated_terminals = pmap_new(ptr_t)(); - time_watcher_init(&loop, &refresh_timer, NULL); + time_watcher_init(&main_loop, &refresh_timer, NULL); // refresh_timer_cb will redraw the screen which can call vimscript - refresh_timer.events = queue_new_child(loop.events); + refresh_timer.events = queue_new_child(main_loop.events); // initialize a rgb->color index map for cterm attributes(VTermScreenCell // only has RGB information and we need color indexes for terminal UIs) @@ -452,7 +453,7 @@ static int terminal_execute(VimState *state, int key) case K_EVENT: // We cannot let an event free the terminal yet. It is still needed. s->term->refcount++; - queue_process_events(loop.events); + queue_process_events(main_loop.events); s->term->refcount--; if (s->term->buf_handle == 0) { s->close = true; |