mirror of
https://github.com/encounter/objdiff.git
synced 2025-12-17 08:57:25 +00:00
Support more string encodings and allow copying unescaped strings (#288)
* Copy strings without escape sequences in them * Add support for more encodings from encoding_rs Also use encoding_rs instead of CStr for UTF-8.
This commit is contained in:
@@ -871,19 +871,13 @@ pub fn context_menu_items_ui(
|
||||
match item {
|
||||
ContextItem::Copy { value, label } => {
|
||||
let mut job = LayoutJob::default();
|
||||
write_text("Copy ", appearance.text_color, &mut job, appearance.code_font.clone());
|
||||
write_text(
|
||||
"Copy \"",
|
||||
appearance.text_color,
|
||||
&mut job,
|
||||
appearance.code_font.clone(),
|
||||
);
|
||||
write_text(
|
||||
&value,
|
||||
&format!("{value:?}"),
|
||||
appearance.highlight_color,
|
||||
&mut job,
|
||||
appearance.code_font.clone(),
|
||||
);
|
||||
write_text("\"", appearance.text_color, &mut job, appearance.code_font.clone());
|
||||
if let Some(label) = label {
|
||||
write_text(" (", appearance.text_color, &mut job, appearance.code_font.clone());
|
||||
write_text(
|
||||
|
||||
Reference in New Issue
Block a user