mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-19 13:31:24 +02:00
also look backwards into commands for last word to tab-complete
This commit is contained in:
parent
00d81eece9
commit
fdd23b34ae
@ -306,7 +306,11 @@ export default class BasicMessageEditor extends React.Component {
|
|||||||
const position = model.positionForOffset(caret.offset, caret.atNodeEnd);
|
const position = model.positionForOffset(caret.offset, caret.atNodeEnd);
|
||||||
const range = model.startRange(position);
|
const range = model.startRange(position);
|
||||||
range.expandBackwardsWhile((index, offset, part) => {
|
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;
|
const {partCreator} = model;
|
||||||
// await for auto-complete to be open
|
// await for auto-complete to be open
|
||||||
|
Loading…
x
Reference in New Issue
Block a user