Skip to content

Commit

Permalink
Initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
stratoula committed Sep 4, 2023
1 parent faa4fe9 commit e4d8dfe
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/kbn-text-based-editor/src/text_based_languages_editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,16 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({
}
}, [calculateVisibleCode, code, isCompactFocused, queryString]);

useEffect(() => {
if (isCodeEditorExpanded) {
const pipes = code?.split('|');
const pipesWithNewLine = code?.split('\n|');
if (pipes?.length === pipesWithNewLine?.length) {
setIsWordWrapped(true);
}
}
}, [code, isCodeEditorExpanded]);

const onResize = ({ width }: { width: number }) => {
calculateVisibleCode(width);
if (editor1.current) {
Expand Down

0 comments on commit e4d8dfe

Please sign in to comment.