From 445a5232c23243eb783c06146a47634f30157dba Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Thu, 8 Oct 2026 18:03:21 +0200 Subject: [PATCH] gui: B3 plumbs without selecting; _ included in word chars B3 (right-click) on a word now plumbs it directly without visually selecting it first. Double-click word selection includes underscores, so snake_case selects the whole identifier. --- kde/gui/ChatBlockDelegate.qml | 10 ++++------ kde/gui/TextSelection.js | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/kde/gui/ChatBlockDelegate.qml b/kde/gui/ChatBlockDelegate.qml index caada67..4c47796 100644 --- a/kde/gui/ChatBlockDelegate.qml +++ b/kde/gui/ChatBlockDelegate.qml @@ -248,7 +248,7 @@ Column { if (sel && sel.trim() !== "") { plumber.plumb(sel.trim(), sessionCwd()) } else { - selectAndPlumb(mainTextEdit, mouse.x, mouse.y) + plumbWordAt(mainTextEdit, mouse.x, mouse.y) } } mouse.accepted = true @@ -359,13 +359,11 @@ Column { return {start: start, end: end, word: text.substring(start, end)} } - // Select word at cursor and plumb it (with visual highlight) - function selectAndPlumb(textEdit, mouseX, mouseY) { + // Plumb word at cursor (no selection) + function plumbWordAt(textEdit, mouseX, mouseY) { var pos = textEdit.positionAt(mouseX, mouseY) var result = wordAtCursor(textEdit, pos) if (result) { - // Select the word to show what's being plumbed - textEdit.select(result.start, result.end) plumber.plumb(result.word, sessionCwd()) } } @@ -428,7 +426,7 @@ Column { if (sel && sel.trim() !== "") { plumber.plumb(sel.trim(), sessionCwd()) } else { - selectAndPlumb(textEdit, mouse.x, mouse.y) + plumbWordAt(textEdit, mouse.x, mouse.y) } } mouse.accepted = true diff --git a/kde/gui/TextSelection.js b/kde/gui/TextSelection.js index a00af3d..4e8ae64 100644 --- a/kde/gui/TextSelection.js +++ b/kde/gui/TextSelection.js @@ -154,7 +154,7 @@ function selectWordAt(textEdit, mouseX, mouseY) { if (cursorPos < 0 || cursorPos > text.length) return function isword(ch) { - return /[A-Za-z0-9]/.test(ch) + return /[A-Za-z0-9_]/.test(ch) } var start = cursorPos