1. There is no ability of manual selection of syntax highlighting scheme.
2. It would be nice if WinMerge could recognize type of file by content. It's needed to enable syntax highlighting when filenames has no extension.
Logged In: YES
Please assign this request to me. I have a patch ready you for. :-)
Logged In: YES
Assigning. Which problem your patch solves?
Manual selection of color scheme patch
Only the the first request for now.
Do we want to add an auto-guessing capability? I guess a good statistic knowledge is required in order to implement it.
File Added: ChangeSchemePatch.7z
That's why I was asking - I don't think implementing #2 makes much sense. It makes for some formats, but then there are things like PHP embedded into HTML etc. And wrong selection there just makes people unhappy.
PHP and HTML is easy, you'll have "<?" or "<?php" tags. :-)
> And wrong selection there just makes people unhappy.
It will make me unhappy first! Why didn't they had file extensions at first place? :-)
Seriously now. Using some kind of "Bayesian Filter" mechanism we might be able to do it. We'll need collect a lot of inputs files, though. I don't think it worth the efforts. With the new patch, if you don't like the highlighted syntax, you can replace it.
Your patch is what we need and want. Autodetection is not worth the time it takes.
Logged In: YES
I thought only about simple pattern matching. Example: if we have #!/bin/sh or bunch of ### in the beginning of file, this is a shell script.
> I thought only about simple pattern matching.
That's only one case. Is it a Perl script or a shell script (which can start with /bin/sh, /bin/tcsh or /bin/bash) or a Python?
Comitted to SVN. Completed: At revision: 4213.
Only manual gear for now. :-)
> That's only one case.
I know, but it's very common case. Most of editors with syntax highlighting (especially for Unix-like OSes) do this matching.
> Is it a Perl script or a shell script (which can start with /bin/sh, /bin/tcsh or /bin/bash) or a Python?
I really don't see any difficulties. Python interpreter is "python", Ruby -- "ruby", Perl -- "perl", etc. Shell interpreters always have suffix "sh" in their name.
I think there is a problem with the patch as it is now:
- syntax highlighting "schema" names are hard-coded into the code (editlib/ccrystaltextview.cpp). This for sure makes translators unhappy. :(
Also, I don't think some of those names are good.. Like "plain"? I suppose it means "no highlighting", so it should be just "none". Etc.
> This for sure makes translators unhappy.
I don't think there is a need to translate the "schema" names. These are language names and you don't say REXX or C different in other language.
On the other hand, I guess it possible to move these names to a string resource.
> Also, I don't think some of those names are good.
I just used the names I found. The menu I create is also very similar to other editor's menus I saw, names included.
I'm pretty sure that "Plain" is not same in Japanese, Korean or Chinese. So there definitely is need for translating. Not all world is ISO-8859-1.
Notepad++ has "Normal Text".
Ok, I think I'd be fine with:
- moving the schema names to resource strings (find a free number area for them)
- replacing "plain" with "Normal Text" or "None"
- replacing "C" with "C/C++"
Though, I think "Schema" itself isn't GUI-proper word? I doubt many users know it. Maybe just "Syntax Highlight" as Main-menu-item?
I'm fine with these guidelines and I'll apply the changes soon.
Do you have time to get this into SVN before Thursday? I know it is tight.. If you don't have time I can delay next beta few days.
Don't you want to review my changes first?
I don't think that is necessary - should be pretty trivial change. However it would be nice to attach patch file here just for sake somebody later looks at this item and discussion here. Just English rc file patch is enough (as usual).
Patch was submitted: http://www.winmerge.org/patch/1697691
I'm closing this item as the patch is in SVN trunk.
Log in to post a comment.