From d0a2ddaa0454f6ea00d4c151ce9c1c15a3d84014 Mon Sep 17 00:00:00 2001 From: Yunchi Luo <mightyguava@gmail.com> Date: Wed, 31 Dec 2014 23:21:33 -0500 Subject: [PATCH] [vim] Enable clearing search scrollbar annotation https://github.com/codemirror/CodeMirror/issues/3012 --- keymap/vim.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/keymap/vim.js b/keymap/vim.js index 78046f59f..913e3a63f 100644 --- a/keymap/vim.js +++ b/keymap/vim.js @@ -3792,8 +3792,13 @@ }); } function clearSearchHighlight(cm) { + var state = getSearchState(cm); cm.removeOverlay(getSearchState(cm).getOverlay()); - getSearchState(cm).setOverlay(null); + state.setOverlay(null); + if (state.getScrollbarAnnotate()) { + state.getScrollbarAnnotate().clear(); + state.setScrollbarAnnotate(null); + } } /** * Check if pos is in the specified range, INCLUSIVE. -- GitLab