Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Documents/Users/FeatureList.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ Examples:
[no]relativenumber |
[no]alwaysuseinputsource | With this option all the input is first sent to input source of the system. If you are using France, Portugese or Swedish keyboard consider turning this on. When enabling this, also consider running `defaults write com.apple.dt.Xcode ApplePressAndHoldEnabled -bool false` to disable the press and hold character menu in recent OS X releases. (See issue https://github.com/JugglerShu/XVim/issues/598).
[no]blinkcursor |
[no]blockcursor | Tells XVim to use a block cursor when in insert mode. Defaults to off.
[no]startofline | Tells XVim to move the cursor to the first non-blank of the line when using jump commands (`gg, G` etc). Defaults to on.


Expand Down
15 changes: 9 additions & 6 deletions XVim/DVTSourceTextView+XVim.m
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ - (void)xvim_keyDown:(NSEvent *)theEvent{
}@catch (NSException* exception) {
ERROR_LOG(@"Exception %@: %@", [exception name], [exception reason]);
[Logger logStackTrace:exception];
// For debugging purpose we rethrow the exception
if( [XVim instance].options.debug ){
@throw exception;
}
// For debugging purpose we rethrow the exception
if( [XVim instance].options.debug ){
@throw exception;
}
}
return;
}
Expand Down Expand Up @@ -197,7 +197,10 @@ - (void)xvim__drawInsertionPointInRect:(NSRect)aRect color:(NSColor*)aColor{
// TRACE_LOG(@"%f %f %f %f", aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height);
@try{
XVimWindow* window = [self xvim_window];
if( [[[window currentEvaluator] class] isSubclassOfClass:[XVimInsertEvaluator class]]){

// Only execute this code if we do NOT want a blockcursor
if( ![[[XVim instance] options] blockcursor] &&
[[[window currentEvaluator] class] isSubclassOfClass:[XVimInsertEvaluator class]] ){
// Use original behavior when insert mode.
return [self xvim__drawInsertionPointInRect:aRect color:aColor];
}
Expand Down Expand Up @@ -300,7 +303,7 @@ - (void)xvim_viewDidMoveToSuperview {
}

- (void)xvim_observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
if([keyPath isEqualToString:@"ignorecase"] || [keyPath isEqualToString:@"hlsearch"] || [keyPath isEqualToString:@"lastSearchString"] || [keyPath isEqualToString:@"highlight"]){
if([keyPath isEqualToString:@"ignorecase"] || [keyPath isEqualToString:@"hlsearch"] || [keyPath isEqualToString:@"lastSearchString"] || [keyPath isEqualToString:@"highlight"]){
[self setNeedsUpdateFoundRanges:YES];
[self setNeedsDisplayInRect:[self visibleRect] avoidAdditionalLayout:YES];
}
Expand Down
1 change: 1 addition & 0 deletions XVim/XVimOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
@property BOOL relativenumber;
@property BOOL alwaysuseinputsource; //XVim original
@property BOOL blinkcursor;
@property BOOL blockcursor;
@property BOOL startofline;
@property BOOL expandtab;
@property (nonatomic, strong) NSDictionary* highlight;
Expand Down
10 changes: 6 additions & 4 deletions XVim/XVimOptions.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ - (id)init{
@"relativenumber", @"rn",
@"alwaysuseinputsource", @"auis",
@"blinkcursor", @"bc",
@"blockcursor", @"blockc",
@"startofline", @"sol",
@"expandtab", @"et",
@"highlight", @"hi",
Expand All @@ -49,10 +50,10 @@ - (id)init{
_wrapscan = YES;
_errorbells = NO;
_incsearch = YES;
_gdefault = NO;
_smartcase = NO;
_clipboard = @"";
_guioptions = @"rb";
_gdefault = NO;
_smartcase = NO;
_clipboard = @"";
_guioptions = @"rb";
_timeoutlen = @"1000";
_laststatus = 2;
_hlsearch = NO;
Expand All @@ -61,6 +62,7 @@ - (id)init{
_relativenumber = NO;
_alwaysuseinputsource = NO;
_blinkcursor = NO;
_blockcursor = NO;
_startofline = YES;
_expandtab = YES;
self.highlight = @{@"Search": @{
Expand Down