Put cursor back on cmdline after Cmd-=

Changing the font size up/down while the cursor was on the command line
would cause the cursor to jump away from the cmdline.  This is no longer
the case.  Also fixes a similar problem when showing/hiding the toolbar
by clicking the "pill button".
This commit is contained in:
Bjorn Winckler
2008-09-19 20:17:01 +02:00
parent 86ae8db7d6
commit 2a70805ffb
+19 -16
View File
@@ -63,6 +63,7 @@ vimmenu_T *menu_for_descriptor(NSArray *desc);
static id evalExprCocoa(NSString * expr, NSString ** errstr);
enum {
MMBlinkStateNone = 0,
MMBlinkStateOn,
@@ -107,6 +108,7 @@ static NSString *MMSymlinkWarningString =
- (BOOL)checkForModifiedBuffers;
- (void)addInput:(NSString *)input;
- (BOOL)unusedEditor;
- (void)redrawScreen;
@end
@@ -1991,13 +1993,7 @@ static NSString *MMSymlinkWarningString =
set_option_value((char_u*)"guioptions", 0, go, 0);
// Force screen redraw (does it have to be this complicated?).
redraw_all_later(CLEAR);
update_screen(NOT_VALID);
setcursor();
out_flush();
gui_update_cursor(FALSE, FALSE);
gui_mch_flush();
[self redrawScreen];
}
- (void)handleScrollbarEvent:(NSData *)data
@@ -2089,13 +2085,7 @@ static NSString *MMSymlinkWarningString =
CONVERT_FROM_UTF8_FREE(s);
#endif
// Force screen redraw (does it have to be this complicated?).
redraw_all_later(CLEAR);
update_screen(NOT_VALID);
setcursor();
out_flush();
gui_update_cursor(FALSE, FALSE);
gui_mch_flush();
[self redrawScreen];
}
- (void)handleDropFiles:(NSData *)data
@@ -2411,7 +2401,6 @@ static NSString *MMSymlinkWarningString =
maketitle();
flushDisabled = NO;
gui_mch_flush();
}
}
@@ -2504,6 +2493,21 @@ static NSString *MMSymlinkWarningString =
return onlyOneTab && oneWindowInTab && !bufChanged && !bufHasFilename;
}
- (void)redrawScreen
{
// Force screen redraw (does it have to be this complicated?).
redraw_all_later(CLEAR);
update_screen(NOT_VALID);
setcursor();
out_flush();
gui_update_cursor(FALSE, FALSE);
// HACK! The cursor is not put back at the command line by the above
// "redraw commands". The following test seems to do the trick though.
if (State & CMDLINE)
redrawcmdline();
}
@end // MMBackend (Private)
@@ -2847,7 +2851,6 @@ static id evalExprCocoa(NSString * expr, NSString ** errstr)
@implementation NSString (VimStrings)
+ (id)stringWithVimString:(char_u *)s