mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Insert mode cursor respects 'rightleft' option
When 'rl' is enabled the insert mode cursor is drawn on the right-hand side of a cell.
This commit is contained in:
@@ -1569,8 +1569,16 @@ static NSString *MMSymlinkWarningString =
|
||||
// flushed (e.g. storing the currently selected text would be a bad idea).
|
||||
// We take this approach of "pushing" the state to MacVim to avoid having
|
||||
// to make synchronous calls from MacVim to Vim in order to get state.
|
||||
|
||||
#ifdef FEAT_RIGHTLEFT
|
||||
BOOL rightLeft = curwin->w_p_rl;
|
||||
#else
|
||||
BOOL rightLeft = NO;
|
||||
#endif
|
||||
|
||||
NSDictionary *vimState = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[[NSFileManager defaultManager] currentDirectoryPath], @"pwd",
|
||||
[NSNumber numberWithBool:rightLeft], @"w_p_rl",
|
||||
nil];
|
||||
|
||||
[self queueMessage:SetVimStateMsgID data:[vimState dictionaryAsData]];
|
||||
|
||||
@@ -469,7 +469,11 @@ enum {
|
||||
ipRect.origin.y += ipRect.size.height - frac;
|
||||
ipRect.size.height = frac;
|
||||
} else if (MMInsertionPointVertical == insertionPointShape) {
|
||||
BOOL rightLeft = [[[[self vimController] vimState]
|
||||
objectForKey:@"w_p_rl"] boolValue];
|
||||
int frac = ([ts cellSize].width* insertionPointFraction + 99)/100;
|
||||
if (rightLeft)
|
||||
ipRect.origin.x += ipRect.size.width - frac;
|
||||
ipRect.size.width = frac;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user