mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 10:33:41 -05:00
web/composer: allow autocompleting after newline
This commit is contained in:
parent
72e1bd428e
commit
1e73867b9b
1 changed files with 8 additions and 2 deletions
|
@ -175,7 +175,13 @@ const MessageComposer = () => {
|
|||
}
|
||||
} else if (area.selectionStart === area.selectionEnd) {
|
||||
const acType = charToAutocompleteType(newText?.slice(area.selectionStart - 1, area.selectionStart))
|
||||
if (acType && (area.selectionStart === 1 || newText?.[area.selectionStart - 2] === " ")) {
|
||||
if (
|
||||
acType && (
|
||||
area.selectionStart === 1
|
||||
|| newText?.[area.selectionStart - 2] === " "
|
||||
|| newText?.[area.selectionStart - 2] === "\n"
|
||||
)
|
||||
) {
|
||||
setAutocomplete({
|
||||
type: acType,
|
||||
query: "",
|
||||
|
|
Loading…
Add table
Reference in a new issue