aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/luaexpander.cpp
diff options
context:
space:
mode:
authorEike Ziller <[email protected]>2025-06-24 15:24:05 +0200
committerEike Ziller <[email protected]>2025-06-30 14:58:21 +0000
commitb60337dbaace15ac36d7f44f60d17560111a9ae3 (patch)
treeaf226cbf4549c95f5b95b1f6d130b24d54947c61 /src/plugins/lua/luaexpander.cpp
parent5ff9205962779470bb39cd7eae49a6c0b4a1e433 (diff)
Macros: Add better examples for "prefix" variables
Variables registered with `registerPrefix` are shown in the variable chooser as `Prefix:<value>`, and that was used to show the "current value" as the example in the variable chooser. Add an explicit "example value" to the registerPrefix calls that is used instead of "<value>" for the expanded example in the variable chooser. Fixes: QTCREATORBUG-33120 Change-Id: I4cc522856bf9a7fefeea2ea498de5f67d503b86a Reviewed-by: Alessandro Portale <[email protected]>
Diffstat (limited to 'src/plugins/lua/luaexpander.cpp')
-rw-r--r--src/plugins/lua/luaexpander.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/lua/luaexpander.cpp b/src/plugins/lua/luaexpander.cpp
index 46731a7390b..8963f6f6d05 100644
--- a/src/plugins/lua/luaexpander.cpp
+++ b/src/plugins/lua/luaexpander.cpp
@@ -80,11 +80,13 @@ void setupLuaExpander(MacroExpander *expander)
{
expander->registerPrefix(
"Lua",
- Tr::tr("Evaluate simple Lua statements.<br>"
- "Literal '}' characters must be escaped as \"\\}\", "
- "'\\' characters must be escaped as \"\\\\\", "
- "'#' characters must be escaped as \"\\#\", "
- "and \"%{\" must be escaped as \"%\\{\"."),
+ "1+1",
+ Tr::tr(
+ "Evaluate simple Lua statements.<br>"
+ "Literal '}' characters must be escaped as \"\\}\", "
+ "'\\' characters must be escaped as \"\\\\\", "
+ "'#' characters must be escaped as \"\\#\", "
+ "and \"%{\" must be escaped as \"%\\{\"."),
[expander](const QString &statement) -> QString {
if (statement.isEmpty())
return Tr::tr("No Lua statement to evaluate.");