BlueGit

ict rusty-teams

Files

rusty-teams / crates / app / src / views / composer / kvt.rs

kvt.rs

kvt.rs 586 B Download Raw
1//! KVT-fork: een BC-link uit de picker invoegen (zie `crate::kvt`).
2
3use gpui_kit::*;
4
5use super::Composer;
6
7impl Composer {
8 /// Voegt `text` als link naar `url` in op de cursor (vervangt een selectie niet).
9 pub(crate) fn insert_kvt_link(
10 &mut self,
11 text: &str,
12 url: &str,
13 window: &mut Window,
14 cx: &mut Context<Self>,
15 ) {
16 let cursor = self.selection(cx).end;
17 let end = self.draft.insert_link(cursor, text, url);
18 self.commit(Some(end), window, cx);
19 self.focus(window, cx);
20 cx.notify();
21 }
22}