forked from jess/Acord
1
0
Fork 0
This commit is contained in:
jess 2026-04-15 10:11:52 -07:00
parent 070723ff95
commit 4c7d9f98a6
2 changed files with 10 additions and 1 deletions

BIN
Home.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 KiB

After

Width:  |  Height:  |  Size: 474 KiB

View File

@ -24,10 +24,19 @@ impl clipboard::Clipboard for MacClipboard {
// clipboard sources produce stray bytes when pbpaste coerces their
// format to plain text, and a single bad byte would otherwise drop
// the whole paste.
//
// Line-ending normalisation: web pages, Discord, and some cross-
// platform apps keep `\r\n` in the pasteboard. Iced's buffer and
// our own gutter line counter disagree about whether `\r` is its
// own row, which drifts the gutter against the cursor on every
// paste. Collapse every CR to LF before handing the text upward.
std::process::Command::new("pbpaste")
.output()
.ok()
.map(|o| String::from_utf8_lossy(&o.stdout).into_owned())
.map(|o| {
let s = String::from_utf8_lossy(&o.stdout).into_owned();
s.replace("\r\n", "\n").replace('\r', "\n")
})
}
fn write(&mut self, _kind: clipboard::Kind, contents: String) {