Skip to content

Instantly share code, notes, and snippets.

@takkanm
Created October 26, 2011 08:52
Show Gist options
  • Select an option

  • Save takkanm/1315818 to your computer and use it in GitHub Desktop.

Select an option

Save takkanm/1315818 to your computer and use it in GitHub Desktop.
diff --git a/Headers/iTerm/PTYTextView.h b/Headers/iTerm/PTYTextView.h
index 54c192c..a75f0bc 100644
--- a/Headers/iTerm/PTYTextView.h
+++ b/Headers/iTerm/PTYTextView.h
@@ -100,6 +100,8 @@ typedef struct PTYFontInfo PTYFontInfo;
BOOL CURSOR;
BOOL colorInvertedCursor;
+ BOOL doCommandBySelectorCalled;
+
// geometry
double lineHeight;
double lineWidth;
diff --git a/PTYTextView.m b/PTYTextView.m
index 538eed9..40d787d 100644
--- a/PTYTextView.m
+++ b/PTYTextView.m
@@ -2188,6 +2188,9 @@ NSMutableArray* screens=0;
if (!workAroundControlBug) {
// Let the IME process key events
IM_INPUT_INSERT = NO;
+
+ doCommandBySelectorCalled = NO;
+
if (debugKeyDown) {
NSLog(@"PTYTextView keyDown send to IME");
}
@@ -2196,6 +2199,7 @@ NSMutableArray* screens=0;
// If the IME didn't want it, pass it on to the delegate
if (!prev &&
!IM_INPUT_INSERT &&
+ doCommandBySelectorCalled &&
![self hasMarkedText]) {
if (debugKeyDown) {
NSLog(@"PTYTextView keyDown IME no, send to delegate");
@@ -3848,6 +3852,7 @@ static double EuclideanDistance(NSPoint p1, NSPoint p2) {
/// NSTextInput stuff
- (void)doCommandBySelector:(SEL)aSelector
{
+ doCommandBySelectorCalled = YES;
//NSLog(@"doCommandBySelector:%@", NSStringFromSelector(aSelector));
#if GREED_KEYDOWN == 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment