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