Bug 378322 - Kate-ctags-plugin can not passes path string which contain space character to ctags command correctory
Summary: Kate-ctags-plugin can not passes path string which contain space character to...
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: 20.12.2
Platform: unspecified All
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-31 17:29 UTC by Yuki
Modified: 2023-02-26 10:49 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuki 2017-03-31 17:29:53 UTC
Kate-ctags-plugin separate path string by space character then passes to command.
Thus, ctags can not find the directory when the path string contain space character.

Example:
----- Setting of CTags plugin -----
Index Target: D:/Projects/tmp/src dir
CTags database file: D:\Projects\tmp\tags dir\tags
CTags command: logargs.bat
----- logargs.bat -----
echo [%0] [%1] [%2] [%3] [%4] [%5] [%6] [%7] [%8] [%9] >> "%TEMP%\args.log"
----- args.log -----
[logargs.bat] [-f] [D:\Projects\tmp\tags] [dir\tags] [D:/Projects/tmp/src] [dir] [] [] [] []
Comment 1 Vasudeo 2017-12-20 14:40:19 UTC
I agree with this bug. Please confirm and fix this bug.
Comment 2 Vasudeo 2017-12-22 06:13:24 UTC
(In reply to Yuki from comment #0)

> ----- Setting of CTags plugin -----
> Index Target: D:/Projects/tmp/src dir
> CTags database file: D:\Projects\tmp\tags dir\tags

I have observed this bug on Linux (Mint/Kubuntu) Kate (V16.04.3) as well. Can you please edit the field 'Platform' in the bug description to accommodate Linux along with Windows?

Thanks.
Comment 3 Yuki 2017-12-23 07:40:36 UTC
(In reply to Vasudeo from comment #2)
> (In reply to Yuki from comment #0)
> 
> > ----- Setting of CTags plugin -----
> > Index Target: D:/Projects/tmp/src dir
> > CTags database file: D:\Projects\tmp\tags dir\tags
> 
> I have observed this bug on Linux (Mint/Kubuntu) Kate (V16.04.3) as well.
> Can you please edit the field 'Platform' in the bug description to
> accommodate Linux along with Windows?
> 
> Thanks.

I've changed platform to unspecified, is this ok?
Comment 4 Justin Zobel 2020-11-02 01:50:11 UTC
Yuki/Vasudeo can you please confirm this issue still persists on a recent version of Kate.
Comment 5 Bug Janitor Service 2020-11-17 04:33:41 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Bug Janitor Service 2020-12-02 04:34:04 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!
Comment 7 Yuki 2021-03-06 08:14:02 UTC
I tried CTags plugin on Kate version 20.12.2
"Index targets" given in argument for ctags command is OK, but "CTags database file" given to -f option still has problem(argument is separated if the path contains space)

----- Setting of CTags plugin -----
Index Target: C:/Programs/src dir
CTags database file: C:/Programs/src dir/tags
CTags command: C:/Programs/bin/logargs.bat
----- logargs.bat -----
echo [%0] [%1] [%2] [%3] [%4] [%5] [%6] [%7] [%8] [%9] >> "%TEMP%\args.log"
----- args.log -----
[C:\Programs\bin\logargs.bat] [-f] [C:\Programs\src] [dir\tags] ["C:/Programs/src dir"] [] [] [] [] []
Comment 8 Yuki 2021-03-06 09:40:43 UTC
I found that path "CTags database file" is given to -f option of ctags command correctly if I surround it by double quotation.
Is this expected behavior?

Kate version-----
Version 20.12.2
----- Setting of CTags plugin -----
Index Target: C:/Programs/src dir1, C:/Programs/src dir2
CTags database file: "C:/Programs/src dir/tags"
CTags command: C:/Programs/bin/logargs.bat
----- logargs.bat -----
echo [%0] [%1] [%2] [%3] [%4] [%5] [%6] [%7] [%8] [%9] >> "%TEMP%\args.log"
----- args.log -----
[C:\Programs\bin\logargs.bat] [-f] ["C:\Programs\src dir\tags"] ["C:/Programs/src dir1"] ["C:/Programs/src dir2"] [] [] [] [] []
Comment 9 Yuki 2021-03-06 09:48:12 UTC
>>I found that path "CTags database file" is given to -f option of ctags command correctly if I surround it by double quotation.

When I change "CTags database file" like this, tags file can be created, but searching symbol on CTags plugin can't work. In order to search symbol, I sill needs to delete double quotation in "CTags database file" after creating tags file.
Thus, I think this is problem.
Comment 10 Bug Janitor Service 2023-02-19 12:53:35 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1116
Comment 11 Waqar Ahmed 2023-02-19 15:10:39 UTC
Git commit 2dc7d3d9964ed070105172f211aed007bfb1644b by Waqar Ahmed.
Committed on 19/02/2023 at 12:51.
Pushed by waqar into branch 'master'.

Ctags: Wrap with quotes

Paths can contain spaces, wrap with quotes

M  +1    -1    addons/kate-ctags/kate_ctags_view.cpp

https://invent.kde.org/utilities/kate/commit/2dc7d3d9964ed070105172f211aed007bfb1644b
Comment 12 Waqar Ahmed 2023-02-26 10:49:31 UTC
Git commit 6e9eccd4915415e74610a5d1eb4b1e31e04fc18d by Waqar Ahmed.
Committed on 26/02/2023 at 10:43.
Pushed by waqar into branch 'release/22.12'.

Ctags: Wrap with quotes

Paths can contain spaces, wrap with quotes

M  +1    -1    addons/kate-ctags/kate_ctags_view.cpp

https://invent.kde.org/utilities/kate/commit/6e9eccd4915415e74610a5d1eb4b1e31e04fc18d