feat: allow triggering suggestions without prefix space (#1826, fix #1384)

This commit is contained in:
Jakob Košir
2021-09-06 22:25:41 +02:00
committed by GitHub
parent a03aa2c232
commit 4dd0d6d4dc
2 changed files with 6 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ export interface SuggestionOptions {
char?: string,
allowSpaces?: boolean,
startOfLine?: boolean,
prefixSpace?: boolean,
decorationTag?: string,
decorationClass?: string,
command?: (props: {
@@ -53,6 +54,7 @@ export function Suggestion({
editor,
char = '@',
allowSpaces = false,
prefixSpace = true,
startOfLine = false,
decorationTag = 'span',
decorationClass = 'suggestion',
@@ -173,6 +175,7 @@ export function Suggestion({
const match = findSuggestionMatch({
char,
allowSpaces,
prefixSpace,
startOfLine,
$position: selection.$from,
})