diff --git a/src/MacVim/MMBackend.m b/src/MacVim/MMBackend.m index a22419236b..791b29fb66 100644 --- a/src/MacVim/MMBackend.m +++ b/src/MacVim/MMBackend.m @@ -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]]; diff --git a/src/MacVim/MMTextView.m b/src/MacVim/MMTextView.m index c61ef0eef3..7272657db8 100644 --- a/src/MacVim/MMTextView.m +++ b/src/MacVim/MMTextView.m @@ -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; } diff --git a/src/MacVim/MacVim.h b/src/MacVim/MacVim.h index eb94dd9cbd..be02e79484 100644 --- a/src/MacVim/MacVim.h +++ b/src/MacVim/MacVim.h @@ -183,6 +183,7 @@ enum { MMInsertionPointHorizontal, MMInsertionPointVertical, MMInsertionPointHollow, + MMInsertionPointVerticalRight, }; diff --git a/src/MacVim/gui_macvim.m b/src/MacVim/gui_macvim.m index 382946d6d4..16db6b7464 100644 --- a/src/MacVim/gui_macvim.m +++ b/src/MacVim/gui_macvim.m @@ -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]