I'm a big fan of my tag list, and use them for all sorts of formatting and code snippets. It seems that when I do a multi-select throughout the document, and double click on a tag to apply to selections, it only applies to the last select made. Is there a setting that needs to be changed to allow all selections to be "tagged" at once. If it's not possible, then I think it should be a requested feature. It would be very useful.
How to use tag list with multi-select/multi-caret?
How to use tag list with multi-select/multi-caret?
A smart template is applied to all selections on inserting a smart template. But a tag list item or HTML toolbar item is applied only on last selected text in UE v22.00.0.46.
So I can only suggest to send a feature request email to IDM support for enhancing tag list and HTML toolbar feature also for multi-caret respectively multi-select mode.
Of course you could also convert your tag list(s) to smart template list(s). The tag list file is a text file and a smart template file is an XML file. So it would be possible with some tagged regular expressions to convert a tag list into a smart template XML file. I could record the regular expression replaces needed for this conversion into a macro if you are interest in.
So I can only suggest to send a feature request email to IDM support for enhancing tag list and HTML toolbar feature also for multi-caret respectively multi-select mode.
Of course you could also convert your tag list(s) to smart template list(s). The tag list file is a text file and a smart template file is an XML file. So it would be possible with some tagged regular expressions to convert a tag list into a smart template XML file. I could record the regular expression replaces needed for this conversion into a macro if you are interest in.
Best regards from an UC/UE/UES for Windows user from Austria
I would be interested in that macro. I guess I need to learn about smart templates. I've never used them. Thank you for your reply!
In the attached ZIP file is the macro file TagsToTemplates.mac with first version of the macro to convert a tag list to a template file. The source code of the macro with some comments is also included in file TagsToTemplates.uem.
To use that macro do following:
It is usually advisable to use as template name a string consisting only of [A-Za-z0-9_] for being able to easily use feature auto-suggest smart template when typing.
However, the template file is already ready for being used with View - Views/Lists - Template List.
The created template file must be saved by user now as
A restart of UltraEdit is necessary to see the templates in just stored template file in the template list view.
To use that macro do following:
- Open with View - Views/Lists - Tag List the tag list view if not already visible.
- Right click into the tag list view and left click on context menu item Modify Tags.
- Select the name of the tag list file with complete path and press Ctrl+C to copy it. Close the dialog with button Cancel.
- Press Ctrl+O and insert with Ctrl+V the copied file name with path into the file name edit field. Open the file with button Open.
- Select a tag list, i.e. the lines starting with 0="..." to last line of current tag list.
Do not select multiple tag lists. The macro is written to convert just one tag list to a template file on each execution. - Copy the selected tag list with Ctrl+C, Ctrl+N and Ctrl+V into a new file.
- Use Macro - Load to load the macro file TagsToTemplates.mac.
- Execute the macro with Macro - Play Again.
It is usually advisable to use as template name a string consisting only of [A-Za-z0-9_] for being able to easily use feature auto-suggest smart template when typing.
However, the template file is already ready for being used with View - Views/Lists - Template List.
The created template file must be saved by user now as
- UETMPLTE.TPL for usage as global templates in the templates folder, or
- environment.tp1 respectively layout.tp1 for usage as environment/layout templates, or
- language-tpl.xml for usage as language templates.
A restart of UltraEdit is necessary to see the templates in just stored template file in the template list view.
- TagsToTemplates.zip (3.04 KiB) 84
- This ZIP file contains first version of macro file with source code file to convert a tag list to a templates file.
Best regards from an UC/UE/UES for Windows user from Austria
Thanks for your detailed instructions. I've been using UE for about 10 years now, but there's still a lot to it that I've never played with. And they keep adding new features that I'm not aware of. This will integrate nicely into my workflow.
Well, it turns out that this doesn't work as I'd hoped. I'll give a very simple example of what I hoped this would do:
I have a template that would put a <strong></strong around whatever selection I have. So by selecting all things I wanted tagged (in this case, the text for item 1:, item 2: and item 3:), I could just run the template and get this:
But in practice, it takes the last thing selected and uses it to [$replace$] the others:
Any way around this?
Code: Select all
item 1: blah blah blah
item 2: blah blah blah
item 3: blah blah blah
Code: Select all
<strong>item 1:</strong> blah blah blah
<strong>item 2:</strong> blah blah blah
<strong>item 3:</strong> blah blah blah
Code: Select all
<strong>item 3:</strong> blah blah blah
<strong>item 3:</strong> blah blah blah
<strong>item 3:</strong> blah blah blah
Good gracious! You are right!
I'm not using multi-caret and multi-select feature by myself as I do such modifications always with using replace command. So I enabled just that feature, made two selections, applied one of my templates and saw that the template strings (A element) was inserted around both selections before I posted first reply. But I did not look on the strings which should be kept unmodified.
You are right that the last selected string is used on inserting the template at all positions. That does not make sense and makes the smart templates feature less useful for multi-caret editing, especially for inserting tags in HTML, XHTML and XML files at multiple locations at once.
Please report this issue by email to IDM support as I have done, too. This must be fixed by a developer of UltraEdit. There is nothing a user like you and me can change here.
I'm not using multi-caret and multi-select feature by myself as I do such modifications always with using replace command. So I enabled just that feature, made two selections, applied one of my templates and saw that the template strings (A element) was inserted around both selections before I posted first reply. But I did not look on the strings which should be kept unmodified.
You are right that the last selected string is used on inserting the template at all positions. That does not make sense and makes the smart templates feature less useful for multi-caret editing, especially for inserting tags in HTML, XHTML and XML files at multiple locations at once.
Please report this issue by email to IDM support as I have done, too. This must be fixed by a developer of UltraEdit. There is nothing a user like you and me can change here.
Best regards from an UC/UE/UES for Windows user from Austria