Bug 403997

Summary: Documents panel sorts case insensitive and Projects panel sorts case sensitive, so Previous/Next Document navigates different than expected
Product: [Applications] kate Reporter: Laura David Hurka <laura.stern>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: a.samirh78, laura.stern, nate
Priority: NOR    
Version First Reported In: 18.12.1   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 19.08.0
Sentry Crash Report:

Description Laura David Hurka 2019-02-06 13:09:53 UTC
SUMMARY
The Documents panel sorts files different than the Projects panel. The actions Previous/Next Document navigate as expected from the Documents panel, but behaves weird when loocking at the Projects panel.

STEPS TO REPRODUCE
1. Create a project (e. g. git) with Makefile, main.c, uart.c
2. Open all files with Kate, and show the Documents panel. Looks like this:
main.c
Makefile
uart.c
3. Show the Projects panel. Look like this:
Makefile
main.c
uart.c
3. Open uart.c, still showing Projects panel.
4. Try to navigate to main.c, using Previous Document (Alt+Up)

OBSERVED RESULT
Navigates to Makefile

EXPECTED RESULT
Navigates to main.c, because that is shown directly above uart.c

It would be more convenient, if Projects sorts the same way as Documents.
I do not see a reason, why Documents should sort case insensitive, and Projects should sort case sensitive, and thus in a different way. Additionally, I found no configuration option for this.

SOFTWARE/OS VERSIONS
KDE Neon 5.14
KDE Plasma Version: 5.14.5
KDE Frameworks Version: 5.54.0
Qt Version: 5.11.2
Comment 1 Ahmad Samir 2019-03-18 09:29:08 UTC
You can change how the Documents panel sorts files from Settings -> Configure kate -> Application -> Documents; it could well be that it's not case sensitivity that's causing the issue, but rather it's sorting by opening order.
Comment 2 Laura David Hurka 2019-03-18 12:13:52 UTC
(In reply to Ahmad Samir from comment #1)
> it could well be that it's not case sensitivity that's causing the
> issue, but rather it's sorting by opening order.

No, it’s case sensitivity. The shortcuts navigate in the way the Documents panel is configured. But even if the Documents panel is set to sorting by file name, it still sorts different than the Projects panel.
Comment 3 Ahmad Samir 2019-03-27 10:04:37 UTC
OK. I could reproduce it.
Comment 4 Christoph Cullmann 2019-04-08 16:59:47 UTC
Git commit aefe636289d60f28b15422cd0136eff1b33a4f9e by Christoph Cullmann, on behalf of Ahmad Samir.
Committed on 08/04/2019 at 17:01.
Pushed by cullmann into branch 'master'.

Project plugin: sort the tree view case insensitively

Summary:
This matches how the Filetree plugin sorts its tree view, so that
using the Next/Previous Document (from Filetree plugin) actions while
looking at the Projects panel doesn't skip/jump over files.
FIXED-IN: 19.08.0

Test Plan:
- Create a git repo that has three files with mixed case names, e.g.:
a
B
c

- Open kate and look at the filetree panel and the projects panel, how
the files are sorted should match.

Reviewers: #kate, cullmann, dhaumann

Reviewed By: #kate, cullmann

Subscribers: kwrite-devel

Tags: #kate

Differential Revision: https://phabricator.kde.org/D20319

M  +1    -1    addons/project/kateprojectworker.cpp

https://commits.kde.org/kate/aefe636289d60f28b15422cd0136eff1b33a4f9e