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:
Bjorn Winckler
2008-05-28 21:16:27 +02:00
parent 8d051eef4e
commit defa7bd098
2 changed files with 12 additions and 0 deletions
+8
View File
@@ -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]];
+4
View File
@@ -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;
}