Skip to content

Commit b1d446a

Browse files
authored
Merge pull request #337 from eccenca/feature/keyValueParameterType-CMEM-6277
Do not calculate relative offset for highlighting ranges received from parse errors
2 parents 59cbd95 + faae1b7 commit b1d446a

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ This is a major release, and it might be not compatible with your current usage
5151

5252
- `<Modal />`:
5353
- Add 'nopan', 'nowheel' and 'nodrag' classes to Modal's overlay classes in order to always prevent react-flow to react to drag and pan actions in modals.
54+
- `<CodeAutocompleteField />`:
55+
- In multiline mode, validation errors might be highlighted incorrectly (relative line offset added).
5456

5557
### Changed
5658

src/components/AutoSuggestion/AutoSuggestion.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,11 @@ const AutoSuggestion = ({
317317
};
318318
if (parseError) {
319319
const { message, start, end } = parseError;
320-
const { toOffset, fromOffset } = getOffsetRange(cm, start, end);
321320
clearCurrentErrorMarker();
322321
const { from, to } = markText({
323322
view: cm,
324-
from: fromOffset,
325-
to: toOffset,
323+
from: start,
324+
to: end,
326325
className: `${eccgui}-autosuggestion__text--highlighted-error`,
327326
title: message,
328327
});

0 commit comments

Comments
 (0)