Pass 'rl' option in "DrawCursor" message

This commit is contained in:
Bjorn Winckler
2008-06-06 22:31:21 +02:00
parent 7752431b82
commit 1d83527039
4 changed files with 21 additions and 14 deletions
-7
View File
@@ -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]];
+5 -5
View File
@@ -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;
}
+1
View File
@@ -183,6 +183,7 @@ enum {
MMInsertionPointHorizontal,
MMInsertionPointVertical,
MMInsertionPointHollow,
MMInsertionPointVerticalRight,
};
+15 -2
View File
@@ -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]