Bug 507272

Summary: Cursor jumps to end of line when editing a search query
Product: [Applications] dolphin Reporter: tagwerk19
Component: searchAssignee: liweinan <liweinan>
Status: RESOLVED FIXED    
Severity: normal CC: kfm-devel, liweinan, VectorSpiral2357
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description tagwerk19 2025-07-20 12:12:26 UTC
SUMMARY

    If you are typing a search query, mistpye, realise your mistake and backspace
    to correct it. You delete the mistyped character but then find the cursor has
    jumped to the end of the line.

STEPS TO REPRODUCE:

1...

    Open the search in Dolphin (with a Ctrl-F)

2...

    Type a search query, realise you've made a mistake, backspace to the error, delete
    it and...

OBSERVED RESULT:

    The cursor jumps to the end of the line, meaning you have to backspace again to get
    to where you were...

EXPECTED RESULT:

    The cursor stays where you left it, allowing you to continue to type the correction.

SOFTWARE/OS VERSIONS:

    KDE Neon Unstable
    Plasma: 6.4.80
    Frameworks: 6.17.0
    Qt: 6.9.1
    Dolphin: 25.11.70

ADDITIONAL INFORMATION:

    This may be a variation of Bug 494018 which earlier only affected Baloo, this
    affects all searches, Simple Search as well as Baloo, in the new search interface
    (currently in Neon Unstable)
Comment 1 tagwerk19 2025-08-17 07:58:30 UTC
(In reply to tagwerk19 from comment #0)
> SOFTWARE/OS VERSIONS:
> 
>     KDE Neon Unstable
>     Plasma: 6.4.80
>     Frameworks: 6.17.0
>     Qt: 6.9.1
>     Dolphin: 25.11.70
Reached Neon User:
     KDE Neon User
     Plasma: 6.4.4
     Frameworks: 6.17.0
     Qt: 6.9.1
     Dolphin: 25.08
Comment 2 VectorSpiral2357 2025-08-21 17:56:38 UTC
This may be a variation of Bug 423328 that has resurfaced. A fix was implemented so perhaps the recent changes to the search bar have regressed it.
Comment 3 liweinan@kylinos.cn 2025-09-02 09:29:20 UTC
I tested this on the master branch, and the issue still exists.
Comment 4 Bug Janitor Service 2025-09-02 10:33:30 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/1045
Comment 5 Felix Ernst 2025-09-03 14:06:20 UTC
Git commit 655763fbc977cc900cc367f1797f752c7b217c71 by Felix Ernst, on behalf of weinan li.
Committed on 03/09/2025 at 14:06.
Pushed by felixernst into branch 'master'.

Search::Bar: Preserve cursor position

Prior to this commit editing the search term would sometimes change the
cursor position. This commit makes sure the cursor position does not
move by itself.

M  +2    -0    src/search/bar.cpp

https://invent.kde.org/system/dolphin/-/commit/655763fbc977cc900cc367f1797f752c7b217c71
Comment 6 tagwerk19 2025-09-05 20:17:12 UTC
(In reply to Felix Ernst from comment #5)
> Search::Bar: Preserve cursor position
The fix is there and working in Neon Unstable.

Thank you!