Should <curitem> return the current path in case no item in list is selected/focused? Right now it returns an empty string in that case.
I'd say yes!
Should <curitem> return the current path?
-
admin
- Site Admin
- Posts: 66362
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
-
graham
- Posts: 457
- Joined: 24 Aug 2007 22:08
- Location: Isle of Man
-
jacky
- XYwiki Master
- Posts: 3106
- Joined: 23 Aug 2005 22:25
- Location: France
- Contact:
Re: Should <curitem> return the current path?
Yeah I agree that it may sound "weird", and as I was questioning myself I thought that since Ctrl+P right now works that way (current path if no item selected), maybe it should, too.
But I'm not so sure and would say "no" in fact, because <curitem> refers to the currently focused&selected List item, where as Ctrl+P refers to "the full path/name of all selected Tree or List items", so it is pretty different and makes more sense then, since if nothing on List is available it goes back to Tree.
<curitem> does seem to be in a quite different situation, as it only refers to list, so never returns a (/the current) path. No "current item", then nothing returned (empty string). Makes more sense to me like that, plus goes along with other variales such as <curext>, <curbase>, etc
But I'm not so sure and would say "no" in fact, because <curitem> refers to the currently focused&selected List item, where as Ctrl+P refers to "the full path/name of all selected Tree or List items", so it is pretty different and makes more sense then, since if nothing on List is available it goes back to Tree.
<curitem> does seem to be in a quite different situation, as it only refers to list, so never returns a (/the current) path. No "current item", then nothing returned (empty string). Makes more sense to me like that, plus goes along with other variales such as <curext>, <curbase>, etc
Proud XYplorer Fanatic
-
admin
- Site Admin
- Posts: 66362
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Should <curitem> return the current path?
Okay, I expected resistance from the purists.
So I'll add another variable <cur> which will return either the current list item or, if none, the current path.
You know why I want it? I need it for my convert <cur> to URL script. I want to use the same script and keyboard shortcut for tree and list.
So I'll add another variable <cur> which will return either the current list item or, if none, the current path.
You know why I want it? I need it for my convert <cur> to URL script. I want to use the same script and keyboard shortcut for tree and list.
FAQ | XY News RSS | XY X
-
yusef88
- Posts: 1148
- Joined: 28 Jan 2013 03:50
- Location: Windows 8.1 32-bit
Re: Should <curitem> return the current path?
sorry for the inconvenience..where is it?admin wrote:Okay, I expected resistance from the purists.![]()
So I'll add another variable <cur> which will return either the current list item or, if none, the current path.
You know why I want it? I need it for my convert <cur> to URL script. I want to use the same script and keyboard shortcut for tree and list.
cant find it in the xyplorer help, variables section.
-
Stefan
- Posts: 1360
- Joined: 18 Nov 2008 21:47
- Location: Europe
Re: Should <curitem> return the current path?
In the past 5 1/2 years there has many things changed (if it was implemented at all?).
If you need such a var, maybe you can utilize such a code?
or formated another way
(see XYplorer Help > "Advanced Topics > Variables" for more XYplorer Native Variables)
.
If you need such a var, maybe you can utilize such a code?
Code: Select all
::if("<curitem>"==""){$cur="<curpath>";}else{$cur="<curitem>";} msg $cur;or formated another way
Code: Select all
if( "<curitem>" == "" ){
$cur = "<curpath>";
}else{
$cur = "<curitem>";
}
msg $cur;
(see XYplorer Help > "Advanced Topics > Variables" for more XYplorer Native Variables)
.
XYplorer Beta Club