cseverino / qlcolorcode

Automatically exported from code.google.com/p/qlcolorcode
0 stars 0 forks source link

Non-existant lexers should still display file contents #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The plugin should still display un-highlighted file contents in the QL pane
if a lexer is not found.

As an example, using QL on a .command file does not show the contents of
the file when using qlcolorcode. Instead it displays the following error:

Error: no lexer for filename '/path/to/file.command' found

Original issue reported on code.google.com by thomasup...@gmail.com on 11 Dec 2007 at 9:49

GoogleCodeExporter commented 8 years ago
I agree.  I actually meant to sort that out before releasing but got impatient. 
 :-)  I think the right thing to do in 
general is to bail out when we can't highlight a file and let other plugins 
have a shot.

Original comment by n8gray@gmail.com on 12 Dec 2007 at 7:20

GoogleCodeExporter commented 8 years ago
I *think* this should work in 0.2.  Please try it out and see.

Original comment by n8gray@gmail.com on 14 Dec 2007 at 5:06

GoogleCodeExporter commented 8 years ago
This is definitely better, but still not what it could be.

Now when using QL on a .command file, for example, QL merely shows the icon of 
the
file. QL shows the contents of this text file when qlcolorcode is not used.

Unfortunately, I'm not very proficient in the method with which QL handles 
different
file types. If using the built-in text file QL plugin is out of the question 
because
qlcolorcode sort of "takes" its place, could you not set a default 
non-highlighted
lexer within qlcolorcode and use this for all unrecognized lexers?

Original comment by thomasup...@gmail.com on 14 Dec 2007 at 5:14

GoogleCodeExporter commented 8 years ago
My hope was that when we bailed out without providing a prevew the system would 
try another plugin.  But alas, 
it looks like we're not so lucky.  Ok, I'll put in some code to fall back to 
non-highlighted text.

Original comment by n8gray@gmail.com on 14 Dec 2007 at 7:18

GoogleCodeExporter commented 8 years ago
Ok, try again with 0.3.  You still see an error message, but that's intentional 
so you know why it didn't highlight.

Original comment by n8gray@gmail.com on 15 Dec 2007 at 2:04

GoogleCodeExporter commented 8 years ago
Didn't see an error message, but hey, it works.  Awesome job! Thanks!

Original comment by thomasup...@gmail.com on 15 Dec 2007 at 4:38