tom, do you have ever requested the feature for automatically getting displayed all occurrences of a manually made selection depending on a configuration setting by email to IDM support?
This is a user-to-user forum and I am also just a user. Posting feature requests in one of the forums here has usually absolutely no effect on future versions of UltraEdit. The number of visitors of a forum topic (human or bots) do not matter because it can't be evaluated by visitors count why the topic was visited and how long it was viewed if visited by a human at all.
Such a feature highlighting automatically all occurrences of a selection must be definitely controllable via a configuration setting. I would never enable it as whenever I make a selection manually, I want to do something with it, most often cut or copy it. UltraEdit is not used only by code writers which work on small text files with special code writer requirements. That must be always taken into account by IDM Computer Solutions. UltraEdit is not designed mainly for code writing as many, many other text editors. And this special highlighting should be done only on the lines currently displayed in window and should be best done with a separate thread to keep user interface responsible for further user actions like Ctrl+X. Real programmers quickly writing code and so quickly selecting something, cut/copy it, move to another position by key, paste it, ... would not be happy if all those quickly executed user actions would be delayed by a feature mainly used by programmers which need 8 hours to write 20-50 small lines of code.
I – UltraEdit user Mofi – don't need a feature to automatically highlight all occurrences of a selection conflicting with other already existing highlighting features (brace highlighting, HTML/XML tag highlighting, ...). But
I – UltraEdit user Mofi – would have absolutely no problem if UltraEdit would have such a feature controlled by a check box option in configuration, resulting in UltraEdit has to execute an if condition whenever a
single selection is made by a user as this would take just some microseconds or perhaps even nanoseconds.
The feature for highlighting automatically all occurrences of a selection should not be triggered in my point of view if a macro or script or a find selects a string or using multi-caret feature with selecting a string on multiple positions in a file. Well, if a macro/script during execution selects thousands of times something, the time for additional checking the conditions if additionally highlighting all occurrences of selected string or not could result in a longer time for finishing the task. But I think, it should not be too much longer in comparison to total macro/script execution time.
tom.michalik, the feature asked for by
amm68 August 2008 is available in UltraEdit since several years. This feature is not working exactly as you expect it, but it is available. What you want can be done currently as follows:
- Once open Advanced - Settings or Configuration - Search - Auto reset settings and uncheck Highlight all items found and Match case and Match whole word only whereby the last two options are by default unchecked.
- Once navigate in configuration to Key mapping, navigate in list of Commands to command Find and assign Ctrl+F to this command on preferring usage of Ctrl+F instead of Alt+F3 for opening a Find.
- Once close Configuration with button OK.
- Once press Ctrl+F or Alt+F3 to open a Find.
- Once check the find options Match whole word, Match case, Highlight all items found and Close after find.
- Once run the Find with these three options set.
Then you get a case-sensitive, whole word only highlighting of word at current position of the caret by pressing
Ctrl+F or
Alt+F3 and
RETURN.
Ctrl+F,
RETURN can be definitely executed very quickly on 10 fingers positioned over keyboard and used for pressing the three keys.
But I understand that if one hand is mainly on mouse, and keyboard is used mainly with two fingers, this command sequence cannot be as quickly executed as clicking on an item on a ribbon tab or a toolbar. And it has the disadvantage on using once different find options, the find options as needed must be set once again on next usage of
Find for getting highlighting occurrences of word at current position of caret. And I understand also that toggling options in a dialog by key is done by just a small amount of computer users like me which have enabled in Windows display settings to get the mnemonic keys always displayed underlined to always see which key to press for an item in a dialog.
Therefore see what I have done in the last hours for users like you by writing and sending an email with three enhancement requests.
This is the email I sent to IDM support.
This time I want to requests three enhancements for the commands:
- Select word executed by keyboard with Ctrl+J and by pointing device with a double click on primary button
- Highlight all selected executed by keyboard with Ctrl+J and by pointing device with a SHIFT + double click on primary button
I use myself command
Select word with a different key assignment and only by keyboard very often, but never use command
Highlight all selected because this feature is completely useless for me.
However,
Highlight all selected is for some users of UltraEdit a very important feature. It is so important that if this feature is not working for those users as expected, UltraEdit is a text editor which can't be used by those users and they choose a different text editor which has this feature working as expected by them.
None of those users have ever described in detail for which task
Highlight all selected is so important that any other method for finding and getting highlighted/displayed a string can't be used. I am quite sure that all those users could very easily use other methods which would make their tasks much more efficient (= quicker) to achieve. I have described in forum other methods for efficiently searching for strings and modifying them, but most of those users complaining in forum about
Select word and
Highlight all selected not working exactly as expected by them don't accept any other working method. So it is advisable to come up to their expectations in using an in my opinion inefficient method doing something using
Highlight all selected as those users are accustomed to use this feature for their tasks from other text editors.
But there is a big problem with
Select word and especially with feature
Highlight all selected. On asking 10 users on how those two features should work, you get at least 8 different answers. That means the string matching behavior of those two features must be very easy customizable by the users, so that each user, for which especially
Highlight all selected working exactly as expected is an absolute must have for the text editor to use, are satisfied with matching behavior after having made not more than 5-10 clicks once in configuration of UltraEdit.
I think it is the first time in 20 years of UltraEdit usage that I write an enhancement request for a feature which I don't use myself and which will not be used by me in future even with the enhancements implemented. But I really think it is important to let you know how
Select word and
Highlight all selected could be enhanced to work for other UE/UES users after a few clicks in configuration as expected which are very important features for those users.
1. Configurable case matching behavior for Highlight all selected
In currently public available UltraEdit for Windows v25.00.0.68 and UEStudio v17.20.0.16 the command
Highlight all selected searches for other occurrences of selected string always case-sensitive.
On usage of UltraEdit for writing program or script code it depends on the case-sensitivity of the language if searching case-sensitive or searching case-insensitive would be better for the user.
For users writing case-sensitive code, the current behavior of searching case-sensitive is most often wanted. But users writing case-insensitive code which use this command for searching for other occurrences of a symbol often want to use this feature with a case-insensitive matching behavior, especially if they have to edit code written by somebody else who has used the opposite as the current user for case of letters in variable and function names or who was sloppy regarding to case of letters in symbol names (because of not using auto-completion).
And UltraEdit users using this feature for text files not containing code at all most likely would prefer also a case-insensitive search as very often the text in such files like CSV files are typed by people who are making typing mistakes.
My enhancement suggestion:
Add to configuration at
Search - Advanced an option like
Match case on highlight all selected and run the search on executing
Highlight all selected case-sensitive or case-insensitive according to this setting in configuration.
For downwards compatibility this check box option should be checked by default, i.e. the default value is 1 for this option of type bool.
2. Configurable whole word matching behavior for Highlight all selected
In currently public available UltraEdit for Windows v25.00.0.68 and UEStudio v17.20.0.16 the command
Highlight all selected searches for other occurrences of selected string always WITHOUT taking word boundaries into account even if just a single word is selected prior executing the command by the user or automatically by the command itself on executing it with no string selected in active file.
For non programmers using UltraEdit for text files not containing code this matching behavior is most likely wanted. But for programmers who want to see the usage of a function, variable, macro, type, ... in a source code or script file it is often wanted that
Highlight all selected for a selected single word highlights only occurrences of whole selected word and ignores other words containing the selected word just as word part.
My enhancement suggestion:
Add to configuration at
Search - Advanced an option like
Match whole word on highlight all selected for single word and run the search on executing
Highlight all selected according to this setting in the configuration if the selected text is a single word.
The definition of word follows in next chapter respectively suggestion.
For downwards compatibility this check box option should not be checked by default, i.e. the default value is 0 for this option of type bool.
3. Configurable character set of word characters for Select word and Highlight all selected
In currently public available UltraEdit for Windows v25.00.0.68 and UEStudio v17.20.0.16 the command
Select word with caret at beginning, middle or end of word selects the word according to Unicode definition of word characters like using the Perl regular expression \w+ at beginning of a word. This is a standard feature of Windows library used by many Windows applications.
In UE/UES the command
Select word selects a series of spaces/tabs on executing it with caret in the middle of a series of spaces/tabs. That is a feature I really, really like and use often and which should not be touched on enhancing
Select word matching behavior for words.
But many people, especially programmers, have a different definition respectively expectation on what a word is in context of the language they are writing code. The Unicode consortium defines the word characters according to languages spoken/written by people. So the character set for word characters as defined by Unicode does not match with character set for symbols in many programming and scripting languages.
For example in PHP variables must start with a dollar sign. So PHP code writers expect execution of
Select word with caret set anywhere on a PHP variable to get selected the variable name with the dollar sign at beginning.
The hyphen character (U+002D) is according to Unicode a non word character. But in many programming languages this character is a valid character in name of a symbol. And in German text files the hyphen character is used as character to concatenate two or more nouns to a new noun, to break words, as minus sign and as dash of any type in plain text files. (Well, many German text writers use the hyphen for all those purposes also in word processing application instead of the appropriate characters which is definitely no good idea in general.)
Programmers writing code in assembler would prefer the hash character # being interpreted as word character as often used at beginning of value like #1, #416, #3FFFh. And for assembler it would be also good if the straight single quote ' would be interpreted as word character to quickly select something like #'FL'.
My enhancement suggestion:
Add to configuration at
Search - Advanced an option with term
Additional word characters and an edit field being by default empty on which a user can enter the characters which should be additionally to character class defined by \w in a Perl regular expression interpreted as word character by UltraEdit/UEStudio on executing the commands
Select word and
Highlight all selected and "Find/Replace" and "Find/Replace in Files" with option "Match whole word" checked.
There would be by default no compatibility problem with macros and scripts using
Find/Replace or
Find/Replace in Files with option "Match whole word" enabled as by default no characters other than those matched by \w would be interpreted as word characters. But of course a user has to adapt such finds/replaces defined in a macro or script once adding other chars in configuration to
Additional word characters.
The help of UltraEdit for this option should explain that the word characters according to Unicode standard are always interpreted as word characters. Therefore with option
Additional word characters it is only needed to define other characters being non word characters in Unicode to be interpreted as word characters. So there is no need to specify in the edit field letters, digits and underscore.
How the list of additional word characters should be interpreted by UE/UES?
The list of characters specified in configuration dialog is interpreted as string. UE/UES has to search for backslash
\, opening square bracket
[, closing square bracket
], hyphen
- and caret
^ in this string and insert before each of those characters a backslash to escape them.
Then the string with the additional word characters is concatenated with [\w at beginning and with ] at end to build the custom word character set.
Example: The user has configured as additional word characters: #\[]-$ UltraEdit converts this string first to #\\\[\]\-$ and next concatenates this string to [\w#\\\[\]\-$] which defines the word character set now. The non word characters set is for this case: [^\w#\\\[\]\-$]
Hint: The opening square bracket [ would not needed to be escaped at all for a valid Perl regular expression character set containing [ as one of several characters to match. But in general it is advisable to do so.
Now this Perl regular expression character class with its negative equivalent can be used to
Match whole word with custom word character set which is a string matching for the example the Perl regular expression
(?!<=[^\w#\\\[\]\-$])[\w#\\\[\]\-$]+(?=[^\w#\\\[\]\-$])
For command
Select word this means for given example:
- Is caret positioned NOT at end of file AND the character at this position is matched by [\w#\\\[\]\-$] AND caret is at top of file OR the character left to caret is matched by [^\w#\\\[\]\-$], then the caret is positioned at beginning of a word and a Perl regular expression search with [\w#\\\[\]\-$]+ downwards selects the word.
- Is caret positioned NOT at end of file AND the character at this position is matched by [\w#\\\[\]\-$] AND there is a character left to caret NOT matched by [^\w#\\\[\]\-$], then the caret is positioned in middle of a word. This requires first a Perl regular expression search with [\w#\\\[\]\-$]+ upwards to find beginning of the word and next from this position in character stream a search downwards with [\w#\\\[\]\-$]+ to select the entire word at current position of caret in middle of it.
- Is caret positioned at end of file OR the character at this position is NOT matched by [\w#\\\[\]\-$] AND there is a character left to caret AND this character is matched by [\w#\\\[\]\-$], then the caret is positioned at end of a word. A Perl regular expression search with [\w#\\\[\]\-$]+ upwards selects the word.
The other use cases for selecting spaces/tabs at top of a file, at start of a line, between non whitespaces, at end of a line and at end of a file with the command
Select word on a non empty file are handled unmodified.
For command
Highlight all selected this means for given example after automatically selecting word if there is no selection in active file:
Does selected string match the Perl regular expression ^[\w#\\\[\]\-$]+$ ?
Yes, a single word is selected and option
Match whole word on highlight all selected for single word must be taken into account if being enabled. Otherwise no customized word boundary check on each found occurrence of searched/selected string is necessary even with option in configuration enabled.
Run a simple, non regular expression search for selected string with match case set according to configuration option
Match case on highlight all selected.
If no customized word boundary check is needed, the found string must be highlighted and search is repeated for next occurrence.
Otherwise check if there is a character left to found string and if this is the case, the preceding character must not match the expression [\w#\\\[\]\-$] because otherwise the found string has to be ignored for highlighting. Then check if there is a character right to found string and if this is the case, the following character also must not match the expression [\w#\\\[\]\-$] because otherwise the found string has to be ignored for highlighting. On both customized word boundary checks being positive, the found occurrence of selected string must be highlighted and search for selected string is repeated for next occurrence.
For non regular expression, UltraEdit, Unix or Perl regular expression Find/Replace or Find/Replace in Files with option "Match whole word" checked it is necessary with customizable set of word characters to run the search as defined by the user and then do the custom word boundary check as explained in the paragraph above.
Okay, that's it. I wrote about three hours on these enhancement requests mainly for a feature which I don't use and will not use in future. But I hope these enhancement requests are taken into account for those users who can't use UltraEdit with
Highlight all selected working as expected by them. I posted this also in forum on topic
Highlighting the currently selected string and lets see what those users complaining about
Highlight all selected not working as expected think about it and if they request the same enhancements or contribute even better suggestions by email to you.
For our reference some (not all) forum topics related to these enhancement requests:
BTW: I know the customizable feature Ctrl+double click to select a string containing non word characters very well. It is great for selecting a file name with file extension and full path or an URL and other larger strings consisting of multiple words and non word characters between. But it is not really useful for selecting a word as explained above. And this special select feature is not available in a menu or on a toolbar and so cannot be executed by key as also not available in key mapping configuration dialog which is pity for those users of UE/UES using mainly the keyboard for efficient text editing.
The reply from IDM support on my enhancements request email was very positive for users who use often
Highlight all selected and users who would like a customizable
Select word. All my enhancements suggestions are taken seriously into account for a future version of UltraEdit and UEStudio in priority order customizable word character set, match whole word only and configurable case-sensitivity for
Highlight all selected.
And in addition to the enhancements suggested by me it is also discussed to add one more enhancement: A setting in syntax highlighting wordfile to define a language based set of additional word characters which override the additional word characters set as defined in configuration of UE/UES for a syntax highlighted file (or section in case of multi-language HTML syntax highlighting).