Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Tab key will accept the current completion instead of just accepting …

…the first matching prefix
  • Loading branch information...
commit 1777e937d10e879be556d4f18542340910123709 1 parent fecf524
Jonathan Deutsch authored July 28, 2012
2  XCFixin_TabAcceptsCompletions/English.lproj/InfoPlist.strings
... ...
@@ -0,0 +1,2 @@
  1
+/* Localized versions of Info.plist keys */
  2
+
34  XCFixin_TabAcceptsCompletions/Info.plist
... ...
@@ -0,0 +1,34 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3
+<plist version="1.0">
  4
+<dict>
  5
+	<key>CFBundleDevelopmentRegion</key>
  6
+	<string>English</string>
  7
+	<key>CFBundleExecutable</key>
  8
+	<string>${EXECUTABLE_NAME}</string>
  9
+	<key>CFBundleIconFile</key>
  10
+	<string></string>
  11
+	<key>CFBundleIdentifier</key>
  12
+	<string>com.themha.${PRODUCT_NAME:rfc1034Identifier}</string>
  13
+	<key>CFBundleInfoDictionaryVersion</key>
  14
+	<string>6.0</string>
  15
+	<key>CFBundleName</key>
  16
+	<string>${PRODUCT_NAME}</string>
  17
+	<key>CFBundlePackageType</key>
  18
+	<string>BNDL</string>
  19
+	<key>CFBundleShortVersionString</key>
  20
+	<string>1.0</string>
  21
+	<key>CFBundleSignature</key>
  22
+	<string>????</string>
  23
+	<key>CFBundleVersion</key>
  24
+	<string>1</string>
  25
+	<key>NSPrincipalClass</key>
  26
+	<string>XCFixin_TabAcceptsCompletions</string>
  27
+	<key>XC4Compatible</key>
  28
+	<true/>
  29
+	<key>XCGCReady</key>
  30
+	<true/>
  31
+	<key>XCPluginHasUI</key>
  32
+	<false/>
  33
+</dict>
  34
+</plist>
29  XCFixin_TabAcceptsCompletions/XCFixin_TabAcceptsCompletions.m
... ...
@@ -0,0 +1,29 @@
  1
+#import <Cocoa/Cocoa.h>
  2
+#import <objc/runtime.h>
  3
+
  4
+#import "XCFixin.h"
  5
+
  6
+static IMP gOriginalInsertUsefulPrefix = nil;
  7
+
  8
+@interface XCFixin_TabAcceptsCompletions : NSObject
  9
+@end
  10
+
  11
+@implementation XCFixin_TabAcceptsCompletions
  12
+
  13
+static void overrideInsertUsefulPrefix(id self, SEL _cmd)
  14
+{
  15
+	[[[self performSelector:@selector(textView)] performSelector:@selector(completionController)] performSelector:@selector(acceptCurrentCompletion)];
  16
+}
  17
+
  18
++ (void)pluginDidLoad: (NSBundle *)plugin
  19
+{
  20
+    XCFixinPreflight();
  21
+    
  22
+    /* Override -[DVTTextCompletionSession insertUsefulPrefix] */
  23
+    gOriginalInsertUsefulPrefix = XCFixinOverrideMethodString(@"DVTTextCompletionSession", @selector(insertUsefulPrefix), (IMP)&overrideInsertUsefulPrefix);
  24
+        XCFixinAssertOrPerform(gOriginalInsertUsefulPrefix, goto failed);
  25
+    
  26
+    XCFixinPostflight();
  27
+}
  28
+
  29
+@end
259  XCFixin_TabAcceptsCompletions/XCFixin_TabAcceptsCompletions.xcodeproj/project.pbxproj
... ...
@@ -0,0 +1,259 @@
  1
+// !$*UTF8*$!
  2
+{
  3
+	archiveVersion = 1;
  4
+	classes = {
  5
+	};
  6
+	objectVersion = 46;
  7
+	objects = {
  8
+
  9
+/* Begin PBXBuildFile section */
  10
+		5514A3FA1506CB8F00A8AD77 /* XCFixin.m in Sources */ = {isa = PBXBuildFile; fileRef = 5514A3F91506CB8F00A8AD77 /* XCFixin.m */; };
  11
+		55C015D212B7BC2500354E5C /* XCFixin_TabAcceptsCompletions.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C015D112B7BC2500354E5C /* XCFixin_TabAcceptsCompletions.m */; };
  12
+		8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; };
  13
