Open josh-nz opened 10 years ago
Unfortunately there is no way other than set nohls
.
:noh
is not supporeted now.
Ok, thanks for the reply.
Here's a simple patch for this issue:
diff --git a/XVim/XVimExCommand.m b/XVim/XVimExCommand.m
index 0dce310..a2f2d58 100644
--- a/XVim/XVimExCommand.m
+++ b/XVim/XVimExCommand.m
@@ -1014,6 +1014,12 @@ - (void)ncounterpart:(XVimExArg*)args inWindow:(XVimWindow*)window{
[NSApp sendAction:@selector(jumpToNextCounterpart:) to:nil from:self];
}
+- (void)nohlsearch:(XVimExArg*)args inWindow:(XVimWindow*)window{
+ NSTextView* view = [window sourceView];
+ [view setNeedsUpdateFoundRanges:YES];
+ [view xvim_clearHighlightText];
+}
+
- (void)nissue:(XVimExArg*)args inWindow:(XVimWindow*)window{
[NSApp sendAction:@selector(jumpToNextIssue:) to:nil from:self];
}
In vim I use :let @/=""
to clear the search. This would be a great option for XVim, but I could see this requiring some work.
I have set hlsearch on because I like the behaviour of it. I used it today in xvim for the first time and it works great, but I'm unable to find a way to 'cancel' or reset the search such that when I'm done, my search results are no longer highlighted. I've tried the various methods suggested here:
http://stackoverflow.com/questions/657447/vim-clear-last-search-highlighting
but so far the only way I've found is by running :set nohlsearch which then disables it so that subsequent searches are not highlighted.
Is there some other way I can cancel the highlighting, or will I need to bind some keys to turn hlsearch on and off to achieve this, (which will be annoying)?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.