aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/match.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/match.c')
-rw-r--r--src/nvim/match.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/nvim/match.c b/src/nvim/match.c
index af89319a09..4129e84fc2 100644
--- a/src/nvim/match.c
+++ b/src/nvim/match.c
@@ -4,6 +4,7 @@
// match.c: functions for highlighting matches
#include <stdbool.h>
+#include "nvim/buffer_defs.h"
#include "nvim/charset.h"
#include "nvim/fold.h"
#include "nvim/highlight_group.h"
@@ -667,7 +668,16 @@ int update_search_hl(win_T *wp, linenr_T lnum, colnr_T col, char_u **line, match
if (shl->endcol < next_col) {
shl->endcol = next_col;
}
- shl->attr_cur = shl->attr;
+ // Use "CurSearch" highlight for current search match
+ if (shl == search_hl
+ && (HL_ATTR(HLF_LC) || wp->w_hl_ids[HLF_LC])
+ && wp->w_cursor.lnum == lnum
+ && wp->w_cursor.col >= shl->startcol
+ && wp->w_cursor.col < shl->endcol) {
+ shl->attr_cur = win_hl_attr(wp, HLF_LC) ? win_hl_attr(wp, HLF_LC) : HL_ATTR(HLF_LC);
+ } else {
+ shl->attr_cur = shl->attr;
+ }
// Match with the "Conceal" group results in hiding
// the match.
if (cur != NULL