+		8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; };
  14
+/* End PBXBuildFile section */
  15
+
  16
+/* Begin PBXFileReference section */
  17
+		089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
  18
+		1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
  19
+		5514A3F91506CB8F00A8AD77 /* XCFixin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XCFixin.m; path = "../Shared Code/XCFixin.m"; sourceTree = "<group>"; };
  20
+		5595EEEB150067CB00A30634 /* XCFixin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XCFixin.h; path = "../Shared Code/XCFixin.h"; sourceTree = "<group>"; };
  21
+		55C015D112B7BC2500354E5C /* XCFixin_TabAcceptsCompletions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCFixin_TabAcceptsCompletions.m; sourceTree = "<group>"; };
  22
+		8D5B49B6048680CD000E48DA /* XCFixin_TabAcceptsCompletions.xcplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XCFixin_TabAcceptsCompletions.xcplugin; sourceTree = BUILT_PRODUCTS_DIR; };
  23
+		8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
  24
+/* End PBXFileReference section */
  25
+
  26
+/* Begin PBXFrameworksBuildPhase section */
  27
+		8D5B49B3048680CD000E48DA /* Frameworks */ = {
  28
+			isa = PBXFrameworksBuildPhase;
  29
+			buildActionMask = 2147483647;
  30
+			files = (
  31
+				8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */,
  32
+			);
  33
+			runOnlyForDeploymentPostprocessing = 0;
  34
+		};
  35
+/* End PBXFrameworksBuildPhase section */
  36
+
  37
+/* Begin PBXGroup section */
  38
+		089C166AFE841209C02AAC07 /* XCFixin_DisableAnimations */ = {
  39
+			isa = PBXGroup;
  40
+			children = (
  41
+				08FB77AFFE84173DC02AAC07 /* Classes */,
  42
+				089C167CFE841241C02AAC07 /* Resources */,
  43
+				089C1671FE841209C02AAC07 /* Frameworks and Libraries */,
  44
+				19C28FB8FE9D52D311CA2CBB /* Products */,
  45
+			);
  46
+			name = XCFixin_DisableAnimations;
  47
+			sourceTree = "<group>";
  48
+		};
  49
+		089C1671FE841209C02AAC07 /* Frameworks and Libraries */ = {
  50
+			isa = PBXGroup;
  51
+			children = (
  52
+				1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */,
  53
+			);
  54
+			name = "Frameworks and Libraries";
  55
+			sourceTree = "<group>";
  56
+		};
  57
+		089C167CFE841241C02AAC07 /* Resources */ = {
  58
+			isa = PBXGroup;
  59
+			children = (
  60
+				8D5B49B7048680CD000E48DA /* Info.plist */,
  61
+				089C167DFE841241C02AAC07 /* InfoPlist.strings */,
  62
+			);
  63
+			name = Resources;
  64
+			sourceTree = "<group>";
  65
+		};
  66
+		08FB77AFFE84173DC02AAC07 /* Classes */ = {
  67
+			isa = PBXGroup;
  68
+			children = (
  69
+				5595EEEB150067CB00A30634 /* XCFixin.h */,
  70
+				5514A3F91506CB8F00A8AD77 /* XCFixin.m */,
  71
+				55C015D112B7BC2500354E5C /* XCFixin_TabAcceptsCompletions.m */,
  72
+			);
  73
+			name = Classes;
  74
+			sourceTree = "<group>";
  75
+		};
  76
+		1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */ = {
  77
+			isa = PBXGroup;
  78
+			children = (
  79
+				1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */,
  80
+			);
  81
+			name = "Linked Frameworks";
  82
+			sourceTree = "<group>";
  83
+		};
  84
+		19C28FB8FE9D52D311CA2CBB /* Products */ = {
  85
+			isa = PBXGroup;
  86
+			children = (
  87
+				8D5B49B6048680CD000E48DA /* XCFixin_TabAcceptsCompletions.xcplugin */,
  88
+			);
  89
+			name = Products;
  90
+			sourceTree = "<group>";
  91
+		};
  92
+/* End PBXGroup section */
  93
+
  94
+/* Begin PBXNativeTarget section */
  95
