Merge remote-tracking branch 'refs/remotes/origin/master'
This commit is contained in:
@@ -73,7 +73,7 @@ index 7c1ee4c..4abeafe 100644
|
|||||||
|
|
||||||
|
|
||||||
diff --git a/src/nsterm.m b/src/nsterm.m
|
diff --git a/src/nsterm.m b/src/nsterm.m
|
||||||
index 932d209..e830f54 100644
|
index 932d209..792f7c5 100644
|
||||||
--- a/src/nsterm.m
|
--- a/src/nsterm.m
|
||||||
+++ b/src/nsterm.m
|
+++ b/src/nsterm.m
|
||||||
@@ -1104,6 +1104,11 @@ ns_update_end (struct frame *f)
|
@@ -1104,6 +1104,11 @@ ns_update_end (struct frame *f)
|
||||||
@@ -718,7 +718,7 @@ index 932d209..e830f54 100644
|
|||||||
+ BOOL markActive = !NILP (BVAR (b, mark_active));
|
+ BOOL markActive = !NILP (BVAR (b, mark_active));
|
||||||
+
|
+
|
||||||
+ /* --- Text changed → typing echo ---
|
+ /* --- Text changed → typing echo ---
|
||||||
+ kAXTextStateChangeTypeEdit = 0, kAXTextEditTypeTyping = 3. */
|
+ kAXTextStateChangeTypeEdit = 1, kAXTextEditTypeTyping = 3. */
|
||||||
+ if (modiff != self.cachedModiff)
|
+ if (modiff != self.cachedModiff)
|
||||||
+ {
|
+ {
|
||||||
+ /* Capture changed char before invalidating cache. */
|
+ /* Capture changed char before invalidating cache. */
|
||||||
@@ -750,7 +750,7 @@ index 932d209..e830f54 100644
|
|||||||
+ @"AXTextChangeValueLength": @([changedChar length])
|
+ @"AXTextChangeValueLength": @([changedChar length])
|
||||||
+ };
|
+ };
|
||||||
+ NSDictionary *userInfo = @{
|
+ NSDictionary *userInfo = @{
|
||||||
+ @"AXTextStateChangeType": @0,
|
+ @"AXTextStateChangeType": @1,
|
||||||
+ @"AXTextChangeValues": @[change]
|
+ @"AXTextChangeValues": @[change]
|
||||||
+ };
|
+ };
|
||||||
+ NSAccessibilityPostNotificationWithUserInfo (
|
+ NSAccessibilityPostNotificationWithUserInfo (
|
||||||
@@ -758,30 +758,30 @@ index 932d209..e830f54 100644
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ /* --- Cursor moved or selection changed → line reading ---
|
+ /* --- Cursor moved or selection changed → line reading ---
|
||||||
+ kAXTextStateChangeTypeSelectionMove = 1. */
|
+ kAXTextStateChangeTypeSelectionMove = 2. */
|
||||||
+ if (point != self.cachedPoint || markActive != self.cachedMarkActive)
|
+ if (point != self.cachedPoint || markActive != self.cachedMarkActive)
|
||||||
+ {
|
+ {
|
||||||
+ ptrdiff_t oldPoint = self.cachedPoint;
|
+ ptrdiff_t oldPoint = self.cachedPoint;
|
||||||
+ self.cachedPoint = point;
|
+ self.cachedPoint = point;
|
||||||
+ self.cachedMarkActive = markActive;
|
+ self.cachedMarkActive = markActive;
|
||||||
+
|
+
|
||||||
+ /* Compute direction: 2=Previous, 3=Next, 4=Discontiguous. */
|
+ /* Compute direction: 3=Previous, 4=Next, 5=Discontiguous. */
|
||||||
+ NSInteger direction = 4;
|
+ NSInteger direction = 5;
|
||||||
+ if (point > oldPoint)
|
+ if (point > oldPoint)
|
||||||
+ direction = 3;
|
+ direction = 4;
|
||||||
+ else if (point < oldPoint)
|
+ else if (point < oldPoint)
|
||||||
+ direction = 2;
|
+ direction = 3;
|
||||||
+
|
+
|
||||||
+ /* Compute granularity from movement distance.
|
+ /* Compute granularity from movement distance.
|
||||||
+ Check if we crossed a newline → line movement (2).
|
+ Check if we crossed a newline → line movement (3).
|
||||||
+ Otherwise single char (0) or discontiguous (5=unknown). */
|
+ Otherwise single char (1) or unknown (0). */
|
||||||
+ NSInteger granularity = 5;
|
+ NSInteger granularity = 0;
|
||||||
+ [self ensureTextCache];
|
+ [self ensureTextCache];
|
||||||
+ if (cachedText && oldPoint > 0)
|
+ if (cachedText && oldPoint > 0)
|
||||||
+ {
|
+ {
|
||||||
+ ptrdiff_t delta = point - oldPoint;
|
+ ptrdiff_t delta = point - oldPoint;
|
||||||
+ if (delta == 1 || delta == -1)
|
+ if (delta == 1 || delta == -1)
|
||||||
+ granularity = 0; /* Character. */
|
+ granularity = 1; /* Character. */
|
||||||
+ else
|
+ else
|
||||||
+ {
|
+ {
|
||||||
+ /* Check for line crossing by looking for newlines
|
+ /* Check for line crossing by looking for newlines
|
||||||
@@ -798,13 +798,13 @@ index 932d209..e830f54 100644
|
|||||||
+ options:0
|
+ options:0
|
||||||
+ range:searchRange];
|
+ range:searchRange];
|
||||||
+ if (nl.location != NSNotFound)
|
+ if (nl.location != NSNotFound)
|
||||||
+ granularity = 2; /* Line. */
|
+ granularity = 3; /* Line. */
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ NSDictionary *moveInfo = @{
|
+ NSDictionary *moveInfo = @{
|
||||||
+ @"AXTextStateChangeType": @1,
|
+ @"AXTextStateChangeType": @2,
|
||||||
+ @"AXTextSelectionDirection": @(direction),
|
+ @"AXTextSelectionDirection": @(direction),
|
||||||
+ @"AXTextSelectionGranularity": @(granularity)
|
+ @"AXTextSelectionGranularity": @(granularity)
|
||||||
+ };
|
+ };
|
||||||
|
|||||||
Reference in New Issue
Block a user