Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor autocomplete - does not open in a second use #5290

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ export function TextRowContent({ blockIndex }: { blockIndex: number }) {

const checkPreviousChar = (data: string, anchorPos: number) => {
if (anchorPos > 1) {
const endContent = data.slice(anchorPos);
const endContent = data.slice(anchorPos - 2);

const contentToUse = endContent ? endContent : data;
const slicePositions = contentToUse.indexOf('{{') + 2;
const slicePositions = contentToUse.lastIndexOf('{') + 1;

const currentChar = contentToUse.charAt(slicePositions - 1);
const previousChar = contentToUse.charAt(slicePositions - 2);
Expand Down Expand Up @@ -114,7 +114,7 @@ export function TextRowContent({ blockIndex }: { blockIndex: number }) {

const endContent = data.slice(anchorPosition);

const slicePositions = endContent.indexOf('{{') + 2;
const slicePositions = endContent.lastIndexOf('{{') + 2;
const newEndContent = `${endContent.slice(0, slicePositions)}${value}${endContent.slice(slicePositions)}`;

const newContent = `${data.slice(0, anchorPosition)}${newEndContent}`;
Expand Down
Loading