Revision: 28870
          http://sourceforge.net/p/bibdesk/svn/28870
Author:   hofman
Date:     2024-04-27 09:25:34 +0000 (Sat, 27 Apr 2024)
Log Message:
-----------
standard word completion in title and chapter fields

Modified Paths:
--------------
    trunk/bibdesk/BDSKCompletionManager.m

Modified: trunk/bibdesk/BDSKCompletionManager.m
===================================================================
--- trunk/bibdesk/BDSKCompletionManager.m       2024-04-26 16:07:54 UTC (rev 
28869)
+++ trunk/bibdesk/BDSKCompletionManager.m       2024-04-27 09:25:34 UTC (rev 
28870)
@@ -50,10 +50,12 @@
 static id sharedManager = nil;
 
 static NSSet *completedFields = nil;
+static NSSet *titleFields = nil;
 
 + (void)initialize {
     BDSKINITIALIZE;
     completedFields = [[NSSet alloc] initWithObjects:BDSKBooktitleString, 
BDSKJournalString, BDSKInstitutionString, BDSKPublisherString, 
BDSKSchoolString, BDSKOrganizationString, BDSKAddressString, 
BDSKKeywordsString, BDSKCrossrefString, nil];
+    titleFields = [[NSSet alloc] initWithObjects:BDSKTitleString, 
BDSKChapterString, nil];
 }
 
 + (id)sharedManager {
@@ -195,6 +197,9 @@
 }
 
 - (NSRange)entry:(NSString *)entry rangeForUserCompletion:(NSRange)charRange 
ofString:(NSString *)fullString {
+    if ([titleFields containsObject:entry])
+        return charRange;
+    
     NSCharacterSet *wsCharSet = [NSCharacterSet whitespaceCharacterSet];
     NSCharacterSet *acSet = [[BDSKTypeManager sharedManager] 
separatorCharacterSetForField:entry];
 
@@ -234,7 +239,9 @@
                entry = BDSKAuthorString;
        else if ([entry isCitationField])
                entry = BDSKCrossrefString;
-       
+    else if ([titleFields containsObject:entry])
+        return words;
+
     NSSet *strings = [autoCompletionDict objectForKey:entry];
     
     if ([strings count] == 0)

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



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to