From fdd23b34ae0cd11ab3c0831f69d5176f28cce40c Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 2 Sep 2019 11:27:22 +0200 Subject: [PATCH] also look backwards into commands for last word to tab-complete --- src/components/views/rooms/BasicMessageComposer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/BasicMessageComposer.js b/src/components/views/rooms/BasicMessageComposer.js index ec1fd3d276..4d746448ef 100644 --- a/src/components/views/rooms/BasicMessageComposer.js +++ b/src/components/views/rooms/BasicMessageComposer.js @@ -306,7 +306,11 @@ export default class BasicMessageEditor extends React.Component { const position = model.positionForOffset(caret.offset, caret.atNodeEnd); const range = model.startRange(position); range.expandBackwardsWhile((index, offset, part) => { - return part.text[offset] !== " " && (part.type === "plain" || part.type === "pill-candidate"); + return part.text[offset] !== " " && ( + part.type === "plain" || + part.type === "pill-candidate" || + part.type === "command" + ); }); const {partCreator} = model; // await for auto-complete to be open