Don't reverse order of files opened from the command line
ClosedPublic

Authored by gmolteni on Nov 25 2018, 12:25 AM.

Details

Summary

When you do kate file1 file2 file3, it will open tabs
in same order, file1 file2 file3.
In case of having kate opened, invoking it again with
kate file4 file5 file6 final result on tabs shall be
file4 file5 file6 file1 file2 file3
BUG: 397913

Diff Detail

Repository
R40 Kate
Lint
Lint Skipped
Unit
Unit Tests Skipped
gmolteni created this revision.Nov 25 2018, 12:25 AM
Restricted Application added a project: Kate. · View Herald TranscriptNov 25 2018, 12:25 AM
Restricted Application added a subscriber: kwrite-devel. · View Herald Transcript
gmolteni requested review of this revision.Nov 25 2018, 12:25 AM
ngraham accepted this revision.Nov 25 2018, 1:00 AM
ngraham added a reviewer: Kate.

Looks fine and works for me. I'll leave it up to the Kate folks now. :)

This revision is now accepted and ready to land.Nov 25 2018, 1:00 AM
cfeck added a comment.Nov 25 2018, 4:14 AM

Do I understand it correctly, that this would have to be reverted once Kate creates tabs in natural order (left to right)? Or is it just a duplicate? See linked bug 398525.

cfeck requested changes to this revision.Nov 25 2018, 4:16 AM
cfeck added inline comments.
kate/kateapp.cpp
180

Missing spaces around -. Also, we traditionally use --i instead of i--.

kate/main.cpp
421

No space after &, because it is the unary reference operator, not the binary "and" operator.

This revision now requires changes to proceed.Nov 25 2018, 4:16 AM
gmolteni updated this revision to Diff 46189.Nov 25 2018, 9:50 AM

Small coding styling changes

Do I understand it correctly, that this would have to be reverted once Kate creates tabs in natural order (left to right)? Or is it just a duplicate? See linked bug 398525.

You are right, this should be reverted once Kate creates tabs in natural order.

brauch added a subscriber: brauch.Nov 25 2018, 10:07 AM

It has often been discussed whether bug 398525 is actually valid, without real conclusion. Since the tabs do not show all documents, but only the n most recently used ones, it to me makes a lot of sense that new documents are added at the left, and then "drop off the shelf" towards the right if they are not being used, into the dropdown-menu.

cullmann accepted this revision.Nov 25 2018, 10:25 AM
cullmann added a subscriber: cullmann.

I think the LRU tabs work ok normally, for browsing all files you have either the file tree / project / quick open.
I am ok with adding this change here, makes sense to be more conform to what other editors do.

This revision is now accepted and ready to land.Nov 25 2018, 10:25 AM

If you pass me your mail address, will push this for you.

It has often been discussed whether bug 398525 is actually valid, without real conclusion. Since the tabs do not show all documents, but only the n most recently used ones, it to me makes a lot of sense that new documents are added at the left, and then "drop off the shelf" towards the right if they are not being used, into the dropdown-menu.

I think the file4 file5 file6 file1 file2 file3 behavior is in line with that philosofy. Every invocation to kate sets the new group on the left, but with the new fileset traditionally ordered. Heavy CLI users like me organize their files without using spaces and we use names and numbers so to have a positive interaction with shell globbing. Having kate behave different than the rest of the tools was driving me crazy. Lets say you want to edit the init scripts which are named starting with a number as the order:
kate -ns initScriptsSession ./*.sh
And the 99 script is opened, which as a new user was confusing. Without using mouse then I should do alt left left left untill the script named 10 is selected. Because I think from 1 to 10.
Reminds me of winamp in which you had to select first the last song, then shift click the first song otherwise you would listen to the album in reverse. LRU has it's place but not respecting the order of the user args in a single kate command is not a good idea IMHO

If you pass me your mail address, will push this for you.

My email address is gmolteni@fusap.com.ar

This revision was automatically updated to reflect the committed changes.