Tagging: Replace tag search anywhere in text (to support adding tags after writing text)

This commit is contained in:
Bu5hm4nn 2023-10-25 15:51:51 -06:00
parent 51baa10607
commit 3b5fb1679d

View File

@ -602,17 +602,15 @@ fn real_posting_area(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Fram
"".to_string()
};
// replace with nostr url
let nostr_url: NostrUrl = pair.1.into();
let nurl = format!("{}", nostr_url);
app.draft_data.draft = app
.draft_data
.draft
.trim_end_matches(format!("@{}", search).as_str())
.replace(&format!("@{}", search), &nurl)
.to_string();
// replace with nostr url
let nostr_url: NostrUrl = pair.1.into();
app.draft_data
.draft
.push_str(&format!("{} ", nostr_url));
app.draft_data.tag_someone = "".to_owned();
// mover cursor to end