aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/move.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-04-19 18:56:51 +0200
committerGitHub <noreply@github.com>2022-04-19 18:56:51 +0200
commitdbc4af71861bf2d3bac6974a0bdb99b18a13666a (patch)
treee9baf3d0c05e38dacc5543c5187b1f6e88562790 /src/nvim/move.c
parent0124a7bfa9e27796e561cb0b3a045b9327bf7077 (diff)
parentb16afe4d556af7c3e86b311cfffd1c68a5eed71f (diff)
downloadrneovim-dbc4af71861bf2d3bac6974a0bdb99b18a13666a.tar.gz
rneovim-dbc4af71861bf2d3bac6974a0bdb99b18a13666a.tar.bz2
rneovim-dbc4af71861bf2d3bac6974a0bdb99b18a13666a.zip
Merge pull request #18081 from famiu/feat/highlight/cursearch
feat(highlight): implement CurSearch highlight
Diffstat (limited to 'src/nvim/move.c')
-rw-r--r--src/nvim/move.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c
index eda3298101..c55a9a296b 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -95,27 +95,31 @@ static void comp_botline(win_T *wp)
win_check_anchored_floats(wp);
}
-/// Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is set.
+/// Redraw when w_cline_row changes and 'relativenumber' or 'cursorline' is set
+/// or if the 'CurSearch' highlight is defined.
/// Also when concealing is on and 'concealcursor' is not active.
void redraw_for_cursorline(win_T *wp)
FUNC_ATTR_NONNULL_ALL
{
if ((wp->w_valid & VALID_CROW) == 0 && !pum_visible()
- && (wp->w_p_rnu || win_cursorline_standout(wp))) {
- // win_line() will redraw the number column and cursorline only.
+ && (wp->w_p_rnu || win_cursorline_standout(wp)
+ || HL_ATTR(HLF_LC) || wp->w_hl_ids[HLF_LC])) {
+ // win_line() will redraw the number column and cursorline only
+ // and also update the CurSearch highlight (if needed).
redraw_later(wp, VALID);
}
}
/// Redraw when w_virtcol changes and 'cursorcolumn' is set or 'cursorlineopt'
-/// contains "screenline".
+/// contains "screenline" or when the 'CurSearch' highlight is defined.
/// Also when concealing is on and 'concealcursor' is active.
static void redraw_for_cursorcolumn(win_T *wp)
FUNC_ATTR_NONNULL_ALL
{
if ((wp->w_valid & VALID_VIRTCOL) == 0 && !pum_visible()) {
- if (wp->w_p_cuc) {
- // When 'cursorcolumn' is set need to redraw with SOME_VALID.
+ if (wp->w_p_cuc || HL_ATTR(HLF_LC) || wp->w_hl_ids[HLF_LC]) {
+ // When 'cursorcolumn' is set or 'CurSearch' is defined
+ // need to redraw with SOME_VALID.
redraw_later(wp, SOME_VALID);
} else if (wp->w_p_cul && (wp->w_p_culopt_flags & CULOPT_SCRLINE)) {
// When 'cursorlineopt' contains "screenline" need to redraw with VALID.