| 1 | //! KVT-fork: een BC-link uit de picker invoegen (zie `crate::kvt`). |
| 2 | |
| 3 | use gpui_kit::*; |
| 4 | |
| 5 | use super::Composer; |
| 6 | |
| 7 | impl 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 | } |