Bug 462532 - `Sort Selected Text` sorts the entire file when no text is selected
Summary: `Sort Selected Text` sorts the entire file when no text is selected
Status: RESOLVED FIXED
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Kubuntu Linux
: NOR minor
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-02 04:16 UTC by rohan.preacher.smith
Modified: 2025-04-09 04:32 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rohan.preacher.smith 2022-12-02 04:16:20 UTC
`Right click context menu inside of a file -> Editing -> Sort Selected Text` when there's no text selected will sort the entire file. It works fine when there's text selected, but when there's nothing selected I'd expect this operation to do nothing.
Comment 1 Christoph Cullmann 2023-03-11 16:03:42 UTC
That behaved like this forever, I think if we change that, others will complain this is some regression.
Comment 2 rohan.preacher.smith 2023-03-11 23:28:10 UTC
Could change the text on that option when there's no text selected too. Something like `Sort Selected Text` with text selected, `Sort All Text` with nothing selected. Leaving it as `Sort Selected Text` and then sorting the entire file just misrepresents what's going to happen.
Comment 3 Christoph Cullmann 2023-04-29 15:01:01 UTC
There is no api to do that for scripts and I think to add that is overkill. Perhaps one could rephrase the action text.