Skip to content

Commit

Permalink
fix(suggester): add leadingChars
Browse files Browse the repository at this point in the history
  • Loading branch information
humyfred committed Jan 5, 2022
1 parent 760449e commit a1fb8b1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/hooks/Suggester.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ export default class Suggester extends SyntaxBase {
toHtml(wholeMatch, leadingChar, keyword, text) {
if (text) {
return (
this.suggester[keyword]?.echo?.call(this, text) || `<span class="cherry-suggestion">${keyword}${text}</span>`
this.suggester[keyword]?.echo?.call(this, text) || `${leadingChar}<span class="cherry-suggestion">${keyword}${text}</span>`
);
}
if (this.suggester[keyword]?.echo === false) {
return '';
return `${leadingChar}`;
}
if (!this.suggester[keyword]) {
return text;
return leadingChar + text;
}
return text ?? '';
return text ? leadingChar + text : `${leadingChar}`;
}

rule() {
Expand Down

0 comments on commit a1fb8b1

Please sign in to comment.