Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trailing space #85

Closed
kayanco opened this issue Nov 8, 2023 · 1 comment
Closed

Remove trailing space #85

kayanco opened this issue Nov 8, 2023 · 1 comment

Comments

@kayanco
Copy link

kayanco commented Nov 8, 2023

Hi,

CopyQ is now working perfect for me; it's the best tool!
I just have one issue:

Is there any way to auto remove trailing space when copy/pasting:
For example, "copyq " would be pasted as "copyq" (without the ending space)

Would really appreciate it!

@hluk
Copy link
Owner

hluk commented Nov 27, 2023

The following command removes spaces from beginning and end of a newly copied string (not from existing items in the app):

[Command]
Automatic=true
Command="
    copyq:
    const text = str(input())
    const newText = text.trim()
    if (newText != text) {
        copy(newText)
        setData(mimeText, text)
        removeData(mimeHtml)
    }"
Icon=\xf0c4
Input=text/plain
Match=^\\s|\\s$
Name=Trim Whitespace

@hluk hluk closed this as completed Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants