Hi,
there seems to be a simular issue with recorded macros as there was with alignments ...
The recorded macro does not work on the last line of a document when CRLF is missing.
Do you need screenshots reproduce this behavior?
And a suggestion to add a little bit more convenience ...
If you need a macro to run until the end of the document, then beside checking the options "While text changes" and "Until caret on last line" you need to set the option "Times" to "0"
Wouldn't it in this case make sense to deactivate "Times" when those 2 options are set?
Thanks a lot for your kind support in advance!
Ludger
plugin Macros
-
- Posts: 392
- Joined: 01.12.2020 13:46
About 'until caret on last line'.
I see it.
IMO it's not a bug. Code from plugin
it means that plugin runs all items from macro, and after each item it checks that we are on the last line. So - it stops if caret is on the last line. And macro don't work for last line.
I see it.
IMO it's not a bug. Code from plugin
Code: Select all
def _run_chk():
for s in _mcr:
exec(s)
if ed.get_carets()[0][1] >= ed.get_line_count()-1:
return True
-
- Posts: 392
- Joined: 01.12.2020 13:46
... but why should I check "While text changes" and "Until caret on last line" when I only want the macro to run n times???Times' makes sense even when using 'until caret on last line'. Macro will stop on both events: 'times' (if >0) + 'until on last line'.
That would mean that one must record a macro in a way that the cursor is on the last character of the line (respectivly "behind" the position I want to change) when the macro is ever supposed to run over the whole document (or alternatively I would have to insert a extra CRLF).About 'until caret on last line'.
I see it.
IMO it's not a bug.
...
it means that plugin runs all items from macro, and after each item it checks that we are on the last line. So - it stops if caret is on the last line. And macro don't work for last line.
This perhaps works like designed but I think that's a far too complicated approach. From other editors I know functionality that gives the opportunity to let the macro run until the end of the document. For my needs that would be sufficient.
Best regards
Ludger
-
- Posts: 392
- Joined: 01.12.2020 13:46