mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-29 00:11:01 +00:00
Merge pull request #716 from bu5hm4nn/fix/do-tag-replacements-only-once-per-tag
Tagging: Do tag replacements only once per tag
This commit is contained in:
commit
a72cea172c
@ -798,6 +798,7 @@ fn calc_tag_hovers(ui: &mut Ui, app: &mut GossipUi, output: &TextEditOutput) {
|
||||
);
|
||||
|
||||
hovers.insert(popup_id, popup);
|
||||
break; // only one popup per tag, first match wins
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -862,7 +863,7 @@ fn do_replacements(draft: &str, replacements: &HashMap<String, ContentSegment>)
|
||||
if let ContentSegment::NostrUrl(nostr_url) = content {
|
||||
output = output
|
||||
.as_str()
|
||||
.replace(pat, format!("nostr:{}", nostr_url.0).as_str())
|
||||
.replacen(pat, format!("nostr:{}", nostr_url.0).as_str(), 1)
|
||||
.to_string();
|
||||
}
|
||||
}
|
||||
|
@ -142,7 +142,18 @@ pub(in crate::ui) fn show_contact_search(
|
||||
if is_selected {
|
||||
response.scroll_to_me(None)
|
||||
}
|
||||
let clicked = response.interact(egui::Sense::click()).clicked();
|
||||
|
||||
// to workaround https://github.com/emilk/egui/issues/4147
|
||||
// we will interact again, OVER the painted avatar and text
|
||||
let response = ui
|
||||
.interact(
|
||||
response.rect,
|
||||
ui.auto_id_with(pair.1.as_hex_string()).with(2),
|
||||
egui::Sense::click(),
|
||||
)
|
||||
.on_hover_cursor(egui::CursorIcon::PointingHand);
|
||||
|
||||
let clicked = response.clicked();
|
||||
if clicked || (enter_key && is_selected) {
|
||||
on_select_callback(ui, app, output, pair);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user