mirror of
https://github.com/clechasseur/pathcopycopy.git
synced 2026-04-25 04:05:55 +03:00
[GH-ISSUE #174] [FEATURE] Be able to insert newlines in copied paths #170
Labels
No labels
bug
duplicate
enhancement
enhancement
enhancement
fixed
help wanted
help wanted
invalid
pull-request
question
waiting for input
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/pathcopycopy#170
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ZPMU on GitHub (Sep 26, 2023).
Original GitHub issue: https://github.com/clechasseur/pathcopycopy/issues/174
Originally assigned to: @clechasseur on GitHub.
Is your feature request related to a problem? Please describe.
I want to take a path and convert it two times, seperated by a newline or some other seperation char: First it should converted like done by "Copy long UNC path", then again like done by "Copy samba path", both concatenated by newline.
Problem: Don't know how to do after reading https://github.com/clechasseur/pathcopycopy/wiki/Custom-Commands-%3A-Expert-Mode
Describe the solution you'd like
I have no clue about the expert mode, but my gut says that it ist possible by that means, resorting to two of the Base Commands.
Describe alternatives you've considered
Build the two paths manually by means of a complicated RegExp, omitting the savvy hidden in both Base Commands.
Additional context
The existing stack manipulating elements let me tempt to apply knowledge about UPN based calculators/languages.
From my experience with UPN, I think it should be somewhat like
"Duplicate top stack element"
"Convert top stack element to Samba"
"Swap two topmost stack elements"
"Convert top stack element to UNC"
"Push newline to stack"
"Swap two topmost stack elements"
"Concatenate two topmost stack elements"
"Concatenate two topmost stack elements"
Supposing that each Base command take a path from stack, an push the treated result to stack.
Supposing that initial file path is present on stack and final result (to be deposited in clipboard) shall be left on the stack.
@clechasseur commented on GitHub (Sep 28, 2023):
Indeed, this is almost possible with stack manipulation. Here's an example:
CopyUNCAndSambaPaths.zip
However, this example pushes the string
" | "between the two paths. This is because there doesn't seem to be a way to push a true newline onto the stack.I'll keep this open to see if there's a way to add this.
@ZPMU commented on GitHub (Sep 29, 2023):
Thanks, that clarifys some points. I think that nevertheless the docs are a little bit narrow. I think, more examples may give a glimpse of the concepts.
In the meantime I found a solution similar, but not that concise. But indeed, I also didn't find a solution to use a newline as seperation string. "\n" or "$n" or variations with more than one "" or with "\r" or "\r\n" or the like didn't make it.
So this issue forks into the two tasks "give more examples in the docs" and "let the user insert line breaks onto the stack", IMHO.