aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/highlight.c20
-rw-r--r--src/nvim/highlight_defs.h6
-rw-r--r--src/nvim/misc1.c3
-rw-r--r--src/nvim/screen.c9
-rw-r--r--src/nvim/syntax.c1
-rw-r--r--src/nvim/terminal.c2
-rw-r--r--src/nvim/ui_bridge.c3
7 files changed, 36 insertions, 8 deletions
diff --git a/src/nvim/highlight.c b/src/nvim/highlight.c
index a104137d9e..89a41e73de 100644
--- a/src/nvim/highlight.c
+++ b/src/nvim/highlight.c
@@ -177,8 +177,26 @@ void update_window_hl(win_T *wp, bool invalid)
}
}
+/// Gets HL_UNDERLINE highlight.
+int hl_get_underline(void)
+{
+ return get_attr_entry((HlEntry){
+ .attr = (HlAttrs){
+ .cterm_ae_attr = (int16_t)HL_UNDERLINE,
+ .cterm_fg_color = 0,
+ .cterm_bg_color = 0,
+ .rgb_ae_attr = (int16_t)HL_UNDERLINE,
+ .rgb_fg_color = 0,
+ .rgb_bg_color = 0,
+ },
+ .kind = kHlUI,
+ .id1 = 0,
+ .id2 = 0,
+ });
+}
+
/// Get attribute code for forwarded :terminal highlights.
-int get_term_attr_entry(HlAttrs *aep)
+int hl_get_term_attr(HlAttrs *aep)
{
return get_attr_entry((HlEntry){ .attr= *aep, .kind = kHlTerminal,
.id1 = 0, .id2 = 0 });
diff --git a/src/nvim/highlight_defs.h b/src/nvim/highlight_defs.h
index 0790793c94..40025fcbbb 100644
--- a/src/nvim/highlight_defs.h
+++ b/src/nvim/highlight_defs.h
@@ -22,7 +22,7 @@ typedef enum {
/// Stores a complete highlighting entry, including colors and attributes
/// for both TUI and GUI.
typedef struct attr_entry {
- int16_t rgb_ae_attr, cterm_ae_attr; // HL_BOLD, etc.
+ int16_t rgb_ae_attr, cterm_ae_attr; ///< HlAttrFlags
RgbValue rgb_fg_color, rgb_bg_color, rgb_sp_color;
int cterm_fg_color, cterm_bg_color;
} HlAttrs;
@@ -83,8 +83,8 @@ typedef enum {
, HLF_TP // tabpage line
, HLF_TPS // tabpage line selected
, HLF_TPF // tabpage line filler
- , HLF_CUC // 'cursurcolumn'
- , HLF_CUL // 'cursurline'
+ , HLF_CUC // 'cursorcolumn'
+ , HLF_CUL // 'cursorline'
, HLF_MC // 'colorcolumn'
, HLF_QFL // selected quickfix line
, HLF_0 // Whitespace
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c
index 4032210213..d8730ea08a 100644
--- a/src/nvim/misc1.c
+++ b/src/nvim/misc1.c
@@ -52,6 +52,7 @@
#include "nvim/window.h"
#include "nvim/os/os.h"
#include "nvim/os/shell.h"
+#include "nvim/os/signal.h"
#include "nvim/os/input.h"
#include "nvim/os/time.h"
#include "nvim/event/stream.h"
@@ -2653,6 +2654,8 @@ void preserve_exit(void)
}
really_exiting = true;
+ // Ignore SIGHUP while we are already exiting. #9274
+ signal_reject_deadly();
mch_errmsg(IObuff);
mch_errmsg("\n");
ui_flush();
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index 1de5e5cc3d..eb24e2af1c 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -2826,7 +2826,7 @@ win_line (
draw_state = WL_BRI - 1;
}
- // draw 'breakindent': indent wrapped text accodringly
+ // draw 'breakindent': indent wrapped text accordingly
if (draw_state == WL_BRI - 1 && n_extra == 0) {
draw_state = WL_BRI;
// if need_showbreak is set, breakindent also applies
@@ -3052,8 +3052,13 @@ win_line (
diff_hlf = HLF_CHD; // changed line
}
line_attr = win_hl_attr(wp, diff_hlf);
+ // Overlay CursorLine onto diff-mode highlight.
if (wp->w_p_cul && lnum == wp->w_cursor.lnum) {
- line_attr = hl_combine_attr(line_attr, win_hl_attr(wp, HLF_CUL));
+ line_attr = 0 != line_attr_lowprio // Low-priority CursorLine
+ ? hl_combine_attr(hl_combine_attr(win_hl_attr(wp, HLF_CUL),
+ line_attr),
+ hl_get_underline())
+ : hl_combine_attr(line_attr, win_hl_attr(wp, HLF_CUL));
}
}
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 22eabc75c1..2cade9f281 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -61,6 +61,7 @@ struct hl_group {
scid_T sg_scriptID; ///< script in which the group was last set
// for terminal UIs
int sg_cterm; ///< "cterm=" highlighting attr
+ ///< (combination of \ref HlAttrFlags)
int sg_cterm_fg; ///< terminal fg color number + 1
int sg_cterm_bg; ///< terminal bg color number + 1
bool sg_cterm_bold; ///< bold attr was set for light color
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c
index d831979022..07722c68ac 100644
--- a/src/nvim/terminal.c
+++ b/src/nvim/terminal.c
@@ -603,7 +603,7 @@ void terminal_get_line_attributes(Terminal *term, win_T *wp, int linenr,
int attr_id = 0;
if (hl_attrs || vt_fg != -1 || vt_bg != -1) {
- attr_id = get_term_attr_entry(&(HlAttrs) {
+ attr_id = hl_get_term_attr(&(HlAttrs) {
.cterm_ae_attr = (int16_t)hl_attrs,
.cterm_fg_color = vt_fg_idx,
.cterm_bg_color = vt_bg_idx,
diff --git a/src/nvim/ui_bridge.c b/src/nvim/ui_bridge.c
index ebd4651f4d..bd5d37be73 100644
--- a/src/nvim/ui_bridge.c
+++ b/src/nvim/ui_bridge.c
@@ -104,7 +104,7 @@ static void ui_thread_run(void *data)
static void ui_bridge_stop(UI *b)
{
- // Detach brigde first, so that "stop" is the last event the TUI loop
+ // Detach bridge first, so that "stop" is the last event the TUI loop
// receives from the main thread. #8041
ui_detach_impl(b);
UIBridgeData *bridge = (UIBridgeData *)b;
@@ -117,6 +117,7 @@ static void ui_bridge_stop(UI *b)
if (stopped) { // -V547
break;
}
+ // TODO(justinmk): Remove this. Use a cond-wait above. #9274
loop_poll_events(&main_loop, 10); // Process one event.
}
uv_thread_join(&bridge->ui_thread);