mirror of
https://github.com/lelgenio/demoji.git
synced 2025-01-18 04:36:26 -03:00
fix copying multi-character emojis
This commit is contained in:
parent
92cfb1c0f7
commit
60f638476a
12
src/main.rs
12
src/main.rs
|
@ -41,7 +41,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn pick_emoji_dmenu(c: &[String], args: &Args) -> char {
|
fn pick_emoji_dmenu(c: &[String], args: &Args) -> String {
|
||||||
let child_stdout = if args.copy {
|
let child_stdout = if args.copy {
|
||||||
std::process::Stdio::piped()
|
std::process::Stdio::piped()
|
||||||
} else {
|
} else {
|
||||||
|
@ -57,17 +57,17 @@ fn pick_emoji_dmenu(c: &[String], args: &Args) -> char {
|
||||||
write_emojis_to_stdout(args, stdin);
|
write_emojis_to_stdout(args, stdin);
|
||||||
|
|
||||||
if !args.copy {
|
if !args.copy {
|
||||||
return ' ';
|
return " ".to_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
let output = child.wait_with_output().unwrap();
|
let output = child.wait_with_output().unwrap();
|
||||||
let out = String::from_utf8_lossy(&output.stdout)
|
let output = String::from_utf8_lossy(&output.stdout);
|
||||||
.chars()
|
let out = output
|
||||||
.take(1)
|
.split(':')
|
||||||
.next()
|
.next()
|
||||||
.unwrap_or_else(|| std::process::exit(1));
|
.unwrap_or_else(|| std::process::exit(1));
|
||||||
|
|
||||||
out
|
out.to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn send_to_clipboard(out: String) {
|
fn send_to_clipboard(out: String) {
|
||||||
|
|
Loading…
Reference in a new issue