Revision: 15732
          http://sourceforge.net/p/skim-app/code/15732
Author:   hofman
Date:     2025-10-30 10:27:01 +0000 (Thu, 30 Oct 2025)
Log Message:
-----------
allow typing a space when in the middle of type select, don't scroll or 
quicklook in this case

Modified Paths:
--------------
    trunk/SKOutlineView.m
    trunk/SKTableView.m
    trunk/SKTypeSelectHelper.h
    trunk/SKTypeSelectHelper.m

Modified: trunk/SKOutlineView.m
===================================================================
--- trunk/SKOutlineView.m       2025-10-29 15:40:53 UTC (rev 15731)
+++ trunk/SKOutlineView.m       2025-10-30 10:27:01 UTC (rev 15732)
@@ -111,7 +111,7 @@
     if ((eventChar == NSNewlineCharacter || eventChar == NSEnterCharacter || 
eventChar == NSCarriageReturnCharacter) && modifierFlags == 0) {
         if ([self doubleAction] == NULL || [self sendAction:[self 
doubleAction] to:[self target]] == NO)
             NSBeep();
-    } else if ((eventChar == SKSpaceCharacter) && modifierFlags == 0) {
+    } else if ((eventChar == SKSpaceCharacter) && modifierFlags == 0 && 
[typeSelectHelper isProcessing] == NO) {
         if (supportsQuickLook == NO)
             [[self enclosingScrollView] pageDown:nil];
         else if ([QLPreviewPanel sharedPreviewPanelExists] && [[QLPreviewPanel 
sharedPreviewPanel] isVisible])

Modified: trunk/SKTableView.m
===================================================================
--- trunk/SKTableView.m 2025-10-29 15:40:53 UTC (rev 15731)
+++ trunk/SKTableView.m 2025-10-30 10:27:01 UTC (rev 15732)
@@ -91,7 +91,7 @@
             NSBeep();
     } else if ((eventChar == NSDeleteCharacter || eventChar == 
NSDeleteFunctionKey) && modifierFlags == 0 && [self canDelete]) {
         [self delete:self];
-    } else if ((eventChar == SKSpaceCharacter) && modifierFlags == 0) {
+    } else if ((eventChar == SKSpaceCharacter) && modifierFlags == 0 && 
[typeSelectHelper isProcessing] == NO) {
         if (supportsQuickLook == NO)
             [[self enclosingScrollView] pageDown:nil];
         else if ([[self delegate] 
respondsToSelector:@selector(tableViewQuickLookPreviewItems:)])

Modified: trunk/SKTypeSelectHelper.h
===================================================================
--- trunk/SKTypeSelectHelper.h  2025-10-29 15:40:53 UTC (rev 15731)
+++ trunk/SKTypeSelectHelper.h  2025-10-30 10:27:01 UTC (rev 15732)
@@ -51,7 +51,7 @@
 @interface SKTypeSelectHelper : NSObject <NSTextViewDelegate> {
     __weak id <SKTypeSelectDelegate> delegate;
     SKTypeSelectMatchOption matchOption;
-    BOOL isProcessing;
+    BOOL processing;
     NSArray<NSString *> *searchCache;
     NSString *searchString;
     NSTimer *timer;
@@ -70,6 +70,8 @@
 
 - (BOOL)handleEvent:(NSEvent *)keyEvent;
 
+@property (readonly, getter=isProcessing) BOOL processing;
+
 @end
 
 

Modified: trunk/SKTypeSelectHelper.m
===================================================================
--- trunk/SKTypeSelectHelper.m  2025-10-29 15:40:53 UTC (rev 15731)
+++ trunk/SKTypeSelectHelper.m  2025-10-30 10:27:01 UTC (rev 15732)
@@ -69,6 +69,7 @@
 
 @implementation SKTypeSelectHelper
 
+@synthesize processing;
 @dynamic delegate, matchOption;
 
 static NSCharacterSet *nonAlphanumericCharacterSet = nil;
@@ -93,7 +94,7 @@
         searchCache = nil;
         searchString = nil;
         matchOption = aMatchOption;
-        isProcessing = NO;
+        processing = NO;
         timer = nil;
         observedWindow = nil;
     }
@@ -173,7 +174,7 @@
 - (void)searchWithEvent:(NSEvent *)keyEvent {
     NSTextView *editor = [self editor];
     
-    if (isProcessing == NO) {
+    if (processing == NO) {
         [[NSNotificationCenter defaultCenter] removeObserver:self];
         if ([[NSApp keyWindow] isSheet])
             [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(typeSelectCleanTimeout:) 
name:NSWindowDidEndSheetNotification object:[NSApp keyWindow]];
@@ -210,9 +211,9 @@
     [self startTimerWithBlock:^(NSTimer *aTimer){ [weakSelf 
typeSelectSearchTimeout:aTimer]; }];
     
     if (matchOption != SKFullStringMatch)
-        [self searchWithStickyMatch:isProcessing];
+        [self searchWithStickyMatch:processing];
     
-    isProcessing = YES;
+    processing = YES;
 }
 
 - (void)repeatSearch {
@@ -224,7 +225,7 @@
     __weak SKTypeSelectHelper *weakSelf = self;
     [self startTimerWithBlock:^(NSTimer *aTimer){ [weakSelf 
typeSelectCleanTimeout:timer]; }];
     
-    isProcessing = NO;
+    processing = NO;
 }
 
 - (void)cancelSearch {
@@ -236,7 +237,7 @@
     if ([keyEvent deviceIndependentModifierFlags] & ~NSEventModifierFlagShift 
& ~NSEventModifierFlagOption & ~NSEventModifierFlagCapsLock & 
~NSEventModifierFlagNumericPad)
         return NO;
     
-    NSCharacterSet *invalidCharacters = isProcessing ? [NSCharacterSet 
controlCharacterSet] : nonAlphanumericCharacterSet;
+    NSCharacterSet *invalidCharacters = processing ? [NSCharacterSet 
controlCharacterSet] : nonAlphanumericCharacterSet;
     
     return [[keyEvent characters] 
rangeOfCharacterFromSet:invalidCharacters].location == NSNotFound;
 }
@@ -246,7 +247,7 @@
 }
 
 - (BOOL)isCancelEvent:(NSEvent *)keyEvent {
-    return isProcessing && [keyEvent deviceIndependentModifierFlags] == 0 && 
[keyEvent firstCharacter] == CANCEL_CHARACTER;
+    return processing && [keyEvent deviceIndependentModifierFlags] == 0 && 
[keyEvent firstCharacter] == CANCEL_CHARACTER;
 }
 
 // See 
http://www.mactech.com/articles/mactech/Vol.18/18.10/1810TableTechniques/index.html
@@ -285,7 +286,7 @@
     [self updateSearchString:nil];
     [[NSNotificationCenter defaultCenter] removeObserver:self];
     [self stopTimer];
-    isProcessing = NO;
+    processing = NO;
     
     NSText *editor = [self editor];
     if ([editor delegate] == self)

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to