headers-vy
headers-vy copied to clipboard
Section comment is not registering in the clipboard on Ubuntu 24
Hey :wave:
I know this is an old repo, but it was still presented at the Cyfrin course on Vyper. And since I am learning Rust alongside, I wanted to use this first to make clean comment section.
But it would not save it on my clipboard, rather it was deleting what I had previously inside. So I have forked the repo and ran some tests (even though I am beginning in rust). I have gone to the rust-clipboard repo to see if there is an issue related.
I found this solution related to what I experienced:
use clipboard::ClipboardProvider;
use clipboard::ClipboardContext;
fn main() {
let mut ctx: ClipboardContext = ClipboardProvider::new().unwrap();
ctx.set_contents("My name is Pablo".to_owned()).unwrap();
ctx.get_contents(); --> HERE IS WHAT IS MISSING
}
That is a strange behavior, but apparently we need to call ctx.get_contents(); to get it inside our clipboard.
I'll make a PR with my forked fix tested locally if it can help!