windows: Improve platform clipboard (#11553)
I thought platform clipboard should share one ctx. and fixed in vim mode, read from clipboard crash when using `unwrap`. Release Notes: - N/A
This commit is contained in:
parent
1b292d2fb3
commit
2e0811e113
1 changed files with 1 additions and 1 deletions
|
@ -684,7 +684,7 @@ impl Platform for WindowsPlatform {
|
|||
|
||||
fn read_from_clipboard(&self) -> Option<ClipboardItem> {
|
||||
let mut ctx = ClipboardContext::new().unwrap();
|
||||
let content = ctx.get_contents().unwrap();
|
||||
let content = ctx.get_contents().ok()?;
|
||||
Some(ClipboardItem {
|
||||
text: content,
|
||||
metadata: None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue