Implement commands to make command line text selected#5339
Merged
vadi2 merged 3 commits intoMudlet:developmentfrom Aug 2, 2021
Merged
Implement commands to make command line text selected#5339vadi2 merged 3 commits intoMudlet:developmentfrom
vadi2 merged 3 commits intoMudlet:developmentfrom
Conversation
|
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
No need to install anything - just unzip and run. |
| if (n >= 1) { | ||
| name = CMDLINE_NAME(L, 1); | ||
| } | ||
| auto commandline = COMMANDLINE(L, name); |
Contributor
There was a problem hiding this comment.
warning: local copy name_ of the variable name is never modified; consider avoiding the copy [performance-unnecessary-copy-initialization]
auto commandline = COMMANDLINE(L, name);
^
src/TLuaInterpreter.cpp:166:23: note: expanded from macro 'COMMANDLINE'
const QString name_ = (_name); \
^
Member
There was a problem hiding this comment.
This wasn't added by your code, we can ignore this warning 👍
Contributor
|
Docs for new functions are missing. |
Kebap
reviewed
Sep 20, 2021
| } | ||
|
|
||
|
|
||
| // Documentation: https://wiki.mudlet.org/w/Manual:Lua_Functions#selectCmdLineText |
Contributor
There was a problem hiding this comment.
Added said documentation to wiki
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief overview of PR changes/additions
Adds commands to make the text in commandline selected.
Implements the command
selectCmdLineText()together with the Geyser CommandLine variantGeyser.CommandLine:selectText()Examples:
selectCmdLineText()-- selects all text in the main command lineselectCmdLineText('extraCmdLine') -- selects the text in the command line named extraCmdLineextraCmdLine:selectText()-- same as above, but using a Geyser.CommandLine stored assigned to extraCmdLineMotivation for adding to Mudlet
Implements requested command from issue #5277
Other info (issues closed, discussion etc)
See #5277 for more comments.
Testing
To test this I created an extra commandline with the following lua script:
After that I called the functions as in the above examples using a temptimer to give enough time to make changes, deselect text etc:
lua tempTimer(2, function() selectCmdLineText() end)Release post highlight
Added functions to select all text from the commandline