+		8D5B49AC048680CD000E48DA /* XCFixin_TabAcceptsCompletions */ = {
  96
+			isa = PBXNativeTarget;
  97
+			buildConfigurationList = 1DEB913A08733D840010E9CD /* Build configuration list for PBXNativeTarget "XCFixin_TabAcceptsCompletions" */;
  98
+			buildPhases = (
  99
+				8D5B49AF048680CD000E48DA /* Resources */,
  100
+				8D5B49B1048680CD000E48DA /* Sources */,
  101
+				8D5B49B3048680CD000E48DA /* Frameworks */,
  102
+			);
  103
+			buildRules = (
  104
+			);
  105
+			dependencies = (
  106
+			);
  107
+			name = XCFixin_TabAcceptsCompletions;
  108
+			productInstallPath = "$(HOME)/Library/Bundles";
  109
+			productName = XCFixin_DisableAnimations;
  110
+			productReference = 8D5B49B6048680CD000E48DA /* XCFixin_TabAcceptsCompletions.xcplugin */;
  111
+			productType = "com.apple.product-type.bundle";
  112
+		};
  113
+/* End PBXNativeTarget section */
  114
+
  115
+/* Begin PBXProject section */
  116
+		089C1669FE841209C02AAC07 /* Project object */ = {
  117
+			isa = PBXProject;
  118
+			attributes = {
  119
+				LastUpgradeCheck = 0410;
  120
+			};
  121
+			buildConfigurationList = 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "XCFixin_TabAcceptsCompletions" */;
  122
+			compatibilityVersion = "Xcode 3.2";
  123
+			developmentRegion = English;
  124
+			hasScannedForEncodings = 1;
  125
+			knownRegions = (
  126
+				English,
  127
+				Japanese,
  128
+				French,
  129
+				German,
  130
+			);
  131
+			mainGroup = 089C166AFE841209C02AAC07 /* XCFixin_DisableAnimations */;
  132
+			projectDirPath = "";
  133
+			projectRoot = "";
  134
+			targets = (
  135
+				8D5B49AC048680CD000E48DA /* XCFixin_TabAcceptsCompletions */,
  136
+			);
  137
+		};
  138
+/* End PBXProject section */
  139
+
  140
+/* Begin PBXResourcesBuildPhase section */
  141
+		8D5B49AF048680CD000E48DA /* Resources */ = {
  142
+			isa = PBXResourcesBuildPhase;
  143
+			buildActionMask = 2147483647;
  144
+			files = (
  145
+				8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */,
  146
+			);
  147
+			runOnlyForDeploymentPostprocessing = 0;
  148
+		};
  149
+/* End PBXResourcesBuildPhase section */
  150
+
  151
+/* Begin PBXSourcesBuildPhase section */
  152
+		8D5B49B1048680CD000E48DA /* Sources */ = {
  153
+			isa = PBXSourcesBuildPhase;
  154
+			buildActionMask = 2147483647;
  155
+			files = (
  156
+				55C015D212B7BC2500354E5C /* XCFixin_TabAcceptsCompletions.m in Sources */,
  157
+				5514A3FA1506CB8F00A8AD77 /* XCFixin.m in Sources */,
  158
+			);
  159
+			runOnlyForDeploymentPostprocessing = 0;
  160
+		};
  161
+/* End PBXSourcesBuildPhase section */
  162
+
  163
+/* Begin PBXVariantGroup section */
  164
+		089C167DFE841241C02AAC07 /* InfoPlist.strings */ = {
  165
+			isa = PBXVariantGroup;
  166
+			children = (
  167
+				089C167EFE841241C02AAC07 /* English */,
  168
+			);
  169
+			name = InfoPlist.strings;
  170
+			sourceTree = "<group>";
  171
+		};
  172
+/* End PBXVariantGroup section */
  173
+
  174
+/* Begin XCBuildConfiguration section */
  175
+		1DEB913B08733D840010E9CD /* Debug */ = {
  176
+			isa = XCBuildConfiguration;
  177
+			buildSettings = {
  178
+				ALWAYS_SEARCH_USER_PATHS = NO;
  179
+				DEPLOYMENT_LOCATION = YES;
  180
+				DEPLOYMENT_POSTPROCESSING = YES;
  181
+				DSTROOT = "$(HOME)";
  182
+				GCC_ENABLE_OBJC_GC = supported;
  183
+				INFOPLIST_FILE = Info.plist;
  184
+				INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins";
  185
+				LD_RUNPATH_SEARCH_PATHS = /Developer;
  186
+				PRODUCT_NAME = XCFixin_TabAcceptsCompletions;
  187
+				STRIP_INSTALLED_PRODUCT = YES;
  188
+				VALID_ARCHS = "i386 x86_64";
  189
+				WRAPPER_EXTENSION = xcplugin;
  190
+			};
  191
+			name = Debug;
  192
+		};
  193
