Remove starting newline in demangled func name #3502
Merged
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.
Describe your PR, what does it fix/add?
When searching for a Hyprland fucntion with
findFunctionsByName
, the returned vector of matches contain demangled names, which always seem to be prefixed with a newline.Notice the
if (method.demangled == "\nCWindow::createGroup()")
. There's no reason this should be the case, the newline character shouldn't be there. (tested with "createGroup", "destroyGroup", "getNodeFromWindow" fucntions).From what I understand, this was caused by this lambda function:
Hyprland/src/plugins/PluginAPI.cpp
Lines 293 to 305 in 3d1a167
Which is supposed to return the contents of nth line, by finding positions of
\n
characters, returning a substring from thatpos
to next newline.However the
pos
variable was set to the position of last newline, so it's included too. Instead, it should probably just bepos + 1
to skip that newline char.Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
No
Is it ready for merging, or does it need work?
Ready to be merged.