scottyaslan commented on code in PR #10144:
URL: https://github.com/apache/nifi/pull/10144#discussion_r2246082156


##########
nifi-frontend/src/main/frontend/libs/shared/src/components/map-table/editors/text-editor/text-editor.component.ts:
##########
@@ -122,50 +158,67 @@ export class TextEditor {
         // needed to display the 'Set Empty String' checkbox, the action 
buttons,
         // and the resize handle. If the amount of spacing needed for 
additional UX is needed for the `.editor` is
         // changed then this value should also be updated.
-        this.editor.setSize('100%', event.height - 112);
+        this.editorStyling.width = '100%';
+        this.editorStyling.height = `${event.height - 152}px`;
     }
 
     preventDrag(event: MouseEvent): void {
         event.stopPropagation();
     }
 
-    codeMirrorLoaded(codeEditor: any): void {
-        this.editor = codeEditor.codeMirror;
-        // The `.text-editor` minimum height is set to 220px. This is the 
height of the `.editor` overlay. The
-        // height of the codemirror needs to be set in order to handle large 
amounts of text in the codemirror editor.
-        // The height of the codemirror should be the height of the `.editor` 
overlay minus the 112px of spacing
-        // needed to display the 'Set Empty String' checkbox, the action 
buttons,
-        // and the resize handle so the initial height of the codemirror when 
opening should be 108px for a 220px tall
-        // `.editor` overlay. If the initial height of that overlay changes 
then this initial height should also be
-        // updated.
-        this.editor.setSize('100%', 108);
-
-        if (!this.readonly) {
-            this.editor.focus();
-            this.editor.execCommand('selectAll');
-        }
-
+    codeMirrorLoaded(): void {
         // disabling of the input through the form isn't supported until 
codemirror
         // has loaded so we must disable again if the value is an empty string
         if (this.textEditorForm.get('setEmptyString')?.value) {
             this.textEditorForm.get('value')?.disable();
-            this.editor.setOption('readOnly', 'nocursor');
         }
     }
 
-    getOptions(): any {
-        return {
-            readOnly: this.readonly,
-            lineNumbers: true,
-            matchBrackets: true,
-            theme: 'nifi',
-            extraKeys: {
-                Enter: () => {
-                    if (this.textEditorForm.dirty && 
this.textEditorForm.valid) {
-                        this.okClicked();
+    getExtensions(): Extension[] {
+        const setup: Extension[] = [
+            lineNumbers(),
+            history(),
+            indentUnit.of('    '),
+            EditorView.lineWrapping,
+            rectangularSelection(),
+            crosshairCursor(),
+            EditorState.allowMultipleSelections.of(true),
+            indentOnInput(),
+            highlightSpecialChars(),
+            syntaxHighlighting(highlightStyle),
+            syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
+            bracketMatching(),
+            closeBrackets(),
+            highlightActiveLine(),
+            highlightSelectionMatches(),
+            [highlightActiveLineGutter(), Prec.highest(lineNumbers())],
+            foldGutter(),
+            markdown(),
+            xml(),

Review Comment:
   I think you are right. Just plain text here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to