+		1DEB913C08733D840010E9CD /* Release */ = {
  194
+			isa = XCBuildConfiguration;
  195
+			buildSettings = {
  196
+				ALWAYS_SEARCH_USER_PATHS = NO;
  197
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
  198
+				DEPLOYMENT_LOCATION = YES;
  199
+				DEPLOYMENT_POSTPROCESSING = YES;
  200
+				DSTROOT = "$(HOME)";
  201
+				GCC_ENABLE_OBJC_GC = supported;
  202
+				INFOPLIST_FILE = Info.plist;
  203
+				INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins";
  204
+				LD_RUNPATH_SEARCH_PATHS = /Developer;
  205
+				PRODUCT_NAME = XCFixin_TabAcceptsCompletions;
  206
+				STRIP_INSTALLED_PRODUCT = YES;
  207
+				VALID_ARCHS = "i386 x86_64";
  208
+				WRAPPER_EXTENSION = xcplugin;
  209
+			};
  210
+			name = Release;
  211
+		};
  212
+		1DEB913F08733D840010E9CD /* Debug */ = {
  213
+			isa = XCBuildConfiguration;
  214
+			buildSettings = {
  215
+				ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
  216
+				COPY_PHASE_STRIP = NO;
  217
+				GCC_C_LANGUAGE_STANDARD = gnu99;
  218
+				GCC_OPTIMIZATION_LEVEL = 0;
  219
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
  220
+				GCC_WARN_UNUSED_VARIABLE = YES;
  221
+			};
  222
+			name = Debug;
  223
+		};
  224
+		1DEB914008733D840010E9CD /* Release */ = {
  225
+			isa = XCBuildConfiguration;
  226
+			buildSettings = {
  227
+				ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
  228
+				COPY_PHASE_STRIP = NO;
  229
+				GCC_C_LANGUAGE_STANDARD = gnu99;
  230
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
  231
+				GCC_WARN_UNUSED_VARIABLE = YES;
  232
+			};
  233
+			name = Release;
  234
+		};
  235
+/* End XCBuildConfiguration section */
  236
+
  237
+/* Begin XCConfigurationList section */
  238
+		1DEB913A08733D840010E9CD /* Build configuration list for PBXNativeTarget "XCFixin_TabAcceptsCompletions" */ = {
  239
+			isa = XCConfigurationList;
  240
+			buildConfigurations = (
  241
+				1DEB913B08733D840010E9CD /* Debug */,
  242
+				1DEB913C08733D840010E9CD /* Release */,
  243
+			);
  244
+			defaultConfigurationIsVisible = 0;
  245
+			defaultConfigurationName = Release;
  246
+		};
  247
+		1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "XCFixin_TabAcceptsCompletions" */ = {
  248
+			isa = XCConfigurationList;
  249
+			buildConfigurations = (
  250
+				1DEB913F08733D840010E9CD /* Debug */,
  251
+				1DEB914008733D840010E9CD /* Release */,
  252
+			);
  253
+			defaultConfigurationIsVisible = 0;
  254
+			defaultConfigurationName = Release;
  255
+		};
  256
+/* End XCConfigurationList section */
  257
+	};
  258
+	rootObject = 089C1669FE841209C02AAC07 /* Project object */;
  259
+}
7  ...bAcceptsCompletions/XCFixin_TabAcceptsCompletions.xcodeproj/project.xcworkspace/contents.xcworkspacedata
... ...
@@ -0,0 +1,7 @@
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<Workspace
  3
+   version = "1.0">
  4
+   <FileRef
  5
+      location = "self:XCFixin_TabAcceptsCompletions.xcodeproj">
  6
+   </FileRef>
  7
+</Workspace>
3  XCFixins.xcworkspace/contents.xcworkspacedata
@@ -25,4 +25,7 @@
25 25
    <FileRef
26 26
       location = "group:XCFixin_UserScripts/XCFixin_UserScripts.xcodeproj">
27 27
    </FileRef>
  28
+   <FileRef
  29
+      location = "group:XCFixin_TabAcceptsCompletions/XCFixin_TabAcceptsCompletions.xcodeproj">
  30
+   </FileRef>
28 31
 </Workspace>

0 notes on commit 1777e93

Please sign in to comment.
Something went wrong with that request. Please try again.