Bug 335608 - Kate does not jump to specified line when opening an sftp url
Summary: Kate does not jump to specified line when opening an sftp url
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: 3.13.1
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Marcell Fulop
URL:
Keywords:
: 116793 386669 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-05-30 18:24 UTC by Nikola Kovacs
Modified: 2021-03-14 12:41 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 21.04.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikola Kovacs 2014-05-30 18:24:48 UTC
When starting kate with a command like this:

kate --line 3 "sftp://username@server:22/home/username/test.txt"

if the file is not  already opened in kate, it won't jump to line 3. If the file is already opened, it works.

Local files are fine, only sftp urls are affected.

I use a private key to log in, and it's added with ssh-add, so there's no password prompt, in case that matters.

Reproducible: Always

Steps to Reproduce:
1. Create a file with at least five lines on a remote server where you have ssh/sftp access.
2. Copy your public key to the remote server, and add your private key with ssh-add, so you can log in without any prompts.
3. Set up the remote server in dolphin (go to remote:/, Add network folder, etc.)
4. Open the file through sftp in kate.
5. Write down the url in the title bar, it should look like this: sftp://username@server:22/path/to/file
6. Close kate.
7. Open a terminal, and type: kate --line 5 followed by the url.

Actual Results:  
The file is opened in kate, but the cursor is on the first line.

Expected Results:  
The file is opened in kate, and the cursor is on the fifth line.
Comment 1 Nikola Kovacs 2015-08-17 08:33:55 UTC
This sometimes happens with local files as well on Kate 5.0.0.
Comment 2 Christoph Cullmann 2016-09-08 19:50:21 UTC
*** Bug 116793 has been marked as a duplicate of this bug. ***
Comment 3 Christoph Cullmann 2018-08-17 20:32:19 UTC
*** Bug 386669 has been marked as a duplicate of this bug. ***
Comment 4 Christoph Cullmann 2018-08-17 20:32:37 UTC
Still an issue, patches are welcome.
Comment 5 Justin Zobel 2020-10-25 07:32:25 UTC
kate 20.08.1

I tried several local files and they were fine but sftp files did not highlight the correct line.

Tried fish:// protocol as well, not highlighting there either.
Comment 6 Marcell Fulop 2021-02-20 01:49:10 UTC
I have a patch for this! I'm a complete newb in KDE dev and not sure how to submit it. I'll find out shortly...
Comment 7 Justin Zobel 2021-02-22 03:59:55 UTC
(In reply to Marcell Fulop from comment #6)
> I have a patch for this! I'm a complete newb in KDE dev and not sure how to
> submit it. I'll find out shortly...

See here :) https://community.kde.org/Get_Involved/development#Submit_a_Merge_Request

Thank you for the contribution!
Comment 9 Christoph Cullmann 2021-03-14 12:40:48 UTC
Author: Christoph Cullmann <cullmann@kde.org>  2021-03-14 13:39:27
Committer: Christoph Cullmann <cullmann@kde.org>  2021-03-14 13:39:27
Parent: a05525ee885a7545c5d1677faa66e63578d7e520 (SVN_SILENT made messages (.desktop file) - always resolve ours)
Parent: 85e39621f8ff30eeba3444de45d76a37dd84056f (SVN_SILENT clang-format ignore)
Branches: release/21.04, remotes/origin/release/21.04
Follows: v19.12.2
Precedes: 

    Merge branch 'master' into release/21.04
    
    => merging the https://invent.kde.org/utilities/kate/-/merge_requests/295 stuff
    
    BUG: 335608