这是indexloc提供的服务,不要输入任何密码
Skip to content

Clipboard API incorrectly trims and appends whitespace #195

@gracenoah

Description

@gracenoah

On termux-clipboard-set, the clipboard contents get trimmed:
https://sourcegraph.com/github.com/termux/termux-api@fbf628fefded3d5f21f4532961d732d892ddd629/-/blob/app/src/main/java/com/termux/api/util/ResultReturner.java#L60

On termux-clipboard-get a newline is added to the end of the clipboard contents here:
https://sourcegraph.com/github.com/termux/termux-api@fbf628fefded3d5f21f4532961d732d892ddd629/-/blob/app/src/main/java/com/termux/api/ClipboardAPI.java#L43:1

This results in the inability to copy whitespace: #112
as well as completely nonsensical behavior if using the termux clipboard as the default clipboard in vim/nvim.

If copying and pasting from vim using this clipboard API, the selection gets trimmed and newlines get insert into it when pasting. That means that if you try to copy and paste anything within the same line, it will break your line into multiple lines when you paste.

I hope that these issue can be trivially fixed by updating the two lines of code I pointed out. I'm not sufficiently familiar with the android toolchain and the termux build system to fix it myself, but if I don't see a response for a while, I might give it a shot because I'd really like to be able to share the clipboard with vim on my chromebook.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions