mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Pass 'rl' option in "DrawCursor" message
This commit is contained in:
@@ -1484,15 +1484,8 @@ static NSString *MMSymlinkWarningString =
|
||||
// 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 ? curwin->w_p_rl : NO;
|
||||
#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]];
|
||||
|
||||
@@ -464,11 +464,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;
|
||||
int frac = ([ts cellSize].width * insertionPointFraction + 99)/100;
|
||||
ipRect.size.width = frac;
|
||||
} else if (MMInsertionPointVerticalRight == insertionPointShape) {
|
||||
int frac = ([ts cellSize].width * insertionPointFraction + 99)/100;
|
||||
ipRect.origin.x += ipRect.size.width - frac;
|
||||
ipRect.size.width = frac;
|
||||
}
|
||||
|
||||
|
||||
@@ -183,6 +183,7 @@ enum {
|
||||
MMInsertionPointHorizontal,
|
||||
MMInsertionPointVertical,
|
||||
MMInsertionPointHollow,
|
||||
MMInsertionPointVerticalRight,
|
||||
};
|
||||
|
||||
|
||||
|
||||
+15
-2
@@ -1073,11 +1073,24 @@ gui_mch_draw_part_cursor(int w, int h, guicolor_T color)
|
||||
// font dimensions. Thus these parameters are useless. Instead we look at
|
||||
// the shape_table to determine the shape and size of the cursor (just like
|
||||
// gui_update_cursor() does).
|
||||
|
||||
#ifdef FEAT_RIGHTLEFT
|
||||
// If 'rl' is set the insert mode cursor must be drawn on the right-hand
|
||||
// side of a text cell.
|
||||
int rl = curwin ? curwin->w_p_rl : FALSE;
|
||||
#else
|
||||
int rl = FALSE;
|
||||
#endif
|
||||
int idx = get_shape_idx(FALSE);
|
||||
int shape = MMInsertionPointBlock;
|
||||
switch (shape_table[idx].shape) {
|
||||
case SHAPE_HOR: shape = MMInsertionPointHorizontal; break;
|
||||
case SHAPE_VER: shape = MMInsertionPointVertical; break;
|
||||
case SHAPE_HOR:
|
||||
shape = MMInsertionPointHorizontal;
|
||||
break;
|
||||
case SHAPE_VER:
|
||||
shape = rl ? MMInsertionPointVerticalRight
|
||||
: MMInsertionPointVertical;
|
||||
break;
|
||||
}
|
||||
|
||||
return [[MMBackend sharedInstance]
|
||||
|
||||
Reference in New Issue
Block a user