| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,11 @@ | |||
| 1 | 1 | 1.1: (in progress) | |
| 2 | - * Added support for "textEncoding" option to set encoding, with default UTF-8. | ||
| 3 | - | ||
| 2 | + * Added support for "textEncoding" option to set encoding for highlight | ||
| 3 | + portion of renderer, with default UTF-8. | ||
| 4 | + * Added support for "webkitTextEncoding" option to set encoding for webkit | ||
| 5 | + portion of renderer, with default UTF-8. | ||
| 6 | + | ||
| 7 | + XXX: enabled plain-text handling! | ||
| 8 | + | ||
| 4 | 9 | 1.0: | |
| 5 | 10 | * Hopefully fixed the crasher bug by keeping us single-threaded | |
| 6 | 11 | * Added Actionscript, Lisp, IDL, Verilog, VHDL, XHTML (any others I forgot?) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -70,7 +70,8 @@ | |||
| 70 | 70 | @"ide-xcode", @"hlTheme", | |
| 71 | 71 | @"", @"extraHLFlags", | |
| 72 | 72 | @"", @"maxFileSize", | |
| 73 | - @"UTF-8", @"textEncoding", nil]]; | ||
| 73 | + @"UTF-8", @"textEncoding", | ||
| 74 | + @"UTF-8", @"webkitTextEncoding", nil]]; | ||
| 74 | 75 | [env addEntriesFromDictionary:[defaults persistentDomainForName:myDomain]]; | |
| 75 | 76 | ||
| 76 | 77 | NSString *cmd = [NSString stringWithFormat: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,20 +31,26 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview, | |||
| 31 | 31 | CFBundleRef bundle = QLPreviewRequestGetGeneratorBundle(preview); | |
| 32 | 32 | int status; | |
| 33 | 33 | NSData *output = colorizeURL(bundle, url, &status, 0); | |
| 34 | - n8log(@"Generated preview html page in %.3f sec", -[startDate timeIntervalSinceNow] ); | ||
| 34 | + n8log(@"Generated preview html page in %.3f sec", | ||
| 35 | + -[startDate timeIntervalSinceNow] ); | ||
| 35 | 36 | ||
| 36 | 37 | if (status != 0 || QLPreviewRequestIsCancelled(preview)) { | |
| 37 | 38 | #ifndef DEBUG | |
| 38 | 39 | goto done; | |
| 39 | 40 | #endif | |
| 40 | 41 | } | |
| 41 | 42 | // Now let WebKit do its thing | |
| 42 | - CFDictionaryRef emptydict = | ||
| 43 | - (CFDictionaryRef)[[[NSDictionary alloc] init] autorelease]; | ||
| 43 | + NSString *textEncoding = [[NSUserDefaults standardUserDefaults] | ||
| 44 | + stringForKey:@"webkitTextEncoding"]; | ||
| 45 | + if (!textEncoding || [textEncoding length] == 0) | ||
| 46 | + textEncoding = @"UTF-8"; | ||
| 47 | + CFDictionaryRef properties = | ||
| 48 | + (CFDictionaryRef)[NSDictionary dictionaryWithObject:textEncoding | ||
| 49 | + forKey:(NSString *)kQLPreviewPropertyTextEncodingNameKey]; | ||
| 44 | 50 | QLPreviewRequestSetDataRepresentation(preview, (CFDataRef)output, | |
| 45 | 51 | //kUTTypePlainText, | |
| 46 | 52 | kUTTypeHTML, | |
| 47 | - emptydict); | ||
| 53 | + properties); | ||
| 48 | 54 | ||
| 49 | 55 | done: | |
| 50 | 56 | n8log(@"Finished preview in %.3f sec", -[startDate timeIntervalSinceNow] ); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,6 +15,7 @@ | |||
| 15 | 15 | <string>public.xml</string> | |
| 16 | 16 | <string>com.apple.property-list</string> | |
| 17 | 17 | <string>org.tug.tex</string> | |
| 18 | + <string>public.plain-text</string> | ||
| 18 | 19 | </array> | |
| 19 | 20 | </dict> | |
| 20 | 21 | </array> | |
@@ -72,7 +73,7 @@ | |||
| 72 | 73 | a given file is "source-code". For things like .c and .m files that's | |
| 73 | 74 | not a problem; they're in the system already. But for .ml files | |
| 74 | 75 | we have to inform the system ourselves. If there is a file type that | |
| 75 | - is supported by pygments but this plugin is not being called to | ||
| 76 | + is supported by highlight but this plugin is not being called to | ||
| 76 | 77 | quicklook it, try adding a type identifier for it below. --> | |
| 77 | 78 | <key>UTImportedTypeDeclarations</key> | |
| 78 | 79 | <array> | |
@@ -231,6 +232,7 @@ | |||
| 231 | 232 | <key>public.filename-extension</key> | |
| 232 | 233 | <array> | |
| 233 | 234 | <string>erl</string> | |
| 235 | + <string>hrl</string> | ||
| 234 | 236 | </array> | |
| 235 | 237 | </dict> | |
| 236 | 238 | </dict> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -189,8 +189,8 @@ | |||
| 189 | 189 | children = ( | |
| 190 | 190 | 0EF57F2E0D128219006084D5 /* c.lang */, | |
| 191 | 191 | 0EF57F7D0D133C0F006084D5 /* css.lang */, | |
| 192 | - 0EF57D6D0D122934006084D5 /* objc.lang */, | ||
| 193 | 192 | 0EB4960D0D0FC24000E86E0B /* ml.lang */, | |
| 193 | + 0EF57D6D0D122934006084D5 /* objc.lang */, | ||
| 194 | 194 | 0EF57D430D122791006084D5 /* ide-xcode.style */, | |
| 195 | 195 | 0EF57E690D125AB2006084D5 /* slateGreen.style */, | |
| 196 | 196 | 0E913A090D10B8060067BAD6 /* filetypes.conf */, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,6 +13,7 @@ that could be useful: | |||
| 13 | 13 | ||
| 14 | 14 | Setting the text encoding (default is UTF-8): | |
| 15 | 15 | defaults write org.n8gray.QLColorCode textEncoding UTF-16 | |
| 16 | + defaults write org.n8gray.QLColorCode webkitTextEncoding UTF-16 | ||
| 16 | 17 | Setting the font: | |
| 17 | 18 | defaults write org.n8gray.QLColorCode font Monaco | |
| 18 | 19 | the font size: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments