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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> 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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=411238
Originator: NO
Please assign this request to me. I have a patch ready you for. :-)
Logged In: YES
user_id=631874
Originator: NO
Assigning. Which problem your patch solves?
Manual selection of color scheme patch
Logged In: YES
user_id=411238
Originator: NO
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
Logged In: YES
user_id=631874
Originator: NO
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.
Logged In: YES
user_id=411238
Originator: NO
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.
Logged In: YES
user_id=631874
Originator: NO
Completely agreed.
Your patch is what we need and want. Autodetection is not worth the time it takes.
Logged In: YES
user_id=1589856
Originator: 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.
Logged In: YES
user_id=411238
Originator: NO
> 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?
Logged In: YES
user_id=411238
Originator: NO
Comitted to SVN. Completed: At revision: 4213.
Only manual gear for now. :-)
Logged In: YES
user_id=1589856
Originator: YES
> 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.
Logged In: YES
user_id=1589856
Originator: YES
> 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.
Logged In: YES
user_id=631874
Originator: NO
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.
Logged In: YES
user_id=411238
Originator: NO
> 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.
Logged In: YES
user_id=631874
Originator: NO
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".
Logged In: YES
user_id=631874
Originator: NO
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?
Logged In: YES
user_id=411238
Originator: NO
I'm fine with these guidelines and I'll apply the changes soon.
Logged In: YES
user_id=631874
Originator: NO
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.
Logged In: YES
user_id=411238
Originator: NO
Don't you want to review my changes first?
Logged In: YES
user_id=631874
Originator: NO
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).
Logged In: YES
user_id=411238
Originator: NO
Patch was submitted: http://www.winmerge.org/patch/1697691
Logged In: YES
user_id=631874
Originator: NO
I'm closing this item as the patch is in SVN trunk.