Skip to content

fix "Can't find internal action" for quote macros when quote replacing is active#4358

Merged
sunderme merged 1 commit intotexstudio-org:masterfrom
octaeder:updateUserMacroShortcuts
Mar 8, 2026
Merged

fix "Can't find internal action" for quote macros when quote replacing is active#4358
sunderme merged 1 commit intotexstudio-org:masterfrom
octaeder:updateUserMacroShortcuts

Conversation

@octaeder
Copy link
Contributor

@octaeder octaeder commented Mar 8, 2026

Open Config dialog. In Editor options choose a method for Replace Double Quotes. This will add internal macros
TXS_AUTO_REPLACE_QUOTE_OPEN and TXS_AUTO_REPLACE_QUOTE_CLOSE
to the userMacros list but only after actions have been setup for the (usual) user macros (c.f. ConfigManager::updateUserMacroMenu).

When Config dialog is closed with ok ConfigManager::updateUserMacroShortcuts is executed. It selects each macro from the userMacros list and calls getManagedAction. Obviously this needs to fail for the internal macros mentioned above. Debug messages Can't find internal action are written for both macros.

Also abbreviations come in mind. But debugging LatexCompleter::updateAbbreviations shows that macros are skipped when
macro.abbrev.isEmpty() || macro.snippet().isEmpty() is true. Indeed, this holds for the internal macros because they don't use abbreviations. Since this may not be obvious, it might be reasonable extending the condition in a similar way as this PR does for the shortcuts. Let me know when I should do so.

@sunderme
Copy link
Member

sunderme commented Mar 8, 2026

no need for the second extension

@sunderme sunderme merged commit 5b8022d into texstudio-org:master Mar 8, 2026
8 checks passed
@sunderme
Copy link
Member

sunderme commented Mar 8, 2026

thanks

@octaeder octaeder deleted the updateUserMacroShortcuts branch March 8, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants