Add "Join Text To One Line" command#125
Conversation
|
In that case |
| var text = str(input()) | ||
| text = text.replace(/[\\r\\n]/g, ''); | ||
| add(text); | ||
| selectItems(0); |
There was a problem hiding this comment.
This may also copy and paste the text, which may be unexpected (neither the description nor the name indicates this).
Also, the new text may be inserted to a different position if there is a pinned item index 0.
There was a problem hiding this comment.
Sorry for the unclear code.
I'm new to copyq commands, should I modify those code as:
var text = str(input())
text = text.replace(/[\r\n]/g, '');
add(text);
copy(text)
toggle()
Hi JoyHak, I test this command with var text = 'text\r\ntext';
console.log(text);
text = text.replace(/[\r\n]/g, '');
console.log(text);Output: text
text
texttextThe reason why I add this command is that on windows the terminal sometimes auto split single-line string, like alacritty/alacritty#2093 says. So I use this command to join them back and I don't think it's suitable Could you explain more detail about why you think the result is |
|
I meant |
|
|
No description provided.