Merge pull request #24 from log-li/fix/markdown-editor-selection-insert

fix: enable selection-to-conversation popup in the markdown editor
This commit is contained in:
Atlas Zeng authored and GitHub committed 2026-08-15 22:47:21 +08:00
commit ecebc97800
1 file changed
+2 -2
+2 -2
View File
@@ -141,11 +141,11 @@ export function TextEditor(props: FileViewerProps) {
...defaultKeymap, ...defaultKeymap,
...historyKeymap, ...historyKeymap,
]), ]),
// Selection popup (the catch-all code viewer only): a non-empty // Selection popup (the code and markdown editors): a non-empty
// selection anchors the floating "add to conversation" button above // selection anchors the floating "add to conversation" button above
// its head. Scrolling (geometry/viewport change) or losing focus // its head. Scrolling (geometry/viewport change) or losing focus
// hides it; typing collapses the selection and hides it too. // hides it; typing collapses the selection and hides it too.
...(viewerId === 'code' ? [ ...(viewerId === 'code' || viewerId === 'markdown' ? [
CodeMirrorView.updateListener.of((update) => { CodeMirrorView.updateListener.of((update) => {
if (update.geometryChanged || update.viewportChanged) { if (update.geometryChanged || update.viewportChanged) {
hidePopup() hidePopup()