lexgui 8.1.1 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/Avatar.d.ts +15 -0
- package/build/components/NodeTree.d.ts +51 -26
- package/build/components/Vector.d.ts +10 -9
- package/build/core/Event.d.ts +6 -26
- package/build/core/Namespace.js +1 -1
- package/build/core/Namespace.js.map +1 -1
- package/build/core/Panel.d.ts +538 -538
- package/build/extensions/AssetView.d.ts +7 -6
- package/build/extensions/AssetView.js +194 -155
- package/build/extensions/AssetView.js.map +1 -1
- package/build/extensions/Audio.js.map +1 -1
- package/build/extensions/CodeEditor.d.ts +358 -350
- package/build/extensions/CodeEditor.js +5054 -5022
- package/build/extensions/CodeEditor.js.map +1 -1
- package/build/extensions/DocMaker.js +330 -327
- package/build/extensions/DocMaker.js.map +1 -1
- package/build/extensions/GraphEditor.js +2754 -2760
- package/build/extensions/GraphEditor.js.map +1 -1
- package/build/extensions/Timeline.d.ts +668 -670
- package/build/extensions/Timeline.js +3948 -3955
- package/build/extensions/Timeline.js.map +1 -1
- package/build/extensions/VideoEditor.d.ts +128 -128
- package/build/extensions/VideoEditor.js +893 -898
- package/build/extensions/VideoEditor.js.map +1 -1
- package/build/index.css.d.ts +3 -4
- package/build/index.d.ts +57 -56
- package/build/lexgui.all.js +1587 -1369
- package/build/lexgui.all.js.map +1 -1
- package/build/lexgui.all.min.js +1 -1
- package/build/lexgui.all.module.js +1584 -1364
- package/build/lexgui.all.module.js.map +1 -1
- package/build/lexgui.all.module.min.js +1 -1
- package/build/lexgui.css +6157 -5583
- package/build/lexgui.js +977 -815
- package/build/lexgui.js.map +1 -1
- package/build/lexgui.min.css +2 -3
- package/build/lexgui.min.js +1 -1
- package/build/lexgui.module.js +975 -811
- package/build/lexgui.module.js.map +1 -1
- package/build/lexgui.module.min.js +1 -1
- package/changelog.md +52 -1
- package/demo.js +167 -65
- package/examples/all-components.html +38 -52
- package/examples/asset-view.html +27 -0
- package/examples/code-editor.html +1 -1
- package/examples/editor.html +10 -95
- package/examples/index.html +2 -2
- package/examples/side-bar.html +1 -1
- package/examples/timeline.html +2 -2
- package/examples/video-editor.html +1 -1
- package/examples/video-editor2.html +2 -2
- package/package.json +7 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.js","sources":["../../src/extensions/CodeEditor.ts"],"sourcesContent":["// CodeEditor.ts @jxarco\r\n\r\nimport { LX } from '../core/Namespace';\r\n\r\nif ( !LX )\r\n{\r\n throw ( 'Missing LX namespace!' );\r\n}\r\n\r\nLX.extensions.push( 'CodeEditor' );\r\n\r\nconst g = globalThis as any;\r\nconst vec2 = LX.vec2;\r\nconst Area = LX.Area;\r\nconst Panel = LX.Panel;\r\nconst Tree = LX.Tree;\r\nconst Tabs = LX.Tabs;\r\nconst ContextMenu = LX.ContextMenu;\r\n\r\nfunction swapElements( obj: any, a: string, b: string )\r\n{\r\n [ obj[a], obj[b] ] = [ obj[b], obj[a] ];\r\n}\r\nfunction swapArrayElements( array: number[], id0: number, id1: number )\r\n{\r\n [ array[id0], array[id1] ] = [ array[id1], array[id0] ];\r\n}\r\nfunction sliceChars( str: string, idx: number, n: number = 1 )\r\n{\r\n return str.substr( 0, idx ) + str.substr( idx + n );\r\n}\r\nfunction firstNonspaceIndex( str: string )\r\n{\r\n const index = str.search( /\\S|$/ );\r\n return index < str.length ? index : -1;\r\n}\r\nfunction strReverse( str: string )\r\n{\r\n return str.split( '' ).reverse().join( '' );\r\n}\r\nfunction isLetter( c: string )\r\n{\r\n return /[a-zA-Z]/.test( c );\r\n}\r\nfunction isSymbol( c: string )\r\n{\r\n return /[^\\w\\s]/.test( c );\r\n}\r\n\r\nfunction indexOfFrom( str: string, reg: string, from?: number, reverse: boolean = false )\r\n{\r\n from = from ?? 0;\r\n\r\n if ( reverse )\r\n {\r\n str = str.substring( 0, from );\r\n var k = from - 1;\r\n while ( str[k] && str[k] != reg )\r\n {\r\n k--;\r\n }\r\n return str[k] ? k : -1;\r\n }\r\n else\r\n {\r\n str = str.substring( from );\r\n return from + str.indexOf( reg );\r\n }\r\n}\r\n\r\nfunction codeScopesEqual( a: any, b: any )\r\n{\r\n if ( a.length !== b.length ) return false;\r\n for ( let i = 0; i < a.length; i++ )\r\n {\r\n if ( a[i].type !== b[i].type ) return false;\r\n }\r\n return true;\r\n}\r\n\r\nclass Cursor\r\n{\r\n root: any;\r\n name: string = '';\r\n editor: CodeEditor;\r\n isMain: boolean = false;\r\n selection: CodeSelection | null = null;\r\n\r\n private _line: number = 0;\r\n private _position: number = 0;\r\n\r\n get line(): number\r\n {\r\n return this._line;\r\n }\r\n set line( v: number )\r\n {\r\n this._line = v;\r\n if ( this.isMain ) this.editor._setActiveLine( v );\r\n }\r\n\r\n get position(): number\r\n {\r\n return this._position;\r\n }\r\n set position( v: number )\r\n {\r\n this._position = v;\r\n if ( this.isMain )\r\n {\r\n const activeLine = this.editor.state.activeLine;\r\n this.editor._updateDataInfoPanel( '@cursor-data', `Ln ${activeLine + 1}, Col ${v + 1}` );\r\n }\r\n }\r\n\r\n left: number = 0;\r\n top: number = 0;\r\n\r\n constructor( name: string, position: number = 0, line: number = 0, isMain: boolean = false, editor: CodeEditor )\r\n {\r\n this.name = name;\r\n this.editor = editor;\r\n this.isMain = isMain;\r\n\r\n this.root = document.createElement( 'div' );\r\n this.root.name = name;\r\n this.root.className = 'cursor';\r\n this.root.innerHTML = ' ';\r\n\r\n this.set( position, line, false );\r\n }\r\n\r\n set( position: number = 0, line: number = 0, updateEditor: boolean = true )\r\n {\r\n this.left = position * this.editor.charWidth;\r\n this.top = line * this.editor.lineHeight;\r\n this.root.style.left = `calc( ${this.left}px + ${this.editor.xPadding} )`;\r\n this.root.style.top = `${this.top}px`;\r\n\r\n if ( updateEditor )\r\n {\r\n this.line = line;\r\n this.position = position;\r\n }\r\n else\r\n {\r\n this._line = line;\r\n this._position = position;\r\n }\r\n }\r\n\r\n print()\r\n {\r\n console.log( this.line, this.position );\r\n }\r\n\r\n isLast(): boolean\r\n {\r\n return ( this.editor._getLastCursor() == this );\r\n }\r\n}\r\n\r\nclass CodeSelection\r\n{\r\n fromX: number;\r\n toX: number;\r\n fromY: number;\r\n toY: number;\r\n chars: number = 0;\r\n\r\n editor: CodeEditor;\r\n cursor: Cursor;\r\n className: string;\r\n\r\n constructor( editor: CodeEditor, cursor: Cursor, className: string = 'lexcodeselection' )\r\n {\r\n this.editor = editor;\r\n this.cursor = cursor;\r\n this.className = className;\r\n\r\n this.fromX = cursor.position;\r\n this.toX = cursor.position;\r\n this.fromY = cursor.line;\r\n this.toY = cursor.line;\r\n }\r\n\r\n sameLine()\r\n {\r\n return this.fromY === this.toY;\r\n }\r\n\r\n samePosition()\r\n {\r\n return this.fromX === this.toX;\r\n }\r\n\r\n isEmpty()\r\n {\r\n return this.sameLine() && this.samePosition();\r\n }\r\n\r\n invertIfNecessary()\r\n {\r\n if ( this.fromY > this.toY )\r\n {\r\n swapElements( this, 'fromX', 'toX' );\r\n swapElements( this, 'fromY', 'toY' );\r\n }\r\n else if ( this.sameLine() && this.fromX > this.toX )\r\n {\r\n swapElements( this, 'fromX', 'toX' );\r\n }\r\n }\r\n\r\n selectInline( cursor: Cursor, x: number, y: number, width: number, isSearchResult?: boolean )\r\n {\r\n this.chars = width / this.editor.charWidth;\r\n this.fromX = x;\r\n this.toX = x + this.chars;\r\n this.fromY = this.toY = y;\r\n\r\n var domEl: any = document.createElement( 'div' );\r\n domEl.className = this.className;\r\n domEl._top = y * this.editor.lineHeight;\r\n domEl.style.top = domEl._top + 'px';\r\n domEl._left = x * this.editor.charWidth;\r\n domEl.style.left = 'calc(' + domEl._left + 'px + ' + this.editor.xPadding + ')';\r\n domEl.style.width = width + 'px';\r\n\r\n if ( isSearchResult )\r\n {\r\n this.editor.searchResultSelections.appendChild( domEl );\r\n }\r\n else\r\n {\r\n this.editor.selections[cursor.name].appendChild( domEl );\r\n }\r\n\r\n // Hide active line background\r\n this.editor._hideActiveLine();\r\n }\r\n\r\n save()\r\n {\r\n return {\r\n fromX: this.fromX,\r\n fromY: this.fromY,\r\n toX: this.toX,\r\n toY: this.toY\r\n };\r\n }\r\n\r\n load( data: any )\r\n {\r\n this.fromX = data.fromX;\r\n this.fromY = data.fromY;\r\n this.toX = data.toX;\r\n this.toY = data.toY;\r\n }\r\n\r\n getText()\r\n {\r\n if ( !this.editor.code || !this.sameLine() )\r\n {\r\n return null;\r\n }\r\n\r\n return this.editor.code.lines[this.fromY].substring( this.fromX, this.toX );\r\n }\r\n}\r\n\r\nclass ScrollBar\r\n{\r\n static SCROLLBAR_VERTICAL = 1;\r\n static SCROLLBAR_HORIZONTAL = 2;\r\n\r\n static SCROLLBAR_VERTICAL_WIDTH = 10;\r\n static SCROLLBAR_HORIZONTAL_HEIGHT = 10;\r\n\r\n editor: CodeEditor;\r\n type: number;\r\n root: any;\r\n thumb: any;\r\n lastPosition: typeof vec2;\r\n\r\n constructor( editor: CodeEditor, type: number )\r\n {\r\n this.editor = editor;\r\n this.type = type;\r\n\r\n this.root = document.createElement( 'div' );\r\n this.root.className = 'lexcodescrollbar hidden';\r\n\r\n if ( type & ScrollBar.SCROLLBAR_VERTICAL )\r\n {\r\n this.root.classList.add( 'vertical' );\r\n }\r\n else if ( type & ScrollBar.SCROLLBAR_HORIZONTAL )\r\n {\r\n this.root.classList.add( 'horizontal' );\r\n }\r\n\r\n this.thumb = document.createElement( 'div' );\r\n this.thumb._top = 0;\r\n this.thumb._left = 0;\r\n\r\n this.root.appendChild( this.thumb );\r\n\r\n this.thumb.addEventListener( 'mousedown', inner_mousedown );\r\n\r\n this.lastPosition = new LX.vec2( 0, 0 );\r\n\r\n let that = this;\r\n\r\n function inner_mousedown( e: MouseEvent )\r\n {\r\n var doc = editor.root.ownerDocument;\r\n doc.addEventListener( 'mousemove', inner_mousemove );\r\n doc.addEventListener( 'mouseup', inner_mouseup );\r\n that.lastPosition.set( e.x, e.y );\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n\r\n function inner_mousemove( e: MouseEvent )\r\n {\r\n var dt = that.lastPosition.sub( new LX.vec2( e.x, e.y ) );\r\n if ( that.type & ScrollBar.SCROLLBAR_VERTICAL )\r\n {\r\n editor.updateVerticalScrollFromScrollBar( dt.y );\r\n }\r\n else\r\n {\r\n editor.updateHorizontalScrollFromScrollBar( dt.x );\r\n }\r\n that.lastPosition.set( e.x, e.y );\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n\r\n function inner_mouseup( e: MouseEvent )\r\n {\r\n var doc = editor.root.ownerDocument;\r\n doc.removeEventListener( 'mousemove', inner_mousemove );\r\n doc.removeEventListener( 'mouseup', inner_mouseup );\r\n }\r\n }\r\n}\r\n\r\n/* Highlight rules\r\n- test: function that receives a context object and returns true or false\r\n- className: class to apply if test is true\r\n- action: optional function to execute if test is true, receives context and editor as parameter\r\n- discard: optional boolean, if true the token is discarded, action value is returned\r\n to \"ctx.discardToken\" and no class is applied\r\n*/\r\n\r\nconst HighlightRules: Record<string, any> = {\r\n common: [\r\n { test: ( ctx: any ) => ctx.inBlockComment, className: 'cm-com' },\r\n { test: ( ctx: any ) => ctx.inString,\r\n action: ( ctx: any, editor: CodeEditor ) => editor._appendStringToken( ctx.token ), discard: true },\r\n { test: ( ctx: any ) => ctx.token.substr( 0, ctx.singleLineCommentToken.length ) == ctx.singleLineCommentToken,\r\n className: 'cm-com' },\r\n { test: ( ctx: any, editor: CodeEditor ) => editor._isKeyword( ctx ), className: 'cm-kwd' },\r\n {\r\n test: ( ctx: any, editor: CodeEditor ) =>\r\n editor._mustHightlightWord( ctx.token, CE.builtIn, ctx.lang ) && ( ctx.lang.tags ?? false\r\n ? ( editor._enclosedByTokens( ctx.token, ctx.tokenIndex, '<', '>' ) )\r\n : true ),\r\n className: 'cm-bln'\r\n },\r\n { test: ( ctx: any, editor: CodeEditor ) => editor._mustHightlightWord( ctx.token, CE.statements, ctx.lang ),\r\n className: 'cm-std' },\r\n { test: ( ctx: any, editor: CodeEditor ) => editor._mustHightlightWord( ctx.token, CE.symbols, ctx.lang ),\r\n className: 'cm-sym' },\r\n { test: ( ctx: any, editor: CodeEditor ) => editor._mustHightlightWord( ctx.token, CE.types, ctx.lang ),\r\n className: 'cm-typ' },\r\n {\r\n test: ( ctx: any, editor: CodeEditor ) =>\r\n editor._isNumber( ctx.token ) || editor._isNumber( ctx.token.replace( /[px]|[em]|%/g, '' ) ),\r\n className: 'cm-dec'\r\n },\r\n { test: ( ctx: any ) => ctx.lang.usePreprocessor && ctx.token.includes( '#' ), className: 'cm-ppc' }\r\n ],\r\n\r\n javascript: [\r\n { test: ( ctx: any ) => ( ctx.prev === 'class' && ctx.next === '{' ), className: 'cm-typ' }\r\n ],\r\n\r\n typescript: [\r\n { test: ( ctx: any ) => ctx.scope && ( ctx.token !== ',' && ctx.scope.type == 'enum' ), className: 'cm-enu' },\r\n {\r\n test: ( ctx: any ) =>\r\n ( ctx.prev === ':' && ctx.next !== undefined && isLetter( ctx.token ) )\r\n || ( ctx.prev === 'interface' && ctx.next === '{' ) || ( ctx.prev === 'enum' && ctx.next === '{' ),\r\n className: 'cm-typ'\r\n },\r\n {\r\n test: ( ctx: any ) =>\r\n ( ctx.prev === 'class' && ctx.next === '{' ) || ( ctx.prev === 'class' && ctx.next === '<' )\r\n || ( ctx.prev === 'new' && ctx.next === '(' ) || ( ctx.prev === 'new' && ctx.next === '<' ),\r\n className: 'cm-typ'\r\n },\r\n {\r\n test: ( ctx: any, editor: CodeEditor ) =>\r\n ctx.token !== ',' && editor._enclosedByTokens( ctx.token, ctx.tokenIndex, '<', '>' ),\r\n className: 'cm-typ'\r\n }\r\n ],\r\n\r\n cpp: [\r\n { test: ( ctx: any ) => ctx.scope && ( ctx.token !== ',' && ctx.scope.type == 'enum' ), className: 'cm-enu' },\r\n { test: ( ctx: any ) => ctx.isEnumValueSymbol( ctx.token ), className: 'cm-enu' },\r\n {\r\n test: ( ctx: any ) =>\r\n ( ctx.prev === 'class' && ctx.next === '{' ) || ( ctx.prev === 'struct' && ctx.next === '{' ),\r\n className: 'cm-typ'\r\n },\r\n { test: ( ctx: any ) => ctx.prev === '<' && ( ctx.next === '>' || ctx.next === '*' ), className: 'cm-typ' }, // Defining template type in C++\r\n { test: ( ctx: any ) => ctx.next === '::' || ( ctx.prev === '::' && ctx.next !== '(' ), className: 'cm-typ' }, // C++ Class\r\n { test: ( ctx: any ) => ctx.isClassSymbol( ctx.token ) || ctx.isStructSymbol( ctx.token ), className: 'cm-typ' }\r\n ],\r\n\r\n wgsl: [\r\n { test: ( ctx: any ) => ctx.prev === '>' && ( !ctx.next || ctx.next === '{' ), className: 'cm-typ' }, // Function return type\r\n {\r\n test: ( ctx: any ) =>\r\n ( ctx.prev === ':' && ctx.next !== undefined ) || ( ctx.prev === 'struct' && ctx.next === '{' ),\r\n className: 'cm-typ'\r\n },\r\n {\r\n test: ( ctx: any, editor: CodeEditor ) =>\r\n ctx.token !== ',' && editor._enclosedByTokens( ctx.token, ctx.tokenIndex, '<', '>' ),\r\n className: 'cm-typ'\r\n }\r\n ],\r\n\r\n css: [\r\n {\r\n test: (\r\n ctx: any\r\n ) => ( ctx.prev == '.' || ctx.prev == '::' || ( ctx.prev == ':' && ctx.next == '{' )\r\n || ( ctx.token[0] == '#' && ctx.prev != ':' ) ),\r\n className: 'cm-kwd'\r\n },\r\n { test: ( ctx: any ) => ctx.prev === ':' && ( ctx.next === ';' || ctx.next === '!important' ),\r\n className: 'cm-str' }, // CSS value\r\n { test: ( ctx: any ) => ( ctx.prev === undefined || ctx.prev === '{' || ctx.prev === ';' ) && ctx.next === ':',\r\n className: 'cm-typ' }, // CSS attribute\r\n { test: ( ctx: any ) => ctx.prev === '(' && ctx.next === ')' && ctx.token.startsWith( '--' ),\r\n className: 'cm-typ' } // CSS vars\r\n ],\r\n\r\n batch: [\r\n { test: ( ctx: any ) => ctx.token === '@' || ctx.prev === ':' || ctx.prev === '@', className: 'cm-kwd' }\r\n ],\r\n\r\n markdown: [\r\n { test: ( ctx: any ) => ctx.isFirstToken && ctx.token.replaceAll( '#', '' ).length != ctx.token.length,\r\n action: ( ctx: any, editor: CodeEditor ) => editor._markdownHeader = true, className: 'cm-kwd' }\r\n ],\r\n\r\n php: [\r\n { test: ( ctx: any ) => ctx.token.startsWith( '$' ), className: 'cm-var' },\r\n {\r\n test: ( ctx: any ) =>\r\n ( ctx.prev === 'class' && ( ctx.next === '{' || ctx.next === 'implements' ) )\r\n || ( ctx.prev === 'enum' ),\r\n className: 'cm-typ'\r\n }\r\n ],\r\n\r\n post_common: [\r\n {\r\n test: ( ctx: any ) =>\r\n isLetter( ctx.token ) && ( ctx.token[0] != '@' ) && ( ctx.token[0] != ',' ) && ( ctx.next === '(' ),\r\n className: 'cm-mtd'\r\n }\r\n ]\r\n};\r\n\r\n/**\r\n * @class CodeEditor\r\n */\r\n\r\nexport class CodeEditor\r\n{\r\n static __instances: CodeEditor[] = [];\r\n\r\n static CURSOR_LEFT = 1;\r\n static CURSOR_TOP = 2;\r\n static CURSOR_LEFT_TOP = CodeEditor.CURSOR_LEFT | CodeEditor.CURSOR_TOP;\r\n\r\n static SELECTION_X = 1;\r\n static SELECTION_Y = 2;\r\n static SELECTION_X_Y = CodeEditor.SELECTION_X | CodeEditor.SELECTION_Y;\r\n\r\n static KEEP_VISIBLE_LINES = 1;\r\n static UPDATE_VISIBLE_LINES = 2;\r\n\r\n static WORD_TYPE_METHOD = 0;\r\n static WORD_TYPE_CLASS = 1;\r\n\r\n static CODE_MIN_FONT_SIZE = 9;\r\n static CODE_MAX_FONT_SIZE = 22;\r\n\r\n static LINE_GUTTER_WIDTH = 48;\r\n\r\n static RESIZE_SCROLLBAR_H = 1;\r\n static RESIZE_SCROLLBAR_V = 2;\r\n static RESIZE_SCROLLBAR_H_V = CodeEditor.RESIZE_SCROLLBAR_H | CodeEditor.RESIZE_SCROLLBAR_V;\r\n\r\n static languages: Record<string, any> = {};\r\n static keywords: any;\r\n static utils: any;\r\n static types: any;\r\n static builtIn: any;\r\n static statements: any;\r\n static declarationKeywords: any;\r\n static symbols: any;\r\n static nativeTypes: any;\r\n\r\n static debugScopes: boolean = false;\r\n static debugSymbols: boolean = false;\r\n static debugProcessedLines: boolean = false;\r\n\r\n static _staticReady: boolean = false;\r\n\r\n // Layout\r\n root: any;\r\n baseArea: typeof Area;\r\n area: typeof Area;\r\n codeArea: typeof Area;\r\n explorerArea: any;\r\n code: any;\r\n gutter!: HTMLElement;\r\n xPadding: string = '0px';\r\n hScrollbar!: ScrollBar;\r\n vScrollbar!: ScrollBar;\r\n codeScroller: any;\r\n codeSizer: any;\r\n explorer: typeof Tree;\r\n tabs: typeof Tabs;\r\n cursorsDOM: any;\r\n cursors: Cursor[] = [];\r\n mustProcessLines: boolean = false;\r\n blinker: any;\r\n statusPanel: typeof Panel;\r\n leftStatusPanel: typeof Panel;\r\n rightStatusPanel: typeof Panel;\r\n lineScrollMargin: typeof vec2;\r\n autocomplete!: HTMLElement;\r\n searchbox!: HTMLElement;\r\n searchlinebox!: HTMLElement;\r\n\r\n // Editor\r\n openedTabs: Record<string, any> = {};\r\n loadedTabs: Record<string, any> = {};\r\n actions: Record<string, any> = {};\r\n state!: Record<string, any>;\r\n pairKeys!: Record<string, string>;\r\n stringKeys!: Record<string, string>;\r\n visibleLinesViewport: typeof vec2 = new LX.vec2( 0, 0 );\r\n searchResultSelections: any;\r\n firstLineInViewport: number = -1;\r\n selections: Record<string, any> = {};\r\n specialKeys!: string[];\r\n canOpenContextMenu: boolean = true;\r\n wasKeyPaired: boolean | undefined = undefined;\r\n mustProcessNextLine!: (( s: string[] ) => boolean) | undefined;\r\n mustProcessPreviousLine!: (( s: string[] ) => boolean) | undefined;\r\n\r\n // Code\r\n cursorBlinkRate: number = 550;\r\n tabSpaces: number = 4;\r\n maxUndoSteps: number = 16;\r\n lineHeight: number = 20;\r\n charWidth: number = 7; // To update later depending on size..\r\n fontSize: number = 14;\r\n defaultSingleLineCommentToken: string = '//';\r\n defaultBlockCommentTokens: string[] = [ '/*', '*/' ];\r\n isAutoCompleteActive: boolean = false;\r\n isSearchboxActive: boolean = false;\r\n isSearchlineboxActive: boolean = false;\r\n\r\n // Editor options\r\n skipInfo: boolean = false;\r\n disableEdition: boolean = false;\r\n skipTabs: boolean = false;\r\n useFileExplorer: boolean = false;\r\n useAutoComplete: boolean = true;\r\n allowClosingTabs: boolean = true;\r\n allowLoadingFiles: boolean = true;\r\n highlight: string = 'Plain Text';\r\n explorerName: string = 'EXPLORER';\r\n newTabOptions: any;\r\n customSuggestions: any[] = [];\r\n\r\n // Editor callbacks\r\n onSave: any;\r\n onRun: any;\r\n onCtrlSpace: any;\r\n onCreateStatusPanel: any;\r\n onContextMenu: any;\r\n onNewTab: any;\r\n onSelectTab: any;\r\n onCreateFile: any;\r\n\r\n // Inner functions\r\n addExplorerItem: any;\r\n\r\n // Temp variables\r\n _lastTime: any = null;\r\n _lastProcessedLine: number = -1;\r\n _lastResult: any = undefined;\r\n _lastSelectionKeyDir: any = undefined;\r\n _lastProcessedCursorIndex: any = null;\r\n _lastMaxLineLength: number | undefined = undefined;\r\n _lastMouseDown: number = 0;\r\n _lastTextFound: string = '';\r\n _lastBaseareaWidth: number | undefined = undefined;\r\n _blockCommentCache: any[] = [];\r\n _pendingString: string | undefined = undefined;\r\n _skipTabs: number | undefined = undefined;\r\n _discardScroll: boolean = false;\r\n _markdownHeader: any = undefined;\r\n _tabStorage: Record<string, any> = {};\r\n _tripleClickSelection: any = undefined;\r\n _currentOcurrences: any = undefined;\r\n _currentLineNumber: number | undefined = undefined;\r\n _currentLineString: string | undefined = undefined;\r\n _currentTokenPositions: any = undefined;\r\n _buildingBlockComment: any = undefined;\r\n _buildingString: any = undefined;\r\n _verticalTopOffset: number = -1;\r\n _verticalBottomOffset: number = -1;\r\n _fullVerticalOffset: number = -1;\r\n _scopeStack: any = null;\r\n _mouseDown: boolean | undefined = undefined;\r\n _scopesUpdated: boolean | undefined = undefined;\r\n _stringEnded: boolean = false;\r\n _stringInterpolation: boolean | undefined = undefined;\r\n _stringInterpolationOpened: boolean | undefined = undefined;\r\n\r\n constructor( area: typeof Area, options: any = {} )\r\n {\r\n if ( options.filesAsync )\r\n {\r\n options.files = [ ...options.filesAsync ];\r\n\r\n const instance: any = ( async () => {\r\n await this._init( area, options );\r\n // Constructors return `this` implicitly, but this is an IIFE, so\r\n // return `this` explicitly (else we'd return an empty object).\r\n return this;\r\n } )();\r\n return instance;\r\n }\r\n else\r\n {\r\n this._init( area, options );\r\n }\r\n }\r\n\r\n async _init( area: typeof Area, options: any = {} ): Promise<void>\r\n {\r\n g.editor = this;\r\n\r\n CodeEditor.__instances.push( this );\r\n\r\n this.skipInfo = options.skipInfo ?? this.skipInfo;\r\n this.disableEdition = options.disableEdition ?? this.disableEdition;\r\n this.skipTabs = options.skipTabs ?? this.skipTabs;\r\n this.useFileExplorer = ( options.fileExplorer ?? this.useFileExplorer ) && !this.skipTabs;\r\n this.useAutoComplete = options.autocomplete ?? this.useAutoComplete;\r\n this.allowClosingTabs = options.allowClosingTabs ?? this.allowClosingTabs;\r\n this.allowLoadingFiles = options.allowLoadingFiles ?? this.allowLoadingFiles;\r\n this.highlight = options.highlight ?? this.highlight;\r\n this.newTabOptions = options.newTabOptions;\r\n this.customSuggestions = options.customSuggestions ?? [];\r\n this.explorerName = options.explorerName ?? this.explorerName;\r\n\r\n // Editor callbacks\r\n this.onSave = options.onSave ?? options.onsave; // LEGACY onsave\r\n this.onRun = options.onRun ?? options.onrun; // LEGACY onrun\r\n this.onCtrlSpace = options.onCtrlSpace;\r\n this.onCreateStatusPanel = options.onCreateStatusPanel;\r\n this.onContextMenu = options.onContextMenu;\r\n this.onNewTab = options.onNewTab;\r\n this.onSelectTab = options.onSelectTab;\r\n\r\n // File explorer\r\n if ( this.useFileExplorer )\r\n {\r\n let [ explorerArea, editorArea ] = area.split( { sizes: [ '15%', '85%' ] } );\r\n // explorerArea.setLimitBox( 180, 20, 512 );\r\n this.explorerArea = explorerArea;\r\n\r\n let panel = new LX.Panel();\r\n\r\n panel.addTitle( this.explorerName );\r\n\r\n let sceneData: any[] = [];\r\n\r\n this.explorer = panel.addTree( null, sceneData, {\r\n filter: false,\r\n rename: false,\r\n skipDefaultIcon: true,\r\n onevent: ( event: typeof LX.TreeEvent ) => {\r\n switch ( event.type )\r\n {\r\n // case LX.TreeEvent.NODE_SELECTED:\r\n // if( !this.tabs.tabDOMs[ event.node.id ] ) break;\r\n case LX.TreeEvent.NODE_DBLCLICKED:\r\n this.loadTab( event.node.id );\r\n break;\r\n case LX.TreeEvent.NODE_DELETED:\r\n this.closeTab( event.node.id );\r\n break;\r\n // case LX.TreeEvent.NODE_CONTEXTMENU:\r\n // LX.addContextMenu( event.multiple ? \"Selected Nodes\" : event.node.id, event.value, m => {\r\n //\r\n // });\r\n // break;\r\n // case LX.TreeEvent.NODE_DRAGGED:\r\n // console.log(event.node.id + \" is now child of \" + event.value.id);\r\n // break;\r\n }\r\n }\r\n } );\r\n\r\n this.addExplorerItem = function( item: any )\r\n {\r\n if ( !this.explorer.innerTree.data.find( ( value: any, index: number ) => value.id === item.id ) )\r\n {\r\n this.explorer.innerTree.data.push( item );\r\n }\r\n };\r\n\r\n explorerArea.attach( panel );\r\n\r\n // Update area\r\n area = editorArea;\r\n }\r\n\r\n this.baseArea = area;\r\n this.area = new LX.Area( { className: 'lexcodeeditor', height: '100%', skipAppend: true } );\r\n\r\n if ( !this.skipTabs )\r\n {\r\n this.tabs = this.area.addTabs( { onclose: ( name: string ) => {\r\n delete this.openedTabs[name];\r\n if ( Object.keys( this.openedTabs ).length < 2 )\r\n {\r\n clearInterval( this.blinker );\r\n LX.removeClas( this.cursorsDOM, 'show' );\r\n }\r\n } } );\r\n\r\n LX.addClass( this.tabs.root.parentElement, 'rounded-t-lg' );\r\n\r\n if ( !this.disableEdition )\r\n {\r\n this.tabs.root.parentElement.addEventListener( 'dblclick', ( e: MouseEvent ) => {\r\n if ( options.allowAddScripts ?? true )\r\n {\r\n e.preventDefault();\r\n this._onCreateNewFile();\r\n }\r\n } );\r\n }\r\n\r\n this.codeArea = this.tabs.area;\r\n }\r\n else\r\n {\r\n this.codeArea = new LX.Area( { skipAppend: true } );\r\n this.area.attach( this.codeArea );\r\n const loadFileButton = LX.makeElement( 'button',\r\n 'grid absolute self-center z-100 p-3 rounded-full bg-secondary hover:bg-tertiary cursor-pointer border',\r\n LX.makeIcon( 'FolderOpen' ).innerHTML, this.area, {\r\n bottom: '8px'\r\n } );\r\n loadFileButton.addEventListener( 'click', ( e: MouseEvent ) => {\r\n const dropdownOptions = [];\r\n\r\n for ( const [ key, value ] of [ ...Object.entries( this.loadedTabs ).slice( 1 ),\r\n ...Object.entries( this._tabStorage ) ] )\r\n {\r\n const icon = this._getFileIcon( key );\r\n const classes = icon ? icon.split( ' ' ) : [];\r\n dropdownOptions.push( {\r\n name: key,\r\n icon: classes[0],\r\n svgClass: classes.slice( 0 ).join( ' ' ),\r\n callback: ( entryName: string ) => {\r\n this.loadCode( entryName );\r\n }\r\n } );\r\n }\r\n\r\n new LX.DropdownMenu( loadFileButton, dropdownOptions, { side: 'top', align: 'center' } );\r\n } );\r\n }\r\n\r\n this.codeArea.root.classList.add( 'lexcodearea' );\r\n\r\n const codeResizeObserver = new ResizeObserver( ( entries ) => {\r\n if ( !this.code )\r\n {\r\n return;\r\n }\r\n\r\n this.resize();\r\n } );\r\n codeResizeObserver.observe( this.codeArea.root );\r\n\r\n // Full editor\r\n area.root.classList.add( 'codebasearea' );\r\n\r\n const observer = new MutationObserver( ( e ) => {\r\n if ( e[0].attributeName == 'style' )\r\n {\r\n this.resize();\r\n }\r\n } );\r\n\r\n observer.observe( area.root.parentNode, {\r\n attributes: true,\r\n attributeFilter: [ 'class', 'style' ]\r\n } );\r\n\r\n this.root = this.area.root;\r\n this.root.tabIndex = -1;\r\n area.attach( this.root );\r\n\r\n if ( !this.disableEdition )\r\n {\r\n this.root.addEventListener( 'keydown', this.processKey.bind( this ) );\r\n this.root.addEventListener( 'focus', this.processFocus.bind( this, true ) );\r\n this.root.addEventListener( 'focusout', this.processFocus.bind( this, false ) );\r\n }\r\n else\r\n {\r\n this.root.classList.add( 'disabled' );\r\n }\r\n\r\n this.root.addEventListener( 'mousedown', this.processMouse.bind( this ) );\r\n this.root.addEventListener( 'mouseup', this.processMouse.bind( this ) );\r\n this.root.addEventListener( 'mousemove', this.processMouse.bind( this ) );\r\n this.root.addEventListener( 'click', this.processMouse.bind( this ) );\r\n this.root.addEventListener( 'contextmenu', this.processMouse.bind( this ) );\r\n\r\n // Add mouseup event to document as well to detect when selections end\r\n document.body.addEventListener( 'mouseup', this._onMouseUp.bind( this ) );\r\n\r\n // Cursors and selection\r\n\r\n this.cursorsDOM = document.createElement( 'div' );\r\n this.cursorsDOM.className = 'cursors';\r\n this.codeArea.attach( this.cursorsDOM );\r\n\r\n this.searchResultSelections = document.createElement( 'div' );\r\n this.searchResultSelections.id = 'search-selections';\r\n this.searchResultSelections.className = 'selections';\r\n this.codeArea.attach( this.searchResultSelections );\r\n\r\n // Store here selections per cursor\r\n this.selections = {};\r\n\r\n // Css char synchronization\r\n this.xPadding = CodeEditor.LINE_GUTTER_WIDTH + 'px';\r\n\r\n // Add main cursor\r\n this._addCursor( 0, 0, true, true );\r\n\r\n // Scroll stuff\r\n {\r\n this.codeScroller = this.codeArea.root;\r\n this.firstLineInViewport = 0;\r\n this.lineScrollMargin = new LX.vec2( 20, 20 ); // [ mUp, mDown ]\r\n\r\n let lastScrollTopValue = -1;\r\n\r\n if ( !this.disableEdition )\r\n {\r\n this.codeScroller.addEventListener( 'scroll', ( e: any ) => {\r\n if ( this._discardScroll )\r\n {\r\n this._discardScroll = false;\r\n return;\r\n }\r\n\r\n // Vertical scroll\r\n {\r\n this.setScrollBarValue( 'vertical' );\r\n\r\n const scrollTop = this.getScrollTop();\r\n\r\n // Scroll down...\r\n if ( scrollTop > lastScrollTopValue )\r\n {\r\n if ( this.visibleLinesViewport.y < ( this.code.lines.length - 1 ) )\r\n {\r\n const totalLinesInViewport = ( ( this.codeScroller.offsetHeight ) / this.lineHeight )\r\n | 0;\r\n const scrollDownBoundary =\r\n ( Math.max( this.visibleLinesViewport.y - totalLinesInViewport, 0 ) - 1 )\r\n * this.lineHeight;\r\n\r\n if ( scrollTop >= scrollDownBoundary )\r\n {\r\n this.processLines( CodeEditor.UPDATE_VISIBLE_LINES );\r\n }\r\n }\r\n }\r\n // Scroll up...\r\n else\r\n {\r\n const scrollUpBoundary = parseInt( this.code.style.top );\r\n if ( scrollTop < scrollUpBoundary )\r\n {\r\n this.processLines( CodeEditor.UPDATE_VISIBLE_LINES );\r\n }\r\n }\r\n\r\n lastScrollTopValue = scrollTop;\r\n }\r\n\r\n // Horizontal scroll\r\n {\r\n this.setScrollBarValue( 'horizontal' );\r\n }\r\n } );\r\n\r\n this.codeScroller.addEventListener( 'wheel', ( e: WheelEvent ) => {\r\n if ( e.ctrlKey )\r\n {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n e.deltaY > 0.0 ? this._decreaseFontSize() : this._increaseFontSize();\r\n }\r\n } );\r\n\r\n this.codeScroller.addEventListener( 'wheel', ( e: WheelEvent ) => {\r\n if ( !e.ctrlKey )\r\n {\r\n const dX = ( e.deltaY > 0.0 ? 10.0 : -10.0 ) * ( e.shiftKey ? 1.0 : 0.0 );\r\n if ( dX != 0.0 ) this.setScrollBarValue( 'horizontal', dX );\r\n }\r\n }, { passive: true } );\r\n }\r\n }\r\n\r\n // Line numbers and scrollbars\r\n {\r\n // This is only the container, line numbers are in the same line div\r\n this.gutter = document.createElement( 'div' );\r\n this.gutter.className = 'lexcodegutter';\r\n area.attach( this.gutter );\r\n\r\n // Add custom vertical scroll bar\r\n this.vScrollbar = new ScrollBar( this, ScrollBar.SCROLLBAR_VERTICAL );\r\n area.attach( this.vScrollbar.root );\r\n\r\n // Add custom horizontal scroll bar\r\n this.hScrollbar = new ScrollBar( this, ScrollBar.SCROLLBAR_HORIZONTAL );\r\n area.attach( this.hScrollbar.root );\r\n }\r\n\r\n // Add autocomplete, search boxes (IF edition enabled)\r\n if ( !this.disableEdition )\r\n {\r\n // Add autocomplete box\r\n {\r\n this.autocomplete = document.createElement( 'div' );\r\n this.autocomplete.className = 'autocomplete';\r\n this.codeArea.attach( this.autocomplete );\r\n }\r\n\r\n // Add search box\r\n {\r\n const box = document.createElement( 'div' );\r\n box.className = 'searchbox';\r\n\r\n const searchPanel = new LX.Panel();\r\n box.appendChild( searchPanel.root );\r\n\r\n searchPanel.sameLine( 4 );\r\n searchPanel.addText( null, '', null, { placeholder: 'Find', inputClass: 'bg-secondary' } );\r\n searchPanel.addButton( null, 'up', () => this.search( null, true ), { icon: 'ArrowUp',\r\n title: 'Previous Match', tooltip: true } );\r\n searchPanel.addButton( null, 'down', () => this.search(), { icon: 'ArrowDown', title: 'Next Match',\r\n tooltip: true } );\r\n searchPanel.addButton( null, 'x', this.hideSearchBox.bind( this ), { icon: 'X', title: 'Close',\r\n tooltip: true } );\r\n\r\n const searchInput = box.querySelector( 'input' );\r\n searchInput?.addEventListener( 'keyup', ( e ) => {\r\n if ( e.key == 'Escape' ) this.hideSearchBox();\r\n else if ( e.key == 'Enter' ) this.search( ( e.target as any ).value, !!e.shiftKey );\r\n } );\r\n\r\n this.searchbox = box;\r\n this.codeArea.attach( box );\r\n }\r\n\r\n // Add search LINE box\r\n {\r\n const box = document.createElement( 'div' );\r\n box.className = 'searchbox';\r\n\r\n const searchPanel = new LX.Panel();\r\n box.appendChild( searchPanel.root );\r\n\r\n searchPanel.sameLine( 2 );\r\n searchPanel.addText( null, '', ( value: string ) => {\r\n input.value = ':' + value.replaceAll( ':', '' );\r\n this.goToLine( input.value.slice( 1 ) );\r\n }, { placeholder: 'Go to line', trigger: 'input' } );\r\n searchPanel.addButton( null, 'x', this.hideSearchLineBox.bind( this ), { icon: 'X', title: 'Close',\r\n tooltip: true } );\r\n\r\n let input: any = box.querySelector( 'input' );\r\n input.addEventListener( 'keyup', ( e: KeyboardEvent ) => {\r\n if ( e.key == 'Escape' ) this.hideSearchLineBox();\r\n } );\r\n\r\n this.searchlinebox = box;\r\n this.codeArea.attach( box );\r\n }\r\n }\r\n\r\n // Add code-sizer\r\n {\r\n this.codeSizer = document.createElement( 'div' );\r\n this.codeSizer.className = 'code-sizer pseudoparent-tabs';\r\n\r\n // Append all childs\r\n while ( this.codeScroller.firstChild )\r\n {\r\n this.codeSizer.appendChild( this.codeScroller.firstChild );\r\n }\r\n\r\n this.codeScroller.appendChild( this.codeSizer );\r\n }\r\n\r\n // State\r\n\r\n this.state = {\r\n focused: false,\r\n selectingText: false,\r\n activeLine: null,\r\n keyChain: null\r\n };\r\n\r\n // Code\r\n\r\n this.pairKeys = {\r\n '\"': '\"',\r\n \"'\": \"'\",\r\n '(': ')',\r\n '{': '}',\r\n '[': ']'\r\n };\r\n\r\n this.stringKeys = { // adding @ because some words are always true in (e.g. constructor..)\r\n '@\"': '\"',\r\n \"@'\": \"'\"\r\n };\r\n\r\n // Scan tokens..\r\n // setInterval( this.scanWordSuggestions.bind( this ), 2000 );\r\n\r\n this.specialKeys = [\r\n 'Backspace',\r\n 'Enter',\r\n 'ArrowUp',\r\n 'ArrowDown',\r\n 'ArrowRight',\r\n 'ArrowLeft',\r\n 'Delete',\r\n 'Home',\r\n 'End',\r\n 'Tab',\r\n 'Escape'\r\n ];\r\n\r\n // Convert reserved word arrays to maps so we can search tokens faster\r\n\r\n if ( !CodeEditor._staticReady )\r\n {\r\n for ( let lang in CodeEditor.keywords ) CodeEditor.keywords[lang] = new Set( CodeEditor.keywords[lang] );\r\n for ( let lang in CodeEditor.utils ) CodeEditor.utils[lang] = new Set( CodeEditor.utils[lang] );\r\n for ( let lang in CodeEditor.types ) CodeEditor.types[lang] = new Set( CodeEditor.types[lang] );\r\n for ( let lang in CodeEditor.builtIn ) CodeEditor.builtIn[lang] = new Set( CodeEditor.builtIn[lang] );\r\n for ( let lang in CodeEditor.statements )\r\n {\r\n CodeEditor.statements[lang] = new Set( CodeEditor.statements[lang] );\r\n }\r\n for ( let lang in CodeEditor.symbols ) CodeEditor.symbols[lang] = new Set( CodeEditor.symbols[lang] );\r\n\r\n CodeEditor._staticReady = true;\r\n }\r\n\r\n // Action keys\r\n {\r\n this.action( 'Escape', false, ( ln, cursor, e ) => {\r\n if ( this.hideAutoCompleteBox() )\r\n {\r\n return;\r\n }\r\n if ( this.hideSearchBox() )\r\n {\r\n return;\r\n }\r\n // Remove selections and cursors\r\n this.endSelection();\r\n this._removeSecondaryCursors();\r\n } );\r\n\r\n this.action( 'Backspace', false, ( ln, cursor, e ) => {\r\n this._addUndoStep( cursor );\r\n\r\n if ( cursor.selection )\r\n {\r\n this.deleteSelection( cursor );\r\n // Remove entire line when selecting with triple click\r\n if ( this._tripleClickSelection )\r\n {\r\n this.actions['Backspace'].callback( ln, cursor, e );\r\n this.lineDown( cursor, true );\r\n }\r\n }\r\n else\r\n {\r\n var letter = this.getCharAtPos( cursor, -1 );\r\n if ( letter )\r\n {\r\n var deleteFromPosition = cursor.position - 1;\r\n var numCharsDeleted = 1;\r\n\r\n // Delete full word\r\n if ( e.ctrlKey )\r\n {\r\n const [ word, from, to ] = this.getWordAtPos( cursor, -1 );\r\n\r\n if ( word.length > 1 )\r\n {\r\n deleteFromPosition = from;\r\n numCharsDeleted = word.length - ( to - cursor.position );\r\n }\r\n }\r\n\r\n this.code.lines[ln] = sliceChars( this.code.lines[ln], deleteFromPosition, numCharsDeleted );\r\n this.processLine( ln );\r\n\r\n this.cursorToPosition( cursor, deleteFromPosition );\r\n\r\n if ( this.useAutoComplete )\r\n {\r\n this.showAutoCompleteBox( 'foo', cursor );\r\n }\r\n }\r\n else if ( this.code.lines[ln - 1] != undefined )\r\n {\r\n this.lineUp( cursor );\r\n e.cancelShift = true;\r\n this.actions['End'].callback( cursor.line, cursor, e );\r\n // Move line on top\r\n this.code.lines[ln - 1] += this.code.lines[ln];\r\n this.code.lines.splice( ln, 1 );\r\n this.processLines();\r\n }\r\n }\r\n\r\n this.resizeIfNecessary( cursor, true );\r\n } );\r\n\r\n this.action( 'Delete', false, ( ln, cursor, e ) => {\r\n this._addUndoStep( cursor );\r\n\r\n if ( cursor.selection )\r\n {\r\n // Use 'Backspace' as it's the same callback...\r\n this.actions['Backspace'].callback( ln, cursor, e );\r\n }\r\n else\r\n {\r\n var letter = this.getCharAtPos( cursor );\r\n if ( letter )\r\n {\r\n this.code.lines[ln] = sliceChars( this.code.lines[ln], cursor.position );\r\n this.processLine( ln );\r\n }\r\n else if ( this.code.lines[ln + 1] != undefined )\r\n {\r\n this.code.lines[ln] += this.code.lines[ln + 1];\r\n this.code.lines.splice( ln + 1, 1 );\r\n this.processLines();\r\n }\r\n }\r\n\r\n this.resizeIfNecessary( cursor, true );\r\n } );\r\n\r\n this.action( 'Tab', true, ( ln, cursor, e ) => {\r\n if ( this._skipTabs )\r\n {\r\n this._skipTabs--;\r\n if ( !this._skipTabs )\r\n {\r\n delete this._skipTabs;\r\n }\r\n }\r\n else if ( this.isAutoCompleteActive )\r\n {\r\n this.autoCompleteWord();\r\n }\r\n else\r\n {\r\n this._addUndoStep( cursor );\r\n\r\n if ( e && e.shiftKey )\r\n {\r\n this._removeSpaces( cursor );\r\n }\r\n else\r\n {\r\n const indentSpaces = this.tabSpaces - ( cursor.position % this.tabSpaces );\r\n this._addSpaces( cursor, indentSpaces );\r\n }\r\n }\r\n }, ( cursor: Cursor, e: KeyboardEvent ) => {\r\n return e.shiftKey || ( cursor.selection && !cursor.selection.sameLine() );\r\n } );\r\n\r\n this.action( 'Home', false, ( ln, cursor, e ) => {\r\n let idx = firstNonspaceIndex( this.code.lines[ln] );\r\n\r\n // We already are in the first non space index...\r\n if ( idx == cursor.position ) idx = 0;\r\n\r\n const prestring = this.code.lines[ln].substring( 0, idx );\r\n let lastX = cursor.position;\r\n\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor, true );\r\n if ( idx > 0 )\r\n {\r\n this.cursorToString( cursor, prestring );\r\n }\r\n else\r\n {\r\n // No spaces, start from char 0\r\n idx = 0;\r\n }\r\n\r\n this.mergeCursors( ln );\r\n\r\n if ( e.shiftKey && !e.cancelShift )\r\n {\r\n // Get last selection range\r\n if ( cursor.selection )\r\n {\r\n lastX += cursor.selection.chars;\r\n }\r\n\r\n if ( !cursor.selection )\r\n {\r\n this.startSelection( cursor );\r\n }\r\n\r\n var string = this.code.lines[ln].substring( idx, lastX );\r\n if ( cursor.selection!.sameLine() )\r\n {\r\n cursor.selection!.selectInline( cursor, idx, cursor.line, this.measureString( string ) );\r\n }\r\n else\r\n {\r\n this._processSelection( cursor, e );\r\n }\r\n }\r\n else if ( !e.keepSelection )\r\n {\r\n this.endSelection();\r\n }\r\n } );\r\n\r\n this.action( 'End', false, ( ln, cursor, e ) => {\r\n if ( ( e.shiftKey || e._shiftKey ) && !e.cancelShift )\r\n {\r\n var string = this.code.lines[ln].substring( cursor.position );\r\n if ( !cursor.selection )\r\n {\r\n this.startSelection( cursor );\r\n }\r\n if ( cursor.selection!.sameLine() )\r\n {\r\n cursor.selection!.selectInline( cursor, cursor.position, cursor.line,\r\n this.measureString( string ) );\r\n }\r\n else\r\n {\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor );\r\n this.cursorToString( cursor, this.code.lines[ln] );\r\n this._processSelection( cursor, e );\r\n }\r\n }\r\n else if ( !e.keepSelection )\r\n {\r\n this.endSelection();\r\n }\r\n\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor );\r\n this.cursorToString( cursor, this.code.lines[ln] );\r\n\r\n var viewportSizeX = ( this.codeScroller.clientWidth + this.getScrollLeft() )\r\n - CodeEditor.LINE_GUTTER_WIDTH; // Gutter offset\r\n if ( ( cursor.position * this.charWidth ) >= viewportSizeX )\r\n {\r\n this.setScrollLeft( this.code.lines[ln].length * this.charWidth );\r\n }\r\n\r\n // Merge cursors\r\n this.mergeCursors( ln );\r\n } );\r\n\r\n this.action( 'Enter', true, ( ln, cursor, e ) => {\r\n // Add word\r\n if ( this.isAutoCompleteActive )\r\n {\r\n this.autoCompleteWord();\r\n return;\r\n }\r\n\r\n if ( e.ctrlKey && this.onRun )\r\n {\r\n this.onRun( this.getText() );\r\n return;\r\n }\r\n\r\n this._addUndoStep( cursor, true );\r\n\r\n var _c0 = this.getCharAtPos( cursor, -1 );\r\n var _c1 = this.getCharAtPos( cursor );\r\n\r\n this.code.lines.splice( cursor.line + 1, 0, '' );\r\n this.code.lines[cursor.line + 1] = this.code.lines[ln].substr( cursor.position ); // new line (below)\r\n this.code.lines[ln] = this.code.lines[ln].substr( 0, cursor.position ); // line above\r\n\r\n this.lineDown( cursor, true );\r\n\r\n // Check indentation\r\n var spaces = firstNonspaceIndex( this.code.lines[ln] );\r\n var tabs = Math.floor( spaces / this.tabSpaces );\r\n\r\n if ( _c0 == '{' && _c1 == '}' )\r\n {\r\n this.code.lines.splice( cursor.line, 0, '' );\r\n this._addSpaceTabs( cursor, tabs + 1 );\r\n this.code.lines[cursor.line + 1] = ' '.repeat( spaces ) + this.code.lines[cursor.line + 1];\r\n }\r\n else\r\n {\r\n this._addSpaceTabs( cursor, tabs );\r\n }\r\n\r\n this.processLines();\r\n } );\r\n\r\n this.action( 'ArrowUp', false, ( ln, cursor, e ) => {\r\n // Move cursor..\r\n if ( !this.isAutoCompleteActive )\r\n {\r\n if ( e.shiftKey )\r\n {\r\n if ( !cursor.selection )\r\n {\r\n this.startSelection( cursor );\r\n }\r\n\r\n this.lineUp( cursor );\r\n\r\n var letter = this.getCharAtPos( cursor );\r\n if ( !letter )\r\n {\r\n this.cursorToPosition( cursor, this.code.lines[cursor.line].length );\r\n }\r\n\r\n this._processSelection( cursor, e, false );\r\n }\r\n else\r\n {\r\n this.endSelection();\r\n this.lineUp( cursor );\r\n // Go to end of line if out of line\r\n var letter = this.getCharAtPos( cursor );\r\n if ( !letter ) this.actions['End'].callback( cursor.line, cursor, e );\r\n }\r\n }\r\n // Move up autocomplete selection\r\n else\r\n {\r\n this._moveArrowSelectedAutoComplete( 'up' );\r\n }\r\n } );\r\n\r\n this.action( 'ArrowDown', false, ( ln, cursor, e ) => {\r\n // Move cursor..\r\n if ( !this.isAutoCompleteActive )\r\n {\r\n if ( e.shiftKey )\r\n {\r\n if ( !cursor.selection )\r\n {\r\n this.startSelection( cursor );\r\n }\r\n }\r\n else\r\n {\r\n this.endSelection();\r\n }\r\n\r\n const canGoDown = this.lineDown( cursor );\r\n const letter = this.getCharAtPos( cursor );\r\n\r\n // Go to end of line if out of range\r\n if ( !letter || !canGoDown )\r\n {\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor );\r\n this.cursorToRight( this.code.lines[cursor.line], cursor );\r\n }\r\n\r\n if ( e.shiftKey )\r\n {\r\n this._processSelection( cursor, e );\r\n }\r\n }\r\n // Move down autocomplete selection\r\n else\r\n {\r\n this._moveArrowSelectedAutoComplete( 'down' );\r\n }\r\n } );\r\n\r\n this.action( 'ArrowLeft', false, ( ln, cursor, e ) => {\r\n // Nothing to do..\r\n if ( cursor.line == 0 && cursor.position == 0 )\r\n {\r\n return;\r\n }\r\n\r\n if ( e.metaKey )\r\n { // Apple devices (Command)\r\n e.preventDefault();\r\n this.actions['Home'].callback( ln, cursor, e );\r\n }\r\n else if ( e.ctrlKey )\r\n {\r\n // Get next word\r\n const [ word, from, to ] = this.getWordAtPos( cursor, -1 );\r\n // If no length, we change line..\r\n if ( !word.length && this.lineUp( cursor, true ) )\r\n {\r\n const cS = e.cancelShift, kS = e.keepSelection;\r\n e.cancelShift = true;\r\n e.keepSelection = true;\r\n this.actions['End'].callback( cursor.line, cursor, e );\r\n e.cancelShift = cS;\r\n e.keepSelection = kS;\r\n }\r\n var diff = Math.max( cursor.position - from, 1 );\r\n var substr = word.substr( 0, diff );\r\n\r\n // Selections...\r\n if ( e.shiftKey )\r\n {\r\n if ( !cursor.selection )\r\n {\r\n this.startSelection( cursor );\r\n }\r\n }\r\n else\r\n {\r\n this.endSelection();\r\n }\r\n\r\n this.cursorToString( cursor, substr, true );\r\n\r\n if ( e.shiftKey )\r\n {\r\n this._processSelection( cursor, e );\r\n }\r\n }\r\n else\r\n {\r\n var letter = this.getCharAtPos( cursor, -1 );\r\n if ( letter )\r\n {\r\n if ( e.shiftKey )\r\n {\r\n if ( !cursor.selection ) this.startSelection( cursor );\r\n this.cursorToLeft( letter, cursor );\r\n this._processSelection( cursor, e, false, CodeEditor.SELECTION_X );\r\n }\r\n else\r\n {\r\n if ( !cursor.selection )\r\n {\r\n this.cursorToLeft( letter, cursor );\r\n if ( this.useAutoComplete && this.isAutoCompleteActive )\r\n {\r\n this.showAutoCompleteBox( 'foo', cursor );\r\n }\r\n }\r\n else\r\n {\r\n cursor.selection.invertIfNecessary();\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT_TOP, cursor );\r\n this.cursorToLine( cursor, cursor.selection.fromY );\r\n this.cursorToPosition( cursor, cursor.selection.fromX, true );\r\n this.endSelection();\r\n }\r\n }\r\n }\r\n else if ( cursor.line > 0 )\r\n {\r\n if ( e.shiftKey && !cursor.selection ) this.startSelection( cursor );\r\n\r\n this.lineUp( cursor );\r\n\r\n e.cancelShift = e.keepSelection = true;\r\n this.actions['End'].callback( cursor.line, cursor, e );\r\n delete e.cancelShift;\r\n delete e.keepSelection;\r\n\r\n if ( e.shiftKey ) this._processSelection( cursor, e, false );\r\n }\r\n }\r\n } );\r\n\r\n this.action( 'ArrowRight', false, ( ln, cursor, e ) => {\r\n // Nothing to do..\r\n if ( cursor.line == this.code.lines.length - 1\r\n && cursor.position == this.code.lines[cursor.line].length )\r\n {\r\n return;\r\n }\r\n\r\n if ( e.metaKey )\r\n { // Apple devices (Command)\r\n e.preventDefault();\r\n this.actions['End'].callback( ln, cursor, e );\r\n }\r\n else if ( e.ctrlKey )\r\n { // Next word\r\n // Get next word\r\n const [ word, from, to ] = this.getWordAtPos( cursor );\r\n\r\n // If no length, we change line..\r\n if ( !word.length ) this.lineDown( cursor, true );\r\n var diff = cursor.position - from;\r\n var substr = word.substr( diff );\r\n\r\n // Selections...\r\n if ( e.shiftKey )\r\n {\r\n if ( !cursor.selection )\r\n {\r\n this.startSelection( cursor );\r\n }\r\n }\r\n else\r\n {\r\n this.endSelection();\r\n }\r\n\r\n this.cursorToString( cursor, substr );\r\n\r\n if ( e.shiftKey )\r\n {\r\n this._processSelection( cursor, e );\r\n }\r\n }\r\n // Next char\r\n else\r\n {\r\n var letter = this.getCharAtPos( cursor );\r\n if ( letter )\r\n {\r\n // Selecting chars\r\n if ( e.shiftKey )\r\n {\r\n if ( !cursor.selection )\r\n {\r\n this.startSelection( cursor );\r\n }\r\n\r\n this.cursorToRight( letter, cursor );\r\n this._processSelection( cursor, e, false, CodeEditor.SELECTION_X );\r\n }\r\n else\r\n {\r\n if ( !cursor.selection )\r\n {\r\n this.cursorToRight( letter, cursor );\r\n if ( this.useAutoComplete && this.isAutoCompleteActive )\r\n {\r\n this.showAutoCompleteBox( 'foo', cursor );\r\n }\r\n }\r\n else\r\n {\r\n cursor.selection.invertIfNecessary();\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT_TOP, cursor );\r\n this.cursorToLine( cursor, cursor.selection.toY );\r\n this.cursorToPosition( cursor, cursor.selection.toX, true );\r\n this.endSelection( cursor );\r\n }\r\n }\r\n }\r\n else if ( this.code.lines[cursor.line + 1] !== undefined )\r\n {\r\n if ( e.shiftKey )\r\n {\r\n if ( !cursor.selection ) this.startSelection( cursor );\r\n }\r\n else\r\n {\r\n this.endSelection();\r\n }\r\n\r\n this.lineDown( cursor, true );\r\n\r\n if ( e.shiftKey ) this._processSelection( cursor, e, false );\r\n\r\n this.hideAutoCompleteBox();\r\n }\r\n }\r\n } );\r\n }\r\n\r\n // Default code tab\r\n\r\n const onLoadAll = async () => {\r\n // Create inspector panel when the initial state is complete\r\n // and we have at least 1 tab opened\r\n this.statusPanel = this._createStatusPanel( options );\r\n if ( this.statusPanel )\r\n {\r\n area.attach( this.statusPanel );\r\n }\r\n\r\n if ( document.fonts.status == 'loading' )\r\n {\r\n await document.fonts.ready;\r\n }\r\n\r\n // Load any font size from local storage\r\n const savedFontSize = window.localStorage.getItem( 'lexcodeeditor-font-size' );\r\n if ( savedFontSize )\r\n {\r\n this._setFontSize( parseInt( savedFontSize ) );\r\n }\r\n // Use default size\r\n else\r\n {\r\n const r: any = document.querySelector( ':root' );\r\n const s = getComputedStyle( r );\r\n this.fontSize = parseInt( s.getPropertyValue( '--code-editor-font-size' ) );\r\n this.charWidth = this._measureChar() as number;\r\n }\r\n\r\n LX.emitSignal( '@font-size', this.fontSize );\r\n\r\n // Get final sizes for editor elements based on Tabs and status bar offsets\r\n LX.doAsync( () => {\r\n this._verticalTopOffset = this.tabs?.root.getBoundingClientRect().height ?? 0;\r\n this._verticalBottomOffset = this.statusPanel?.root.getBoundingClientRect().height ?? 0;\r\n this._fullVerticalOffset = this._verticalTopOffset + this._verticalBottomOffset;\r\n\r\n this.gutter.style.marginTop = `${this._verticalTopOffset}px`;\r\n this.gutter.style.height = `calc(100% - ${this._fullVerticalOffset}px)`;\r\n this.vScrollbar.root.style.marginTop = `${this._verticalTopOffset}px`;\r\n this.vScrollbar.root.style.height = `calc(100% - ${this._fullVerticalOffset}px)`;\r\n this.hScrollbar.root.style.bottom = `${this._verticalBottomOffset}px`;\r\n this.codeArea.root.style.height = `calc(100% - ${this._fullVerticalOffset}px)`;\r\n\r\n // Process lines on finish computing final sizes\r\n this.processLines();\r\n }, 50 );\r\n\r\n if ( options.callback )\r\n {\r\n options.callback.call( this, this );\r\n }\r\n\r\n g.editor = this;\r\n };\r\n\r\n if ( options.allowAddScripts ?? true )\r\n {\r\n this.onCreateFile = options.onCreateFile;\r\n this.addTab( '+', false, 'Create file' );\r\n }\r\n\r\n if ( options.files )\r\n {\r\n console.assert( options.files.constructor === Array, '_files_ must be an Array!' );\r\n const numFiles = options.files.length;\r\n const loadAsync = options.filesAsync !== undefined;\r\n let filesLoaded = 0;\r\n for ( let url of options.files )\r\n {\r\n const finalUrl = url.constructor === Array ? url[0] : url;\r\n const finalFileName = url.constructor === Array ? url[1] : undefined;\r\n\r\n await this.loadFile( finalUrl, { filename: finalFileName, async: loadAsync,\r\n callback: ( name: string, text: string ) => {\r\n filesLoaded++;\r\n if ( filesLoaded == numFiles )\r\n {\r\n onLoadAll();\r\n\r\n if ( options.onFilesLoaded )\r\n {\r\n options.onFilesLoaded( this, this.loadedTabs, numFiles );\r\n }\r\n }\r\n } } );\r\n }\r\n }\r\n else\r\n {\r\n if ( options.defaultTab ?? true )\r\n {\r\n this.addTab( options.name || 'untitled', true, options.title, {\r\n language: options.highlight ?? 'Plain Text'\r\n } );\r\n }\r\n\r\n onLoadAll();\r\n }\r\n }\r\n\r\n // Clear signals\r\n clear()\r\n {\r\n console.assert( this.rightStatusPanel && this.leftStatusPanel, 'No panels to clear.' );\r\n this.rightStatusPanel.clear();\r\n this.leftStatusPanel.clear();\r\n }\r\n\r\n static getInstances()\r\n {\r\n return CodeEditor.__instances;\r\n }\r\n\r\n // This received key inputs from the entire document...\r\n onKeyPressed( e: KeyboardEvent )\r\n {\r\n // Toggle visibility of the file explorer\r\n if ( e.key == 'b' && e.ctrlKey && this.useFileExplorer )\r\n {\r\n this.explorerArea.root.classList.toggle( 'hidden' );\r\n if ( this._lastBaseareaWidth )\r\n {\r\n this.baseArea.root.style.width = this._lastBaseareaWidth;\r\n delete this._lastBaseareaWidth;\r\n }\r\n else\r\n {\r\n this._lastBaseareaWidth = this.baseArea.root.style.width;\r\n this.baseArea.root.style.width = '100%';\r\n }\r\n }\r\n }\r\n\r\n getText( min: boolean = false )\r\n {\r\n return this.code.lines.join( min ? ' ' : '\\n' );\r\n }\r\n\r\n // This can be used to empty all text...\r\n setText( text: string = '', langString?: string )\r\n {\r\n let newLines = text.split( '\\n' );\r\n this.code.lines = ( [] as string[] ).concat( newLines );\r\n\r\n this._removeSecondaryCursors();\r\n\r\n let cursor = this.getCurrentCursor( true );\r\n let lastLine = newLines.pop();\r\n\r\n this.cursorToLine( cursor, newLines.length ); // Already substracted 1\r\n this.cursorToPosition( cursor, lastLine?.length ?? 0, true );\r\n\r\n this.mustProcessLines = true;\r\n\r\n if ( langString )\r\n {\r\n this._changeLanguage( langString );\r\n }\r\n\r\n this._processLinesIfNecessary();\r\n }\r\n\r\n appendText( text: string, cursor: Cursor )\r\n {\r\n let lidx = cursor.line;\r\n\r\n if ( cursor.selection )\r\n {\r\n this.deleteSelection( cursor );\r\n lidx = cursor.line;\r\n }\r\n\r\n this.endSelection();\r\n\r\n const newLines = text.replaceAll( '\\r', '' ).split( '\\n' );\r\n\r\n // Pasting Multiline...\r\n if ( newLines.length != 1 )\r\n {\r\n let numLines = newLines.length;\r\n console.assert( numLines > 0 );\r\n const firstLine = newLines.shift();\r\n numLines--;\r\n\r\n const remaining = this.code.lines[lidx].slice( cursor.position );\r\n\r\n // Add first line\r\n this.code.lines[lidx] = [\r\n this.code.lines[lidx].slice( 0, cursor.position ),\r\n firstLine\r\n ].join( '' );\r\n\r\n this.cursorToPosition( cursor, cursor.position + ( firstLine?.length ?? 0 ) );\r\n\r\n // Enter next lines...\r\n\r\n let _text = null;\r\n\r\n for ( var i = 0; i < newLines.length; ++i )\r\n {\r\n _text = newLines[i];\r\n this.cursorToLine( cursor, cursor.line++, true );\r\n // Add remaining...\r\n if ( i == ( newLines.length - 1 ) )\r\n {\r\n _text += remaining;\r\n }\r\n this.code.lines.splice( 1 + lidx + i, 0, _text );\r\n }\r\n\r\n if ( _text ) this.cursorToPosition( cursor, _text.length );\r\n this.cursorToLine( cursor, cursor.line + numLines );\r\n this.processLines();\r\n }\r\n // Pasting one line...\r\n else\r\n {\r\n this.code.lines[lidx] = [\r\n this.code.lines[lidx].slice( 0, cursor.position ),\r\n newLines[0],\r\n this.code.lines[lidx].slice( cursor.position )\r\n ].join( '' );\r\n\r\n this.cursorToPosition( cursor, cursor.position + newLines[0].length );\r\n this.processLine( lidx );\r\n }\r\n\r\n this.resize( CodeEditor.RESIZE_SCROLLBAR_H_V, undefined, () => {\r\n var viewportSizeX = ( this.codeScroller.clientWidth + this.getScrollLeft() ) - CodeEditor.LINE_GUTTER_WIDTH; // Gutter offset\r\n if ( ( cursor.position * this.charWidth ) >= viewportSizeX )\r\n {\r\n this.setScrollLeft( this.code.lines[lidx].length * this.charWidth );\r\n }\r\n } );\r\n }\r\n\r\n setCustomSuggestions( suggestions: string[] )\r\n {\r\n if ( !suggestions || suggestions.constructor !== Array )\r\n {\r\n return;\r\n }\r\n\r\n this.customSuggestions = suggestions;\r\n }\r\n\r\n async loadFile( file: File, options: any = {} )\r\n {\r\n const _innerAddTab = ( text: string, name: string, title?: string ) => {\r\n // Remove Carriage Return in some cases and sub tabs using spaces\r\n text = text.replaceAll( '\\r', '' ).replaceAll( /\\t|\\\\t/g, ' '.repeat( this.tabSpaces ) );\r\n\r\n // Set current text and language\r\n const lines = text.split( '\\n' );\r\n\r\n // Add item in the explorer if used\r\n if ( this.useFileExplorer || this.skipTabs )\r\n {\r\n this._tabStorage[name] = {\r\n lines: lines,\r\n options: options\r\n };\r\n\r\n const ext = CodeEditor.languages[options.language]?.ext;\r\n\r\n if ( this.useFileExplorer )\r\n {\r\n this.addExplorerItem( { id: name, skipVisibility: true, icon: this._getFileIcon( name, ext ) } );\r\n this.explorer.innerTree.frefresh( name );\r\n }\r\n }\r\n else\r\n {\r\n this.addTab( name, true, title, options );\r\n this.code.lines = lines;\r\n\r\n // Default inferred language if not specified\r\n if ( !options.language )\r\n {\r\n this._changeLanguageFromExtension( LX.getExtension( name ) );\r\n }\r\n }\r\n\r\n if ( options.callback )\r\n {\r\n options.callback( name, text );\r\n }\r\n };\r\n\r\n if ( file.constructor == String )\r\n {\r\n const filename: string = file;\r\n const name = options.filename ?? filename.substring( filename.lastIndexOf( '/' ) + 1 );\r\n\r\n if ( options.async ?? false )\r\n {\r\n const text: string = await this._requestFileAsync( filename, 'text' ) as string;\r\n _innerAddTab( text, name, options.filename ?? filename );\r\n }\r\n else\r\n {\r\n LX.request( { url: filename, success: ( text: string ) => {\r\n _innerAddTab( text, name, options.filename ?? filename );\r\n } } );\r\n }\r\n }\r\n // File Blob\r\n else\r\n {\r\n const fr = new FileReader();\r\n fr.readAsText( file );\r\n fr.onload = ( e ) => {\r\n const text = ( e.currentTarget as any ).result;\r\n _innerAddTab( text, file.name );\r\n };\r\n }\r\n }\r\n\r\n _addUndoStep( cursor: Cursor, force: boolean = false, deleteRedo: boolean = true )\r\n {\r\n // Only the mainc cursor stores undo steps\r\n if ( !cursor.isMain )\r\n {\r\n return;\r\n }\r\n\r\n const d = new Date();\r\n const current = d.getTime();\r\n\r\n if ( !force )\r\n {\r\n if ( !this._lastTime )\r\n {\r\n this._lastTime = current;\r\n }\r\n else\r\n {\r\n if ( ( current - this._lastTime ) > 2000 )\r\n {\r\n this._lastTime = null;\r\n }\r\n else\r\n {\r\n // If time not enough, reset timer\r\n this._lastTime = current;\r\n return;\r\n }\r\n }\r\n }\r\n\r\n if ( deleteRedo )\r\n {\r\n // Remove all redo steps\r\n this.code.redoSteps.length = 0;\r\n }\r\n\r\n this.code.undoSteps.push( {\r\n lines: LX.deepCopy( this.code.lines ),\r\n cursors: this.saveCursors()\r\n } );\r\n }\r\n\r\n _doUndo( cursor: Cursor )\r\n {\r\n if ( !this.code.undoSteps.length )\r\n {\r\n return;\r\n }\r\n\r\n this._addRedoStep( cursor );\r\n\r\n // Extract info from the last code state\r\n const step = this.code.undoSteps.pop();\r\n\r\n // Set old state lines\r\n this.code.lines = step.lines;\r\n this.processLines();\r\n\r\n this._removeSecondaryCursors();\r\n\r\n for ( let i = 0; i < step.cursors.length; ++i )\r\n {\r\n var currentCursor: Cursor | null = this.cursors[i];\r\n\r\n // Generate new if needed\r\n if ( !currentCursor )\r\n {\r\n currentCursor = this._addCursor();\r\n }\r\n\r\n this.restoreCursor( currentCursor as Cursor, step.cursors[i] );\r\n }\r\n\r\n this._hideActiveLine();\r\n }\r\n\r\n _addRedoStep( cursor: Cursor )\r\n {\r\n // Only the mainc cursor stores redo steps\r\n if ( !cursor.isMain )\r\n {\r\n return;\r\n }\r\n\r\n this.code.redoSteps.push( {\r\n lines: LX.deepCopy( this.code.lines ),\r\n cursors: this.saveCursors()\r\n } );\r\n }\r\n\r\n _doRedo( cursor: Cursor )\r\n {\r\n if ( !this.code.redoSteps.length )\r\n {\r\n return;\r\n }\r\n\r\n this._addUndoStep( cursor, true, false );\r\n\r\n // Extract info from the next saved code state\r\n const step = this.code.redoSteps.pop();\r\n\r\n // Set old state lines\r\n this.code.lines = step.lines;\r\n this.processLines();\r\n\r\n this._removeSecondaryCursors();\r\n\r\n for ( let i = 0; i < step.cursors.length; ++i )\r\n {\r\n var currentCursor: Cursor | null = this.cursors[i];\r\n\r\n // Generate new if needed\r\n if ( !currentCursor )\r\n {\r\n currentCursor = this._addCursor();\r\n }\r\n\r\n this.restoreCursor( currentCursor as Cursor, step.cursors[i] );\r\n }\r\n }\r\n\r\n _changeLanguage( langString: string, langExtension?: string, override: boolean = false )\r\n {\r\n this.code.language = langString;\r\n this.highlight = langString;\r\n\r\n if ( override )\r\n {\r\n this.code.languageOverride = langString;\r\n }\r\n\r\n this._updateDataInfoPanel( '@highlight', langString );\r\n\r\n this.mustProcessLines = true;\r\n\r\n const ext = langExtension ?? CodeEditor.languages[langString].ext;\r\n const icon = this._getFileIcon( null, ext );\r\n\r\n // Update tab icon\r\n if ( !this.skipTabs )\r\n {\r\n const tab = this.tabs.tabDOMs[this.code.tabName];\r\n tab.firstChild.remove();\r\n console.assert( tab != undefined );\r\n var iconEl;\r\n if ( !icon.includes( '.' ) )\r\n { // Not a file\r\n const classes = icon.split( ' ' );\r\n iconEl = LX.makeIcon( classes[0], { svgClass: classes.slice( 0 ).join( ' ' ) } );\r\n }\r\n else\r\n {\r\n iconEl = document.createElement( 'img' );\r\n iconEl.src = 'https://raw.githubusercontent.com/jxarco/lexgui.js/master/' + icon;\r\n }\r\n tab.prepend( iconEl );\r\n }\r\n\r\n // Update explorer icon\r\n if ( this.useFileExplorer )\r\n {\r\n const item = this.explorer.innerTree.data.filter( ( v: HTMLElement ) => v.id === this.code.tabName )[0];\r\n console.assert( item != undefined );\r\n item.icon = icon;\r\n this.explorer.innerTree.frefresh( this.code.tabName );\r\n }\r\n }\r\n\r\n _changeLanguageFromExtension( ext: string )\r\n {\r\n if ( !ext )\r\n {\r\n return this._changeLanguage( this.code.language );\r\n }\r\n\r\n for ( let l in CodeEditor.languages )\r\n {\r\n const langExtension = CodeEditor.languages[l].ext;\r\n\r\n if ( langExtension.constructor == Array )\r\n {\r\n if ( langExtension.indexOf( ext ) > -1 )\r\n {\r\n return this._changeLanguage( l, ext );\r\n }\r\n }\r\n else\r\n {\r\n if ( langExtension == ext )\r\n {\r\n return this._changeLanguage( l );\r\n }\r\n }\r\n }\r\n\r\n this._changeLanguage( 'Plain Text' );\r\n }\r\n\r\n _createStatusPanel( options: any = {} )\r\n {\r\n if ( this.skipInfo )\r\n {\r\n return;\r\n }\r\n\r\n let panel = new LX.Panel( { className: 'lexcodetabinfo flex flex-row', height: 'auto' } );\r\n\r\n if ( this.onCreateStatusPanel )\r\n {\r\n this.onCreateStatusPanel( panel, this );\r\n }\r\n\r\n let leftStatusPanel = this.leftStatusPanel = new LX.Panel( { id: 'FontSizeZoomStatusComponent',\r\n height: 'auto' } );\r\n leftStatusPanel.sameLine();\r\n\r\n if ( this.skipTabs )\r\n {\r\n leftStatusPanel.addButton( null, 'ZoomOutButton', this._decreaseFontSize.bind( this ), { icon: 'ZoomOut',\r\n width: '32px', title: 'Zoom Out', tooltip: true } );\r\n }\r\n\r\n leftStatusPanel.addButton( null, 'ZoomOutButton', this._decreaseFontSize.bind( this ), { icon: 'ZoomOut',\r\n width: '32px', title: 'Zoom Out', tooltip: true } );\r\n leftStatusPanel.addLabel( this.fontSize, { fit: true, signal: '@font-size' } );\r\n leftStatusPanel.addButton( null, 'ZoomInButton', this._increaseFontSize.bind( this ), { icon: 'ZoomIn',\r\n width: '32px', title: 'Zoom In', tooltip: true } );\r\n leftStatusPanel.endLine( 'justify-start' );\r\n panel.attach( leftStatusPanel.root );\r\n\r\n let rightStatusPanel = this.rightStatusPanel = new LX.Panel( { height: 'auto' } );\r\n rightStatusPanel.sameLine();\r\n rightStatusPanel.addLabel( this.code?.title ?? '', { id: 'EditorFilenameStatusComponent', fit: true,\r\n signal: '@tab-name' } );\r\n rightStatusPanel.addButton( null, 'Ln 1, Col 1', this.showSearchLineBox.bind( this ), {\r\n id: 'EditorSelectionStatusComponent',\r\n fit: true,\r\n signal: '@cursor-data'\r\n } );\r\n rightStatusPanel.addButton( null, 'Spaces: ' + this.tabSpaces, ( value: any, event: any ) => {\r\n LX.addContextMenu( 'Spaces', event, ( m: typeof ContextMenu ) => {\r\n const options = [ 2, 4, 8 ];\r\n for ( const n of options )\r\n {\r\n m.add( n, ( v: any ) => {\r\n this.tabSpaces = v;\r\n this.processLines();\r\n this._updateDataInfoPanel( '@tab-spaces', 'Spaces: ' + this.tabSpaces );\r\n } );\r\n }\r\n } );\r\n }, { id: 'EditorIndentationStatusComponent', nameWidth: '15%', signal: '@tab-spaces' } );\r\n rightStatusPanel.addButton( '<b>{ }</b>', this.highlight, ( value: any, event: any ) => {\r\n LX.addContextMenu( 'Language', event, ( m: typeof ContextMenu ) => {\r\n for ( const lang of Object.keys( CodeEditor.languages ) )\r\n {\r\n m.add( lang, ( v: any ) => {\r\n this._changeLanguage( v, undefined, true );\r\n this.processLines();\r\n } );\r\n }\r\n } );\r\n }, { id: 'EditorLanguageStatusComponent', nameWidth: '15%', signal: '@highlight' } );\r\n rightStatusPanel.endLine( 'justify-end' );\r\n panel.attach( rightStatusPanel.root );\r\n\r\n const itemVisibilityMap: Record<string, boolean> = {\r\n 'Font Size Zoom': options.statusShowFontSizeZoom ?? true,\r\n 'Editor Filename': options.statusShowEditorFilename ?? true,\r\n 'Editor Selection': options.statusShowEditorSelection ?? true,\r\n 'Editor Indentation': options.statusShowEditorIndentation ?? true,\r\n 'Editor Language': options.statusShowEditorLanguage ?? true\r\n };\r\n\r\n const _setVisibility = ( itemName: string ) => {\r\n const b = panel.root.querySelector( `#${itemName.replaceAll( ' ', '' )}StatusComponent` );\r\n console.assert( b, `${itemName} has no status button!` );\r\n b.classList.toggle( 'hidden', !itemVisibilityMap[itemName] );\r\n };\r\n\r\n for ( const [ itemName, v ] of Object.entries( itemVisibilityMap ) )\r\n {\r\n _setVisibility( itemName );\r\n }\r\n\r\n panel.root.addEventListener( 'contextmenu', ( e: any ) => {\r\n if ( e.target\r\n && ( e.target.classList.contains( 'lexpanel' )\r\n || e.target.classList.contains( 'lexinlinecomponents' ) ) )\r\n {\r\n return;\r\n }\r\n\r\n const menuOptions = Object.keys( itemVisibilityMap ).map( ( itemName, idx ) => {\r\n const item: any = {\r\n name: itemName,\r\n icon: 'Check',\r\n callback: () => {\r\n itemVisibilityMap[itemName] = !itemVisibilityMap[itemName];\r\n _setVisibility( itemName );\r\n }\r\n };\r\n if ( !itemVisibilityMap[itemName] ) delete item.icon;\r\n return item;\r\n } );\r\n new LX.DropdownMenu( e.target, menuOptions, { side: 'top', align: 'start' } );\r\n } );\r\n\r\n return panel;\r\n }\r\n\r\n _getFileIcon( name: string | null, extension?: string, langString?: string )\r\n {\r\n const isNewTabButton = name ? ( name === '+' ) : false;\r\n if ( isNewTabButton )\r\n {\r\n return;\r\n }\r\n\r\n if ( !langString )\r\n {\r\n if ( !extension )\r\n {\r\n extension = LX.getExtension( name );\r\n }\r\n else\r\n {\r\n const possibleExtensions = ( [] as string[] ).concat( extension );\r\n\r\n if ( name )\r\n {\r\n const fileExtension = LX.getExtension( name );\r\n const idx = possibleExtensions.indexOf( fileExtension );\r\n\r\n if ( idx > -1 )\r\n {\r\n extension = possibleExtensions[idx];\r\n }\r\n }\r\n else\r\n {\r\n extension = possibleExtensions[0];\r\n }\r\n }\r\n\r\n for ( const [ l, lData ] of Object.entries( CodeEditor.languages ) )\r\n {\r\n const extensions = ( [] as string[] ).concat( ( lData as any ).ext );\r\n if ( extensions.includes( extension! ) )\r\n {\r\n langString = l;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if ( langString === undefined )\r\n {\r\n return 'AlignLeft fg-neutral-500';\r\n }\r\n\r\n const iconPlusClasses = CodeEditor.languages[langString]?.icon;\r\n if ( iconPlusClasses )\r\n {\r\n return iconPlusClasses[extension!] ?? iconPlusClasses;\r\n }\r\n\r\n return 'AlignLeft fg-neutral-500';\r\n }\r\n\r\n _onNewTab( e: any )\r\n {\r\n this.processFocus( false );\r\n\r\n if ( this.onNewTab )\r\n {\r\n this.onNewTab( e );\r\n return;\r\n }\r\n\r\n const dmOptions = this.newTabOptions ?? [\r\n { name: 'Create file', icon: 'FilePlus', callback: this._onCreateNewFile.bind( this ) },\r\n { name: 'Load file', icon: 'FileUp', disabled: !this.allowLoadingFiles,\r\n callback: this.loadTabFromFile.bind( this ) }\r\n ];\r\n\r\n new LX.DropdownMenu( e.target, dmOptions, { side: 'bottom', align: 'start' } );\r\n }\r\n\r\n _onCreateNewFile()\r\n {\r\n let options: any = {};\r\n\r\n if ( this.onCreateFile )\r\n {\r\n options = this.onCreateFile( this );\r\n if ( !options )\r\n { // Skip adding new file\r\n return;\r\n }\r\n }\r\n\r\n const name = options.name ?? 'unnamed.js';\r\n this.addTab( name, true, name, { indexOffset: options.indexOffset,\r\n language: options.language ?? 'JavaScript' } );\r\n }\r\n\r\n _onSelectTab( isNewTabButton: boolean, event: any, name: string )\r\n {\r\n if ( this.disableEdition )\r\n {\r\n return;\r\n }\r\n\r\n if ( isNewTabButton )\r\n {\r\n this._onNewTab( event );\r\n return;\r\n }\r\n\r\n this._removeSecondaryCursors();\r\n\r\n const cursor = this.getCurrentCursor( true );\r\n const lastCode = this.code;\r\n\r\n if ( lastCode )\r\n {\r\n this.saveCursor( cursor, lastCode.cursorState );\r\n }\r\n\r\n this.code = this.loadedTabs[name];\r\n\r\n this.restoreCursor( cursor, this.code.cursorState );\r\n\r\n this.endSelection();\r\n\r\n this.hideAutoCompleteBox();\r\n\r\n this._updateDataInfoPanel( '@tab-name', name );\r\n\r\n if ( this.code.languageOverride )\r\n {\r\n this._changeLanguage( this.code.languageOverride );\r\n }\r\n else\r\n {\r\n this._changeLanguageFromExtension( LX.getExtension( name ) );\r\n }\r\n\r\n this.processLines();\r\n\r\n if ( !isNewTabButton && this.onSelectTab )\r\n {\r\n this.onSelectTab( name, this );\r\n }\r\n }\r\n\r\n _onContextMenuTab( isNewTabButton: boolean = false, event: any, name: string )\r\n {\r\n if ( isNewTabButton )\r\n {\r\n return;\r\n }\r\n\r\n new LX.DropdownMenu( event.target, [\r\n { name: 'Close', kbd: 'MWB', disabled: !this.allowClosingTabs, callback: () => {\r\n this.closeTab( name );\r\n } },\r\n { name: 'Close Others', disabled: !this.allowClosingTabs, callback: () => {\r\n for ( const [ key, data ] of Object.entries( this.tabs.tabs ) )\r\n {\r\n if ( key === '+' || key === name ) continue;\r\n this.closeTab( key );\r\n }\r\n } },\r\n { name: 'Close All', disabled: !this.allowClosingTabs, callback: () => {\r\n for ( const [ key, data ] of Object.entries( this.tabs.tabs ) )\r\n {\r\n if ( key === '+' ) continue;\r\n this.closeTab( key );\r\n }\r\n } },\r\n null,\r\n { name: 'Copy Path', icon: 'Copy', callback: () => {\r\n navigator.clipboard.writeText( this.openedTabs[name].path ?? '' );\r\n } }\r\n ], { side: 'bottom', align: 'start', event } );\r\n }\r\n\r\n addTab( name: string, selected: boolean, title?: string, options: any = {} )\r\n {\r\n // If already loaded, set new name...\r\n const repeats = Object.keys( this.loadedTabs ).slice( 1 ).reduce( ( v, key ) => {\r\n const noRepeatName = key.replace( /[_\\d+]/g, '' );\r\n return v + ( noRepeatName == name ? 1 : 0 );\r\n }, 0 );\r\n\r\n if ( repeats > 0 )\r\n {\r\n name = name.split( '.' ).join( '_' + repeats + '.' );\r\n }\r\n\r\n const isNewTabButton = name === '+';\r\n\r\n // Create code content\r\n let code = document.createElement( 'div' );\r\n let codeAny = code as any;\r\n Object.assign( code, {\r\n path: options.path ?? '',\r\n className: 'code',\r\n lines: [ '' ],\r\n language: options.language ?? 'Plain Text',\r\n cursorState: {},\r\n undoSteps: [],\r\n redoSteps: [],\r\n lineScopes: [],\r\n lineSymbols: [],\r\n lineSignatures: [],\r\n symbolsTable: new Map(),\r\n tabName: name,\r\n title: title ?? name,\r\n tokens: {}\r\n } );\r\n\r\n code.style.left = '0px', code.style.top = '0px', code.addEventListener( 'dragenter', function( e )\r\n {\r\n e.preventDefault();\r\n this.parentElement?.classList.add( 'dragging' );\r\n } );\r\n code.addEventListener( 'dragleave', function( e )\r\n {\r\n e.preventDefault();\r\n this.parentElement?.classList.remove( 'dragging' );\r\n } );\r\n code.addEventListener( 'drop', ( e ) => {\r\n e.preventDefault();\r\n code.parentElement?.classList.remove( 'dragging' );\r\n if ( e.dataTransfer?.files )\r\n {\r\n for ( let i = 0; i < e.dataTransfer.files.length; ++i )\r\n {\r\n this.loadFile( e.dataTransfer.files[i] );\r\n }\r\n }\r\n } );\r\n\r\n this.loadedTabs[name] = code;\r\n this.openedTabs[name] = code;\r\n\r\n const lastCode = this.code;\r\n\r\n this.code = code;\r\n\r\n const tabIcon = this._getFileIcon( name );\r\n\r\n if ( this.useFileExplorer && !isNewTabButton )\r\n {\r\n this.addExplorerItem( { id: name, skipVisibility: true, icon: tabIcon } );\r\n this.explorer.innerTree.frefresh( name );\r\n }\r\n\r\n if ( !this.skipTabs )\r\n {\r\n this.tabs.add( name, code, {\r\n selected: selected,\r\n fixed: isNewTabButton,\r\n title: code.title,\r\n icon: tabIcon,\r\n onSelect: this._onSelectTab.bind( this, isNewTabButton ),\r\n onContextMenu: this._onContextMenuTab.bind( this, isNewTabButton ),\r\n allowDelete: this.allowClosingTabs,\r\n indexOffset: options.indexOffset\r\n } );\r\n }\r\n\r\n // Move into the sizer..\r\n this.codeSizer.appendChild( code );\r\n\r\n this.endSelection();\r\n\r\n if ( options.language )\r\n {\r\n codeAny.languageOverride = options.language;\r\n this._changeLanguage( codeAny.languageOverride );\r\n this.mustProcessLines = true;\r\n }\r\n\r\n if ( options.codeLines )\r\n {\r\n codeAny.lines = options.codeLines;\r\n this.mustProcessLines = true;\r\n }\r\n\r\n if ( selected )\r\n {\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT_TOP, undefined, true );\r\n this.mustProcessLines = true;\r\n }\r\n else\r\n {\r\n this.code = lastCode;\r\n }\r\n\r\n this._processLinesIfNecessary();\r\n\r\n this._updateDataInfoPanel( '@tab-name', name );\r\n\r\n // Bc it could be overrided..\r\n return name;\r\n }\r\n\r\n loadCode( name: string )\r\n {\r\n // Hide all others\r\n this.codeSizer.querySelectorAll( '.code' ).forEach( ( c: HTMLElement ) => c.classList.add( 'hidden' ) );\r\n\r\n // Already open...\r\n if ( this.openedTabs[name] )\r\n {\r\n let code = this.openedTabs[name];\r\n code.classList.remove( 'hidden' );\r\n return;\r\n }\r\n\r\n let code = this.loadedTabs[name];\r\n if ( !code )\r\n {\r\n this.addTab( name, true );\r\n\r\n // Unload lines from storage...\r\n const tabData = this._tabStorage[name];\r\n if ( tabData )\r\n {\r\n this.code.lines = tabData.lines;\r\n\r\n if ( tabData.options.language )\r\n {\r\n this._changeLanguage( tabData.options.language, undefined, true );\r\n }\r\n else\r\n {\r\n this._changeLanguageFromExtension( LX.getExtension( name ) );\r\n }\r\n\r\n delete this._tabStorage[name];\r\n }\r\n\r\n this._processLinesIfNecessary();\r\n\r\n return;\r\n }\r\n\r\n this.openedTabs[name] = code;\r\n\r\n // Move into the sizer..\r\n this.codeSizer.appendChild( code );\r\n\r\n this.endSelection();\r\n\r\n // Select as current...\r\n this.code = code;\r\n this.mustProcessLines = true;\r\n\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT_TOP, undefined, true );\r\n this.processLines();\r\n this._changeLanguageFromExtension( LX.getExtension( name ) );\r\n this._processLinesIfNecessary();\r\n this._updateDataInfoPanel( '@tab-name', code.tabName );\r\n }\r\n\r\n loadTab( name: string )\r\n {\r\n // Already open...\r\n if ( this.openedTabs[name] )\r\n {\r\n this.tabs.select( name );\r\n return;\r\n }\r\n\r\n let code = this.loadedTabs[name];\r\n\r\n if ( !code )\r\n {\r\n this.addTab( name, true );\r\n\r\n // Unload lines from storage...\r\n const tabData = this._tabStorage[name];\r\n if ( tabData )\r\n {\r\n this.code.lines = tabData.lines;\r\n\r\n if ( tabData.options.language )\r\n {\r\n this._changeLanguage( tabData.options.language, undefined, true );\r\n }\r\n else\r\n {\r\n this._changeLanguageFromExtension( LX.getExtension( name ) );\r\n }\r\n\r\n delete this._tabStorage[name];\r\n }\r\n\r\n this._processLinesIfNecessary();\r\n\r\n return;\r\n }\r\n\r\n // Reset visibility\r\n code.style.display = 'block';\r\n\r\n this.openedTabs[name] = code;\r\n\r\n const isNewTabButton = name === '+';\r\n const tabIcon = this._getFileIcon( name );\r\n\r\n this.tabs.add( name, code, {\r\n selected: true,\r\n fixed: isNewTabButton,\r\n title: code.title,\r\n icon: tabIcon,\r\n onSelect: this._onSelectTab.bind( this, isNewTabButton ),\r\n onContextMenu: this._onContextMenuTab.bind( this, isNewTabButton ),\r\n allowDelete: this.allowClosingTabs\r\n } );\r\n\r\n // Move into the sizer..\r\n this.codeSizer.appendChild( code );\r\n\r\n this.endSelection();\r\n\r\n // Select as current...\r\n this.code = code;\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT_TOP, undefined, true );\r\n this._changeLanguageFromExtension( LX.getExtension( name ) );\r\n this._updateDataInfoPanel( '@tab-name', code.tabName );\r\n\r\n this.processLines();\r\n }\r\n\r\n closeTab( name: string, eraseAll: boolean = false )\r\n {\r\n if ( !this.allowClosingTabs )\r\n {\r\n return;\r\n }\r\n\r\n this.tabs.delete( name );\r\n\r\n if ( eraseAll )\r\n {\r\n delete this.openedTabs[name];\r\n delete this.loadedTabs[name];\r\n delete this._tabStorage[name];\r\n }\r\n }\r\n\r\n getSelectedTabName()\r\n {\r\n return this.tabs.selected;\r\n }\r\n\r\n loadTabFromFile()\r\n {\r\n const input = document.createElement( 'input' );\r\n input.type = 'file';\r\n document.body.appendChild( input );\r\n input.click();\r\n input.addEventListener( 'change', ( e ) => {\r\n const target = e.target as HTMLInputElement;\r\n if ( target.files && target.files[0] )\r\n {\r\n this.loadFile( target.files[0] );\r\n }\r\n input.remove();\r\n } );\r\n }\r\n\r\n processFocus( active: boolean = false )\r\n {\r\n if ( active )\r\n {\r\n this.restartBlink();\r\n }\r\n else\r\n {\r\n clearInterval( this.blinker );\r\n LX.removeClass( this.cursorsDOM, 'show' );\r\n }\r\n }\r\n\r\n processMouse( e: MouseEvent )\r\n {\r\n const target = e.target as HTMLElement;\r\n if ( !target.classList.contains( 'code' ) && !target.classList.contains( 'lexcodearea' ) ) return;\r\n if ( !this.code ) return;\r\n\r\n var cursor = this.getCurrentCursor();\r\n var code_rect = this.code.getBoundingClientRect();\r\n var mouse_pos = [ e.clientX - code_rect.x, e.clientY - code_rect.y ];\r\n\r\n // Discard out of lines click...\r\n var ln = ( mouse_pos[1] / this.lineHeight ) | 0;\r\n if ( ln < 0 ) return;\r\n\r\n if ( e.type == 'mousedown' )\r\n {\r\n // Left click only...\r\n if ( e.button === 2 )\r\n {\r\n this.processClick( e );\r\n\r\n this.canOpenContextMenu = !cursor.selection;\r\n\r\n if ( cursor.selection )\r\n {\r\n this.canOpenContextMenu = this.canOpenContextMenu\r\n || ( cursor.line >= cursor.selection.fromY && cursor.line <= cursor.selection.toY\r\n && cursor.position >= cursor.selection.fromX && cursor.position <= cursor.selection.toX );\r\n if ( this.canOpenContextMenu )\r\n {\r\n return;\r\n }\r\n }\r\n }\r\n\r\n this._mouseDown = true;\r\n this._lastMouseDown = LX.getTime();\r\n this.endSelection();\r\n this.processClick( e );\r\n }\r\n else if ( e.type == 'mouseup' )\r\n {\r\n this._onMouseUp( e );\r\n }\r\n else if ( e.type == 'mousemove' )\r\n {\r\n if ( this._mouseDown )\r\n {\r\n this.state.selectingText = true;\r\n this.processSelections( e );\r\n }\r\n }\r\n else if ( e.type == 'click' )\r\n { // trip\r\n switch ( e.detail )\r\n {\r\n case LX.MOUSE_DOUBLE_CLICK:\r\n const [ word, from, to ] = this.getWordAtPos( cursor );\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor );\r\n this.cursorToPosition( cursor, from );\r\n this.startSelection( cursor );\r\n cursor.selection!.selectInline( cursor, from, cursor.line, this.measureString( word ) );\r\n this.cursorToString( cursor, word ); // Go to the end of the word\r\n break;\r\n // Select entire line\r\n case LX.MOUSE_TRIPLE_CLICK:\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor );\r\n ( e as any )._shiftKey = true;\r\n this.actions['End'].callback( cursor.line, cursor, e );\r\n this._tripleClickSelection = true;\r\n break;\r\n }\r\n }\r\n else if ( e.type == 'contextmenu' )\r\n {\r\n e.preventDefault();\r\n\r\n if ( !this.canOpenContextMenu )\r\n {\r\n return;\r\n }\r\n\r\n LX.addContextMenu( null, e, ( m: typeof ContextMenu ) => {\r\n m.add( 'Copy', () => {\r\n this._copyContent( cursor );\r\n } );\r\n\r\n if ( !this.disableEdition )\r\n {\r\n m.add( 'Cut', () => {\r\n this._cutContent( cursor );\r\n } );\r\n m.add( 'Paste', () => {\r\n this._pasteContent( cursor );\r\n } );\r\n }\r\n\r\n if ( !this.onContextMenu )\r\n {\r\n return;\r\n }\r\n\r\n let content = null;\r\n\r\n if ( cursor.selection )\r\n {\r\n // Some selections don't depend on mouse up..\r\n if ( cursor.selection ) cursor.selection.invertIfNecessary();\r\n\r\n const separator = '_NEWLINE_';\r\n let code = this.code.lines.join( separator );\r\n\r\n // Get linear start index\r\n let index = 0;\r\n\r\n for ( let i = 0; i <= cursor.selection.fromY; i++ )\r\n {\r\n index += i == cursor.selection.fromY ? cursor.selection.fromX : this.code.lines[i].length;\r\n }\r\n\r\n index += cursor.selection.fromY * separator.length;\r\n const num_chars = cursor.selection.chars\r\n + ( cursor.selection.toY - cursor.selection.fromY ) * separator.length;\r\n const text = code.substr( index, num_chars );\r\n content = text.split( separator ).join( '\\n' );\r\n }\r\n\r\n const options = this.onContextMenu( this, content, e );\r\n if ( options.length )\r\n {\r\n m.add( '' );\r\n\r\n for ( const o of options )\r\n {\r\n m.add( o.path, { disabled: o.disabled, callback: o.callback } );\r\n }\r\n\r\n // m.add( \"Format/JSON\", () => {\r\n // let json = this.toJSONFormat( this.getText() );\r\n // if( !json )\r\n // return;\r\n // this.code.lines = json.split( \"\\n\" );\r\n // this.processLines();\r\n // } );\r\n }\r\n } );\r\n\r\n this.canOpenContextMenu = false;\r\n }\r\n }\r\n\r\n _onMouseUp( e: MouseEvent )\r\n {\r\n if ( ( LX.getTime() - this._lastMouseDown ) < 120 )\r\n {\r\n this.state.selectingText = false;\r\n this.endSelection();\r\n }\r\n\r\n const cursor = this.getCurrentCursor();\r\n if ( cursor.selection )\r\n {\r\n cursor.selection.invertIfNecessary();\r\n\r\n // If single line selection and no chars selected, remove selection\r\n const deltaY = cursor.selection.toY - cursor.selection.fromY;\r\n if ( cursor.selection.chars == 0 && deltaY == 0 )\r\n {\r\n this.endSelection();\r\n }\r\n }\r\n\r\n this._mouseDown = false;\r\n this.state.selectingText = false;\r\n delete this._lastSelectionKeyDir;\r\n }\r\n\r\n processClick( e: MouseEvent )\r\n {\r\n var cursor = this.getCurrentCursor();\r\n var code_rect = this.codeScroller.getBoundingClientRect();\r\n var position = [ ( e.clientX - code_rect.x ) + this.getScrollLeft(),\r\n ( e.clientY - code_rect.y ) + this.getScrollTop() ];\r\n var ln = ( position[1] / this.lineHeight ) | 0;\r\n\r\n // Check out of range line\r\n const outOfRange = ln > this.code.lines.length - 1;\r\n ln = Math.min( ln, this.code.lines.length - 1 );\r\n\r\n var ch = ( ( position[0] - parseInt( this.xPadding ) + 3 ) / this.charWidth ) | 0;\r\n var string = outOfRange ? this.code.lines[ln] : this.code.lines[ln].slice( 0, ch );\r\n\r\n // Move main cursor there...\r\n if ( !e.altKey )\r\n {\r\n // Make sure we only keep the main cursor..\r\n this._removeSecondaryCursors();\r\n this.cursorToLine( cursor, ln );\r\n this.cursorToPosition( cursor, string.length );\r\n }\r\n // Add new cursor\r\n else\r\n {\r\n this._addCursor( ln, string.length );\r\n }\r\n\r\n this.hideAutoCompleteBox();\r\n }\r\n\r\n updateSelections( e: any, keepRange: boolean = false, flags: number = CodeEditor.SELECTION_X_Y )\r\n {\r\n for ( let cursor of this.cursors )\r\n {\r\n if ( !cursor.selection )\r\n {\r\n continue;\r\n }\r\n\r\n this._processSelection( cursor, e, keepRange, flags );\r\n }\r\n }\r\n\r\n processSelections( e: any, keepRange: boolean = false, flags: number = CodeEditor.SELECTION_X_Y )\r\n {\r\n for ( let cursor of this.cursors )\r\n {\r\n this._processSelection( cursor, e, keepRange, flags );\r\n }\r\n }\r\n\r\n _processSelection( cursor: Cursor, e?: any, keepRange: boolean = false, flags: number = CodeEditor.SELECTION_X_Y )\r\n {\r\n const isMouseEvent = e && ( e.constructor == MouseEvent );\r\n\r\n if ( isMouseEvent )\r\n {\r\n this.processClick( e );\r\n }\r\n\r\n if ( !cursor.selection )\r\n {\r\n this.startSelection( cursor );\r\n }\r\n\r\n const selection = cursor.selection!;\r\n\r\n this._hideActiveLine();\r\n\r\n // Update selection\r\n if ( !keepRange )\r\n {\r\n let ccw = true;\r\n\r\n // Check if we must change ccw or not ... (not with mouse)\r\n if ( !isMouseEvent && cursor.line >= selection.fromY\r\n && ( cursor.line == selection.fromY ? cursor.position >= selection.fromX : true ) )\r\n {\r\n ccw = e && this._lastSelectionKeyDir\r\n && ( e.key == 'ArrowRight' || e.key == 'ArrowDown' || e.key == 'End' );\r\n }\r\n\r\n if ( ccw )\r\n {\r\n if ( flags & CodeEditor.SELECTION_X ) selection.fromX = cursor.position;\r\n if ( flags & CodeEditor.SELECTION_Y ) selection.fromY = cursor.line;\r\n }\r\n else\r\n {\r\n if ( flags & CodeEditor.SELECTION_X ) selection.toX = cursor.position;\r\n if ( flags & CodeEditor.SELECTION_Y ) selection.toY = cursor.line;\r\n }\r\n\r\n this._lastSelectionKeyDir = ccw;\r\n }\r\n\r\n // Only leave if not a mouse selection...\r\n if ( !isMouseEvent && selection.isEmpty() )\r\n {\r\n this.endSelection();\r\n return;\r\n }\r\n\r\n selection.chars = 0;\r\n\r\n const fromX = selection.fromX,\r\n fromY = selection.fromY,\r\n toX = selection.toX,\r\n toY = selection.toY;\r\n const deltaY = toY - fromY;\r\n\r\n let cursorSelections = this.selections[cursor.name];\r\n\r\n // Selection goes down...\r\n if ( deltaY >= 0 )\r\n {\r\n while ( deltaY < ( cursorSelections.childElementCount - 1 ) )\r\n {\r\n LX.deleteElement( cursorSelections.lastChild );\r\n }\r\n\r\n for ( let i = fromY; i <= toY; i++ )\r\n {\r\n const sId = i - fromY;\r\n const isVisible = i >= this.visibleLinesViewport.x && i <= this.visibleLinesViewport.y;\r\n let domEl = null;\r\n\r\n if ( isVisible )\r\n {\r\n // Make sure that the line selection is generated...\r\n domEl = cursorSelections.childNodes[sId];\r\n if ( !domEl )\r\n {\r\n domEl = document.createElement( 'div' );\r\n domEl.className = 'lexcodeselection';\r\n cursorSelections.appendChild( domEl );\r\n }\r\n }\r\n\r\n // Compute new width and selection margins\r\n let string = '';\r\n\r\n if ( sId == 0 )\r\n { // First line 2 cases (single line, multiline)\r\n const reverse = fromX > toX;\r\n if ( deltaY == 0 )\r\n {\r\n string = !reverse\r\n ? this.code.lines[i].substring( fromX, toX )\r\n : this.code.lines[i].substring( toX, fromX );\r\n }\r\n else string = this.code.lines[i].substr( fromX );\r\n const pixels = ( reverse && deltaY == 0 ? toX : fromX ) * this.charWidth;\r\n if ( isVisible ) domEl.style.left = `calc(${pixels}px + ${this.xPadding})`;\r\n }\r\n else\r\n {\r\n string = ( i == toY ) ? this.code.lines[i].substring( 0, toX ) : this.code.lines[i]; // Last line, any multiple line...\r\n if ( isVisible ) domEl.style.left = this.xPadding;\r\n }\r\n\r\n const stringWidth = this.measureString( string );\r\n selection.chars += stringWidth / this.charWidth;\r\n\r\n if ( isVisible )\r\n {\r\n domEl.style.width = ( stringWidth || ( deltaY == 0 ? 0 : 8 ) ) + 'px';\r\n domEl._top = i * this.lineHeight;\r\n domEl.style.top = domEl._top + 'px';\r\n }\r\n }\r\n }\r\n // Selection goes up...\r\n else\r\n {\r\n while ( Math.abs( deltaY ) < ( cursorSelections.childElementCount - 1 ) )\r\n {\r\n LX.deleteElement( cursorSelections.firstChild );\r\n }\r\n\r\n for ( let i = toY; i <= fromY; i++ )\r\n {\r\n const sId = i - toY;\r\n const isVisible = i >= this.visibleLinesViewport.x && i <= this.visibleLinesViewport.y;\r\n let domEl = null;\r\n\r\n if ( isVisible )\r\n {\r\n // Make sure that the line selection is generated...\r\n domEl = cursorSelections.childNodes[sId];\r\n if ( !domEl )\r\n {\r\n domEl = document.createElement( 'div' );\r\n domEl.className = 'lexcodeselection';\r\n cursorSelections.appendChild( domEl );\r\n }\r\n }\r\n\r\n // Compute new width and selection margins\r\n let string;\r\n\r\n if ( sId == 0 )\r\n {\r\n string = this.code.lines[i].substr( toX );\r\n const pixels = toX * this.charWidth;\r\n if ( isVisible ) domEl.style.left = 'calc(' + pixels + 'px + ' + this.xPadding + ')';\r\n }\r\n else\r\n {\r\n string = ( i == fromY ) ? this.code.lines[i].substring( 0, fromX ) : this.code.lines[i]; // Last line, any multiple line...\r\n if ( isVisible ) domEl.style.left = this.xPadding;\r\n }\r\n\r\n const stringWidth = this.measureString( string );\r\n selection.chars += stringWidth / this.charWidth;\r\n\r\n if ( isVisible )\r\n {\r\n domEl.style.width = ( stringWidth || 8 ) + 'px';\r\n domEl._top = i * this.lineHeight;\r\n domEl.style.top = domEl._top + 'px';\r\n }\r\n }\r\n }\r\n }\r\n\r\n async processKey( e: KeyboardEvent )\r\n {\r\n const numCursors = this.cursors.length;\r\n\r\n if ( !this.code || e.srcElement?.constructor != HTMLDivElement )\r\n {\r\n return;\r\n }\r\n\r\n const detail = ( e as any ).detail ?? {};\r\n const key = e.key ?? detail.key;\r\n\r\n // Do not propagate \"space to scroll\" event\r\n if ( key == ' ' )\r\n {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n }\r\n\r\n const target = detail.targetCursor;\r\n\r\n // Global keys\r\n\r\n if ( this._processGlobalKeys( e, key ) )\r\n {\r\n // Stop propagation..\r\n return;\r\n }\r\n\r\n // By cursor keys\r\n\r\n if ( target !== undefined )\r\n {\r\n this.processKeyAtTargetCursor( e, key, target );\r\n return;\r\n }\r\n\r\n this._lastProcessedCursorIndex = null;\r\n\r\n var lastProcessedCursor = null;\r\n var cursorOffset = new LX.vec2( 0, 0 );\r\n\r\n for ( var i = 0; i < numCursors; i++ )\r\n {\r\n let cursor = this.cursors[i];\r\n\r\n // We could delete secondary cursor while iterating..\r\n if ( !cursor )\r\n {\r\n break;\r\n }\r\n\r\n // Arrows don't modify code lines.. And only add offset if in the same line\r\n if ( lastProcessedCursor && lastProcessedCursor.line == cursor.line && !key.includes( 'Arrow' ) )\r\n {\r\n cursor.position += cursorOffset.x;\r\n cursor.line += cursorOffset.y;\r\n\r\n this.relocateCursors();\r\n }\r\n\r\n lastProcessedCursor = this.saveCursor( cursor );\r\n this._lastProcessedCursorIndex = i;\r\n\r\n this._processKeyAtCursor( e, key, cursor );\r\n\r\n cursorOffset.x += cursor.position - lastProcessedCursor.position;\r\n cursorOffset.y += cursor.line - lastProcessedCursor.line;\r\n\r\n // Set active line in case it's blurred\r\n if ( !cursor.selection )\r\n {\r\n cursor.line = cursor.line;\r\n }\r\n }\r\n\r\n // Clear tmp\r\n delete this._lastProcessedCursorIndex;\r\n }\r\n\r\n async processKeyAtTargetCursor( e: KeyboardEvent, key: string, targetIdx: number )\r\n {\r\n let cursor = this.cursors[targetIdx];\r\n\r\n // We could delete secondary cursor while iterating..\r\n if ( !cursor )\r\n {\r\n return;\r\n }\r\n\r\n this._processKeyAtCursor( e, key, cursor );\r\n this._processGlobalKeys( e, key );\r\n }\r\n\r\n _processGlobalKeys( e: KeyboardEvent, key: string )\r\n {\r\n let cursor = this.getCurrentCursor();\r\n\r\n if ( e.ctrlKey || e.metaKey )\r\n {\r\n switch ( key.toLowerCase() )\r\n {\r\n case 'a': // select all\r\n e.preventDefault();\r\n this.selectAll();\r\n return true;\r\n case 'b': // k+b comment block\r\n e.preventDefault();\r\n if ( this.state.keyChain == 'k' )\r\n {\r\n this._commentLines( cursor, true );\r\n return true;\r\n }\r\n return false;\r\n case 'c': // k+c, comment line\r\n e.preventDefault();\r\n if ( this.state.keyChain == 'k' )\r\n {\r\n this._commentLines( cursor );\r\n return true;\r\n }\r\n return false;\r\n case 'd': // next ocurrence\r\n e.preventDefault();\r\n this.selectNextOcurrence( cursor );\r\n return true;\r\n case 'f': // find/search\r\n e.preventDefault();\r\n this.showSearchBox();\r\n return true;\r\n case 'g': // find line\r\n e.preventDefault();\r\n this.showSearchLineBox();\r\n return true;\r\n case 'k': // shortcut chain\r\n e.preventDefault();\r\n this.state.keyChain = 'k';\r\n return true;\r\n case 's': // save\r\n e.preventDefault();\r\n if ( this.onSave )\r\n {\r\n this.onSave( this.getText() );\r\n }\r\n return true;\r\n case 'u': // k+u, uncomment line\r\n e.preventDefault();\r\n if ( this.state.keyChain == 'k' )\r\n {\r\n this._uncommentLines( cursor );\r\n return true;\r\n }\r\n return false;\r\n case 'y': // redo\r\n e.preventDefault();\r\n this._doRedo( cursor );\r\n return true;\r\n case 'z': // undo\r\n e.preventDefault();\r\n this._doUndo( cursor );\r\n return true;\r\n case '+': // increase size\r\n e.preventDefault();\r\n this._increaseFontSize();\r\n return true;\r\n case '-': // decrease size\r\n e.preventDefault();\r\n this._decreaseFontSize();\r\n return true;\r\n case ' ': // custom event\r\n if ( this.onCtrlSpace )\r\n {\r\n e.preventDefault();\r\n this.onCtrlSpace( cursor );\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n this.state.keyChain = null;\r\n return false;\r\n }\r\n\r\n async _processKeyAtCursor( e: KeyboardEvent, key: string, cursor: Cursor )\r\n {\r\n const detail = ( e as any ).detail ?? {};\r\n const skipUndo = detail.skipUndo ?? false;\r\n const skipDeleteSelection = detail.skipDeleteSelection ?? false;\r\n\r\n // keys with length > 1 are probably special keys\r\n if ( key.length > 1 && this.specialKeys.indexOf( key ) == -1 )\r\n {\r\n return;\r\n }\r\n\r\n let lidx = cursor.line;\r\n this.code.lines[lidx] = this.code.lines[lidx] ?? '';\r\n\r\n // Check combinations\r\n\r\n const isLastCursor = cursor.isLast();\r\n\r\n if ( e.ctrlKey || e.metaKey )\r\n {\r\n switch ( key.toLowerCase() )\r\n {\r\n case 'c': // copy\r\n this._copyContent( cursor );\r\n return;\r\n case 'v': // paste\r\n this._pasteContent( cursor );\r\n return;\r\n case 'x': // cut line\r\n this._cutContent( cursor );\r\n this.hideAutoCompleteBox();\r\n return;\r\n case 'arrowdown': // add cursor below only for the main cursor..\r\n // Make sure shift is not pressed..\r\n if ( !e.shiftKey && isLastCursor && this.code.lines[lidx + 1] != undefined )\r\n {\r\n var newCursor: Cursor | null = this._addCursor( cursor.line, cursor.position, true );\r\n if ( !newCursor ) return;\r\n this.lineDown( newCursor );\r\n return;\r\n }\r\n }\r\n }\r\n else if ( e.altKey )\r\n {\r\n switch ( key )\r\n {\r\n case 'd': // duplicate line\r\n e.preventDefault();\r\n this._duplicateLine( lidx, cursor );\r\n return;\r\n case 'ArrowUp':\r\n this.swapLines( lidx, -1, cursor );\r\n return;\r\n case 'ArrowDown':\r\n this.swapLines( lidx, 1, cursor );\r\n return;\r\n }\r\n }\r\n\r\n // Apply binded actions...\r\n\r\n for ( const actKey in this.actions )\r\n {\r\n if ( key != actKey )\r\n {\r\n continue;\r\n }\r\n\r\n e.preventDefault();\r\n\r\n if ( this._actionMustDelete( cursor, this.actions[key], e ) )\r\n {\r\n this.actions['Backspace'].callback( lidx, cursor, e );\r\n }\r\n\r\n return this.actions[key].callback( lidx, cursor, e );\r\n }\r\n\r\n // From now on, don't allow ctrl, shift or meta (mac) combinations\r\n if ( e.ctrlKey || e.metaKey )\r\n {\r\n return;\r\n }\r\n\r\n // Add undo steps\r\n\r\n if ( !skipUndo && this.code.lines.length )\r\n {\r\n this._addUndoStep( cursor );\r\n }\r\n\r\n // Some custom cases for word enclosing (), {}, \"\", '', ...\r\n\r\n const enclosableKeys = [ '\"', \"'\", '(', '{' ];\r\n if ( enclosableKeys.indexOf( key ) > -1 )\r\n {\r\n if ( this._encloseSelectedWordWithKey( key, lidx, cursor ) )\r\n {\r\n return;\r\n }\r\n }\r\n\r\n // Until this point, if there was a selection, we need\r\n // to delete the content..\r\n\r\n if ( cursor.selection && !skipDeleteSelection )\r\n {\r\n this.actions['Backspace'].callback( lidx, cursor, e );\r\n lidx = cursor.line;\r\n }\r\n\r\n // Append key\r\n\r\n const isPairKey = ( Object.values( this.pairKeys ).indexOf( key ) > -1 ) && !this.wasKeyPaired;\r\n const sameKeyNext = isPairKey && ( this.code.lines[lidx][cursor.position] === key );\r\n\r\n if ( !sameKeyNext )\r\n {\r\n this.code.lines[lidx] = [\r\n this.code.lines[lidx].slice( 0, cursor.position ),\r\n key,\r\n this.code.lines[lidx].slice( cursor.position )\r\n ].join( '' );\r\n }\r\n\r\n this.cursorToRight( key, cursor );\r\n\r\n // Some custom cases for auto key pair (), {}, \"\", '', ...\r\n\r\n const keyMustPair = this.pairKeys[key] !== undefined;\r\n if ( keyMustPair && !this.wasKeyPaired )\r\n {\r\n // Make sure to detect later that the key is paired automatically to avoid loops...\r\n this.wasKeyPaired = true;\r\n\r\n if ( sameKeyNext ) return;\r\n\r\n this.root.dispatchEvent( new KeyboardEvent( 'keydown', { 'key': this.pairKeys[key] } ) );\r\n this.cursorToLeft( key, cursor );\r\n return;\r\n }\r\n\r\n // Once here we can pair keys again\r\n delete this.wasKeyPaired;\r\n\r\n // Update only the current line, since it's only an appended key\r\n this.processLine( lidx );\r\n\r\n // We are out of the viewport and max length is different? Resize scrollbars...\r\n this.resizeIfNecessary( cursor );\r\n\r\n // Manage autocomplete\r\n\r\n if ( this.useAutoComplete )\r\n {\r\n this.showAutoCompleteBox( key, cursor );\r\n }\r\n }\r\n\r\n async _pasteContent( cursor: Cursor )\r\n {\r\n const mustDetectLanguage = !this.getText().length;\r\n\r\n let text = await navigator.clipboard.readText();\r\n\r\n // Remove any possible tabs (\\t) and add spaces\r\n text = text.replaceAll( /\\t|\\\\t/g, ' '.repeat( this.tabSpaces ) );\r\n\r\n this._addUndoStep( cursor, true );\r\n\r\n this.appendText( text, cursor );\r\n\r\n const currentScroll = this.getScrollTop();\r\n const scroll = Math.max( cursor.line * this.lineHeight - this.codeScroller.offsetWidth, 0 );\r\n\r\n if ( currentScroll < scroll )\r\n {\r\n this.codeScroller.scrollTo( 0, cursor.line * this.lineHeight );\r\n }\r\n\r\n if ( mustDetectLanguage )\r\n {\r\n const detectedLang = this._detectLanguage( text );\r\n if ( detectedLang )\r\n {\r\n this._changeLanguage( detectedLang );\r\n }\r\n }\r\n }\r\n\r\n async _copyContent( cursor: Cursor )\r\n {\r\n let textToCopy = '';\r\n\r\n if ( !cursor.selection )\r\n {\r\n textToCopy = '\\n' + this.code.lines[cursor.line];\r\n }\r\n else\r\n {\r\n // Some selections don't depend on mouse up..\r\n if ( cursor.selection ) cursor.selection.invertIfNecessary();\r\n\r\n const separator = '_NEWLINE_';\r\n let code = this.code.lines.join( separator );\r\n\r\n // Get linear start index\r\n let index = 0;\r\n\r\n for ( let i = 0; i <= cursor.selection.fromY; i++ )\r\n {\r\n index += i == cursor.selection.fromY ? cursor.selection.fromX : this.code.lines[i].length;\r\n }\r\n\r\n index += cursor.selection.fromY * separator.length;\r\n const num_chars = cursor.selection.chars\r\n + ( cursor.selection.toY - cursor.selection.fromY ) * separator.length;\r\n const text = code.substr( index, num_chars );\r\n const lines = text.split( separator );\r\n textToCopy = lines.join( '\\n' );\r\n }\r\n\r\n navigator.clipboard.writeText( textToCopy );\r\n // .then(() => console.log(\"Successfully copied\"), (err) => console.error(\"Error\"));\r\n }\r\n\r\n async _cutContent( cursor: Cursor )\r\n {\r\n let lidx = cursor.line;\r\n let textToCut = '';\r\n\r\n this._addUndoStep( cursor, true );\r\n\r\n if ( !cursor.selection )\r\n {\r\n textToCut = '\\n' + this.code.lines[cursor.line];\r\n this.code.lines.splice( lidx, 1 );\r\n this.processLines();\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor );\r\n if ( this.code.lines[lidx] == undefined )\r\n {\r\n this.lineUp( cursor );\r\n }\r\n }\r\n else\r\n {\r\n // Some selections don't depend on mouse up..\r\n if ( cursor.selection ) cursor.selection.invertIfNecessary();\r\n\r\n const separator = '_NEWLINE_';\r\n let code = this.code.lines.join( separator );\r\n\r\n // Get linear start index\r\n let index = 0;\r\n\r\n for ( let i = 0; i <= cursor.selection.fromY; i++ )\r\n {\r\n index += i == cursor.selection.fromY ? cursor.selection.fromX : this.code.lines[i].length;\r\n }\r\n\r\n index += cursor.selection.fromY * separator.length;\r\n const numChars = cursor.selection.chars\r\n + ( cursor.selection.toY - cursor.selection.fromY ) * separator.length;\r\n const text = code.substr( index, numChars );\r\n const lines = text.split( separator );\r\n textToCut = lines.join( '\\n' );\r\n\r\n this.deleteSelection( cursor );\r\n }\r\n\r\n navigator.clipboard.writeText( textToCut );\r\n // .then(() => console.log(\"Successfully cut\"), (err) => console.error(\"Error\"));\r\n }\r\n\r\n _duplicateLine( lidx: number, cursor: Cursor )\r\n {\r\n this.endSelection();\r\n this._addUndoStep( cursor, true );\r\n this.code.lines.splice( lidx, 0, this.code.lines[lidx] );\r\n this.lineDown( cursor );\r\n this.processLines();\r\n this.hideAutoCompleteBox();\r\n }\r\n\r\n _commentLines( cursor: Cursor, useCommentBlock: boolean = false )\r\n {\r\n const lang = CodeEditor.languages[this.highlight];\r\n\r\n this.state.keyChain = null;\r\n\r\n cursor = cursor ?? this.getCurrentCursor();\r\n\r\n if ( cursor.selection )\r\n {\r\n if ( !( ( useCommentBlock ? lang.blockComments : lang.singleLineComments ) ?? true ) )\r\n {\r\n return;\r\n }\r\n\r\n this._addUndoStep( cursor, true );\r\n\r\n const selectedLines = this.code.lines.slice( cursor.selection.fromY, cursor.selection.toY + 1 );\r\n const minIdx = Math.min( ...selectedLines.map( ( v: string ) => {\r\n var idx = firstNonspaceIndex( v );\r\n return idx < 0 ? 1e10 : idx;\r\n } ) );\r\n\r\n if ( useCommentBlock )\r\n {\r\n const tokens = lang.blockCommentsTokens ?? this.defaultBlockCommentTokens;\r\n\r\n const fromString = this.code.lines[cursor.selection.fromY];\r\n let fromIdx = firstNonspaceIndex( fromString );\r\n if ( fromIdx == -1 )\r\n {\r\n fromIdx = 0;\r\n }\r\n\r\n this.code.lines[cursor.selection.fromY] = [\r\n fromString.substring( 0, fromIdx ),\r\n tokens[0] + ' ',\r\n fromString.substring( fromIdx )\r\n ].join( '' );\r\n\r\n this.code.lines[cursor.selection.toY] += ' ' + tokens[1];\r\n\r\n cursor.selection.fromX += tokens[0].length + 1;\r\n this._processSelection( cursor );\r\n }\r\n else\r\n {\r\n for ( let i = cursor.selection.fromY; i <= cursor.selection.toY; ++i )\r\n {\r\n this._commentLine( cursor, i, minIdx, false );\r\n }\r\n\r\n const token = ( lang.singleLineCommentToken ?? this.defaultSingleLineCommentToken ) + ' ';\r\n this.cursorToString( cursor, token );\r\n\r\n cursor.selection.fromX += token.length;\r\n cursor.selection.toX += token.length;\r\n this._processSelection( cursor );\r\n }\r\n }\r\n else\r\n {\r\n if ( !( lang.singleLineComments ?? true ) )\r\n {\r\n return;\r\n }\r\n\r\n for ( const cr of this.cursors )\r\n {\r\n this._addUndoStep( cr, true );\r\n this._commentLine( cr, cr.line );\r\n }\r\n }\r\n\r\n this.processLines();\r\n this._hideActiveLine();\r\n }\r\n\r\n _commentLine( cursor: Cursor, line: number, minNonspaceIdx?: number, updateCursor = true )\r\n {\r\n const lang = CodeEditor.languages[this.highlight];\r\n if ( !( lang.singleLineComments ?? true ) )\r\n {\r\n return;\r\n }\r\n\r\n const token = ( lang.singleLineCommentToken ?? this.defaultSingleLineCommentToken ) + ' ';\r\n const string = this.code.lines[line];\r\n\r\n let idx = firstNonspaceIndex( string );\r\n if ( idx == -1 )\r\n {\r\n return;\r\n }\r\n\r\n // Update idx using min of the selected lines (if necessary..)\r\n idx = minNonspaceIdx ?? idx;\r\n\r\n this.code.lines[line] = [\r\n string.substring( 0, idx ),\r\n token,\r\n string.substring( idx )\r\n ].join( '' );\r\n\r\n if ( updateCursor )\r\n {\r\n this.cursorToString( cursor, token );\r\n }\r\n }\r\n\r\n _uncommentLines( cursor: Cursor )\r\n {\r\n this.state.keyChain = null;\r\n\r\n const currCursor = this.getCurrentCursor();\r\n\r\n if ( currCursor.selection !== null )\r\n {\r\n this._addUndoStep( cursor, true );\r\n\r\n for ( var i = currCursor.selection.fromY; i <= currCursor.selection.toY; ++i )\r\n {\r\n this._uncommentLine( cursor, i );\r\n }\r\n }\r\n else\r\n {\r\n for ( let cursor of this.cursors )\r\n {\r\n this._addUndoStep( cursor, true );\r\n this._uncommentLine( cursor, cursor.line );\r\n }\r\n }\r\n\r\n this.processLines();\r\n this._hideActiveLine();\r\n }\r\n\r\n _uncommentLine( cursor: Cursor, line: number )\r\n {\r\n const lang = CodeEditor.languages[this.highlight];\r\n\r\n if ( !( lang.singleLineComments ?? true ) )\r\n {\r\n return;\r\n }\r\n\r\n const token = lang.singleLineCommentToken ?? this.defaultSingleLineCommentToken;\r\n const string = this.code.lines[line];\r\n\r\n if ( string.includes( token ) )\r\n {\r\n this.code.lines[line] = string.replace( token + ' ', '' );\r\n\r\n // try deleting token + space, and then if not, delete only the token\r\n if ( string.length == this.code.lines[line].length )\r\n {\r\n this.code.lines[line] = string.replace( token, '' );\r\n }\r\n\r\n this.cursorToString( cursor, 'X'.repeat( Math.abs( string.length - this.code.lines[line].length ) ), true );\r\n }\r\n }\r\n\r\n action( key: string, deleteSelection: boolean = false, fn?: ( l: number, cursor: Cursor, e: any ) => void,\r\n eventSkipDeleteFn?: any )\r\n {\r\n this.actions[key] = {\r\n 'key': key,\r\n 'callback': fn,\r\n 'deleteSelection': deleteSelection,\r\n 'eventSkipDeleteFn': eventSkipDeleteFn\r\n };\r\n }\r\n\r\n _actionMustDelete( cursor: Cursor, action: any, e: any )\r\n {\r\n return cursor.selection && action.deleteSelection\r\n && !( action.eventSkipDeleteFn ? action.eventSkipDeleteFn( cursor, e ) : false );\r\n }\r\n\r\n scanWordSuggestions()\r\n {\r\n this.code.tokens = {};\r\n\r\n for ( let i = 0; i < this.code.lines.length; ++i )\r\n {\r\n const lineString = this.code.lines[i];\r\n const tokens = this._getTokensFromLine( lineString, true );\r\n tokens.forEach( ( t: string ) => this.code.tokens[t] = 1 );\r\n }\r\n }\r\n\r\n toLocalLine( line: number )\r\n {\r\n const d = Math.max( this.firstLineInViewport - this.lineScrollMargin.x, 0 );\r\n return Math.min( Math.max( line - d, 0 ), this.code.lines.length - 1 );\r\n }\r\n\r\n getMaxLineLength()\r\n {\r\n return Math.max( ...this.code.lines.map( ( v: string ) => v.length ) );\r\n }\r\n\r\n _processLinesIfNecessary()\r\n {\r\n if ( this.mustProcessLines )\r\n {\r\n this.mustProcessLines = false;\r\n this.processLines();\r\n }\r\n }\r\n\r\n processLines( mode?: number )\r\n {\r\n if ( !this.code )\r\n {\r\n return;\r\n }\r\n\r\n var htmlCode = '';\r\n this._blockCommentCache.length = 0;\r\n this.mustProcessLines = false;\r\n\r\n // Reset all lines content\r\n this.code.innerHTML = '';\r\n\r\n // Get info about lines in viewport\r\n const lastScrollTop = this.getScrollTop();\r\n this.firstLineInViewport = ( mode ?? CodeEditor.KEEP_VISIBLE_LINES ) & CodeEditor.UPDATE_VISIBLE_LINES\r\n ? ( ( lastScrollTop / this.lineHeight ) | 0 )\r\n : this.firstLineInViewport;\r\n const totalLinesInViewport = ( ( this.codeScroller.offsetHeight ) / this.lineHeight ) | 0;\r\n this.visibleLinesViewport = new LX.vec2(\r\n Math.max( this.firstLineInViewport - this.lineScrollMargin.x, 0 ),\r\n Math.min( this.firstLineInViewport + totalLinesInViewport + this.lineScrollMargin.y,\r\n this.code.lines.length )\r\n );\r\n\r\n // Add remaining lines if we are near the end of the scroll\r\n {\r\n const diff = Math.max( this.code.lines.length - this.visibleLinesViewport.y, 0 );\r\n if ( diff <= this.lineScrollMargin.y )\r\n {\r\n this.visibleLinesViewport.y += diff;\r\n }\r\n }\r\n\r\n this._scopeStack = [ { name: '', type: 'global' } ];\r\n\r\n // Process visible lines\r\n for ( let i = this.visibleLinesViewport.x; i < this.visibleLinesViewport.y; ++i )\r\n {\r\n htmlCode += this.processLine( i, true );\r\n }\r\n\r\n this.code.innerHTML = htmlCode;\r\n\r\n // Update scroll data\r\n this.codeScroller.scrollTop = lastScrollTop;\r\n this.code.style.top = ( this.visibleLinesViewport.x * this.lineHeight ) + 'px';\r\n\r\n // Update selections\r\n this.updateSelections( null, true );\r\n\r\n this._clearTmpVariables();\r\n this._setActiveLine();\r\n this.resize();\r\n }\r\n\r\n processLine( lineNumber: number, force: boolean = false, skipPropagation: boolean = false )\r\n {\r\n if ( this._scopeStack )\r\n {\r\n this.code.lineScopes[lineNumber] = [ ...this._scopeStack ];\r\n }\r\n else\r\n {\r\n this.code.lineScopes[lineNumber] = this.code.lineScopes[lineNumber] ?? [];\r\n this._scopeStack = [ ...this.code.lineScopes[lineNumber] ];\r\n }\r\n\r\n const lang = CodeEditor.languages[this.highlight];\r\n const localLineNum = this.toLocalLine( lineNumber );\r\n const lineString = this.code.lines[lineNumber];\r\n if ( lineString === undefined )\r\n {\r\n return;\r\n }\r\n\r\n this._lastProcessedLine = lineNumber;\r\n\r\n // multi-line strings not supported by now\r\n delete this._buildingString;\r\n delete this._pendingString;\r\n delete this._markdownHeader;\r\n\r\n // Single line\r\n if ( !force )\r\n {\r\n LX.deleteElement( this.code.childNodes[localLineNum] );\r\n LX.insertChildAtIndex( this.code, document.createElement( 'pre' ), localLineNum );\r\n }\r\n\r\n // Early out check for no highlighting languages\r\n if ( this.highlight == 'Plain Text' )\r\n {\r\n const plainTextHtml = lineString.replaceAll( '<', '<' ).replaceAll( '>', '>' );\r\n return this._updateLine( force, lineNumber, plainTextHtml, skipPropagation );\r\n }\r\n\r\n this._currentLineNumber = lineNumber;\r\n this._currentLineString = lineString;\r\n\r\n const tokensToEvaluate = this._getTokensFromLine( lineString );\r\n if ( !tokensToEvaluate.length )\r\n {\r\n return this._updateLine( force, lineNumber, '', skipPropagation );\r\n }\r\n\r\n let lineInnerHtml = '';\r\n let pushedScope = false;\r\n\r\n const newSignature = this._getLineSignatureFromTokens( tokensToEvaluate );\r\n const cachedSignature = this.code.lineSignatures[lineNumber];\r\n const mustUpdateScopes = ( cachedSignature !== newSignature ) && !force;\r\n const blockComments = lang.blockComments ?? true;\r\n const blockCommentsTokens = lang.blockCommentsTokens ?? this.defaultBlockCommentTokens;\r\n\r\n // Reset scope stack if structural changes in current line\r\n if ( mustUpdateScopes )\r\n {\r\n this._scopeStack = [ { name: '', type: 'global' } ];\r\n }\r\n\r\n // Process all tokens\r\n for ( let i = 0; i < tokensToEvaluate.length; ++i )\r\n {\r\n let it = i - 1;\r\n let prev = tokensToEvaluate[it];\r\n while ( prev == ' ' )\r\n {\r\n it--;\r\n prev = tokensToEvaluate[it];\r\n }\r\n\r\n it = i + 1;\r\n let next = tokensToEvaluate[it];\r\n while ( next == ' ' || next == '\"' )\r\n {\r\n it++;\r\n next = tokensToEvaluate[it];\r\n }\r\n\r\n const token = tokensToEvaluate[i];\r\n const tokenIndex = i;\r\n const tokenStartIndex = this._currentTokenPositions[tokenIndex];\r\n\r\n if ( blockComments )\r\n {\r\n if ( token.substr( 0, blockCommentsTokens[0].length ) == blockCommentsTokens[0] )\r\n {\r\n this._buildingBlockComment = [ lineNumber, tokenStartIndex ];\r\n }\r\n }\r\n\r\n // Compare line signature for structural changes\r\n // to pop current scope if necessary\r\n if ( token === '}' && this._scopeStack.length > 1 )\r\n {\r\n this._scopeStack.pop();\r\n }\r\n\r\n lineInnerHtml += this._evaluateToken( {\r\n token,\r\n prev,\r\n prevWithSpaces: tokensToEvaluate[i - 1],\r\n next,\r\n nextWithSpaces: tokensToEvaluate[i + 1],\r\n tokenIndex,\r\n isFirstToken: ( tokenIndex == 0 ),\r\n isLastToken: ( tokenIndex == tokensToEvaluate.length - 1 ),\r\n tokens: tokensToEvaluate\r\n } );\r\n\r\n if ( blockComments && this._buildingBlockComment != undefined\r\n && token.substr( 0, blockCommentsTokens[1].length ) == blockCommentsTokens[1] )\r\n {\r\n const [ commentLineNumber, tokenPos ] = this._buildingBlockComment;\r\n this._blockCommentCache.push( [ new LX.vec2( commentLineNumber, lineNumber ),\r\n new LX.vec2( tokenPos, tokenStartIndex ) ] );\r\n delete this._buildingBlockComment;\r\n }\r\n\r\n if ( token !== '{' )\r\n {\r\n continue;\r\n }\r\n\r\n // Store current scopes\r\n\r\n let contextTokens = [\r\n ...this._getTokensFromLine( this.code.lines[lineNumber].substring( 0, tokenStartIndex ) )\r\n ];\r\n\r\n // Add token context from above lines in case we don't have information\r\n // in the same line to get the scope data\r\n if ( !prev )\r\n {\r\n for ( let k = 1; k < 50; k++ )\r\n {\r\n let kLineString = this.code.lines[lineNumber - k];\r\n if ( !kLineString )\r\n {\r\n break;\r\n }\r\n\r\n const openIdx = kLineString.lastIndexOf( '{' );\r\n const closeIdx = kLineString.lastIndexOf( '}' );\r\n if ( openIdx > -1 )\r\n {\r\n kLineString = kLineString.substr( openIdx );\r\n }\r\n else if ( closeIdx > -1 )\r\n {\r\n kLineString = kLineString.substr( closeIdx );\r\n }\r\n\r\n contextTokens = [ ...this._getTokensFromLine( kLineString ), ...contextTokens ];\r\n\r\n if ( kLineString.length !== this.code.lines[lineNumber - k] )\r\n {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n contextTokens = contextTokens.reverse().filter( ( v ) => v.length && v != ' ' );\r\n\r\n // Keywords that can open a *named* scope\r\n // TODO: Do this per language\r\n const scopeKeywords = [ 'class', 'enum', 'function', 'interface', 'type', 'struct', 'namespace' ];\r\n\r\n let scopeType = null; // This is the type of scope (function, class, enum, etc)\r\n let scopeName = null;\r\n\r\n for ( let i = 0; i < contextTokens.length; i++ )\r\n {\r\n const t = contextTokens[i];\r\n\r\n if ( scopeKeywords.includes( t ) )\r\n {\r\n scopeType = t;\r\n scopeName = contextTokens[i - 1]; // usually right before the keyword in reversed array\r\n break;\r\n }\r\n }\r\n\r\n // Special case: enum type specification `enum Foo : int {`\r\n if ( scopeType === 'enum' && contextTokens.includes( ':' ) )\r\n {\r\n const colonIndex = contextTokens.indexOf( ':' );\r\n scopeName = contextTokens[colonIndex + 1] || scopeName;\r\n }\r\n\r\n if ( !scopeType )\r\n {\r\n const parOpenIndex = contextTokens.indexOf( '(' );\r\n scopeName = contextTokens[parOpenIndex + 1] || scopeName;\r\n\r\n if ( scopeName )\r\n {\r\n scopeType = 'method';\r\n }\r\n }\r\n\r\n // Only push if it's not already reflected in the cached scopes\r\n const lastScope = this._scopeStack.at( -1 );\r\n if ( lastScope?.lineNumber !== lineNumber )\r\n {\r\n this._scopeStack.push( { name: scopeName ?? '', type: scopeType ?? 'anonymous', lineNumber } );\r\n }\r\n\r\n pushedScope = true;\r\n }\r\n\r\n // Update scopes cache\r\n this.code.lineScopes[lineNumber] = [ ...this._scopeStack ];\r\n\r\n const symbols = this._parseLineForSymbols( lineNumber, lineString, tokensToEvaluate, pushedScope );\r\n\r\n return this._updateLine( force, lineNumber, lineInnerHtml, skipPropagation, symbols, tokensToEvaluate );\r\n }\r\n\r\n _getLineSignatureFromTokens( tokens: string[] )\r\n {\r\n const structuralChars = new Set( [ '{', '}' ] );\r\n const sign = tokens.filter( ( t ) => structuralChars.has( t ) );\r\n return sign.join( '_' );\r\n }\r\n\r\n _updateBlockComments( section: any, lineNumber: number, tokens: string[] )\r\n {\r\n const lang = CodeEditor.languages[this.highlight];\r\n const blockCommentsTokens = lang.blockCommentsTokens ?? this.defaultBlockCommentTokens;\r\n const lineOpensBlock = section[0].x === lineNumber;\r\n const lineClosesBlock = section[0].y === lineNumber;\r\n const lineInsideBlock = ( section[0].x !== lineNumber ) && ( section[0].y !== lineNumber );\r\n\r\n delete this._buildingBlockComment;\r\n\r\n /*\r\n Check if delimiters have been removed and process lines backwards/forward\r\n until reaching new delimiters\r\n */\r\n\r\n if ( lineOpensBlock )\r\n {\r\n const r = tokens.filter( ( t ) => t.substr( 0, blockCommentsTokens[0].length ) == blockCommentsTokens[0] );\r\n if ( !r.length )\r\n {\r\n this._buildingBlockComment = [ lineNumber - 1, 0 ];\r\n\r\n this.mustProcessPreviousLine = ( tokens ) => {\r\n const idx = tokens.indexOf( blockCommentsTokens[0] );\r\n return ( idx === -1 );\r\n };\r\n\r\n this.processLine( lineNumber - 1, false, true );\r\n\r\n section[0].x = this._lastProcessedLine;\r\n\r\n const lastProcessedString = this.code.lines[this._lastProcessedLine];\r\n const idx = lastProcessedString.indexOf( blockCommentsTokens[0] );\r\n section[1].x = idx > 0 ? idx : 0;\r\n }\r\n else\r\n {\r\n const tokenIndex = tokens.indexOf( blockCommentsTokens[0] );\r\n const tokenStartIndex = this._currentTokenPositions[tokenIndex];\r\n section[1].x = tokenStartIndex;\r\n // Process current line to update new sections\r\n this.processLine( lineNumber, false, true );\r\n }\r\n }\r\n else if ( lineClosesBlock )\r\n {\r\n const r = tokens.filter( ( t ) => t.substr( 0, blockCommentsTokens[1].length ) == blockCommentsTokens[1] );\r\n if ( !r.length )\r\n {\r\n this._buildingBlockComment = [ section[0].x, section[1].x ];\r\n\r\n this.mustProcessNextLine = ( tokens ) => {\r\n const idx = tokens.indexOf( blockCommentsTokens[1] );\r\n return ( idx === -1 );\r\n };\r\n\r\n this.processLine( lineNumber + 1, false, true );\r\n\r\n section[0].y = this._lastProcessedLine;\r\n\r\n const lastProcessedString = this.code.lines[this._lastProcessedLine];\r\n const idx = lastProcessedString.indexOf( blockCommentsTokens[1] );\r\n section[1].y = idx > 0 ? idx : ( lastProcessedString.length - 1 );\r\n }\r\n else\r\n {\r\n const tokenIndex = tokens.indexOf( blockCommentsTokens[1] );\r\n const tokenStartIndex = this._currentTokenPositions[tokenIndex];\r\n section[1].y = tokenStartIndex;\r\n // Process current line to update new sections\r\n this.processLine( lineNumber, false, true );\r\n }\r\n }\r\n else if ( lineInsideBlock )\r\n {\r\n // Here it can't modify delimiters..\r\n }\r\n }\r\n\r\n _processExtraLineIfNecessary( lineNumber: number, tokens: string[], oldSymbols: any[],\r\n skipPropagation: boolean = false )\r\n {\r\n if ( !this._scopeStack )\r\n {\r\n console.warn( 'CodeEditor: No scope available' );\r\n return;\r\n }\r\n\r\n // Update block comments if necessary\r\n {\r\n const commentBlockSection = this._inBlockCommentSection( lineNumber, 1e10, -1e10 );\r\n if ( tokens && commentBlockSection !== undefined )\r\n {\r\n this._updateBlockComments( commentBlockSection, lineNumber, tokens );\r\n\r\n // Get again correct scope\r\n this._scopeStack = [ ...this.code.lineScopes[lineNumber] ];\r\n }\r\n }\r\n\r\n if ( ( ( lineNumber + 1 ) === this.code.lines.length ) || !this.code.lineScopes[lineNumber + 1] )\r\n {\r\n return;\r\n }\r\n\r\n const newSignature = this._getLineSignatureFromTokens( tokens );\r\n const cachedSignature = this.code.lineSignatures[lineNumber];\r\n const mustUpdateScopes = cachedSignature !== newSignature;\r\n const sameScopes = codeScopesEqual( this._scopeStack, this.code.lineScopes[lineNumber + 1] );\r\n\r\n // Only update scope stack if something changed when editing a single line\r\n // Compare line signature for structural changes\r\n if ( ( mustUpdateScopes || this._scopesUpdated ) && ( !sameScopes && !skipPropagation ) )\r\n {\r\n if ( mustUpdateScopes )\r\n {\r\n this._scopesUpdated = true;\r\n }\r\n\r\n this.code.lineScopes[lineNumber + 1] = [ ...this._scopeStack ];\r\n this.processLine( lineNumber + 1 );\r\n\r\n delete this._scopesUpdated;\r\n }\r\n else if ( sameScopes )\r\n {\r\n // In case of same scope, check for occurrencies of the old symbols, to reprocess that lines\r\n for ( const sym of oldSymbols )\r\n {\r\n const tableSymbol = this.code.symbolsTable.get( sym.name );\r\n if ( tableSymbol === undefined )\r\n {\r\n return;\r\n }\r\n\r\n for ( const occ of tableSymbol )\r\n {\r\n if ( occ.line === lineNumber )\r\n {\r\n continue;\r\n }\r\n\r\n this.processLine( occ.line, false, true );\r\n }\r\n }\r\n }\r\n }\r\n\r\n _updateLine( force: boolean = false, lineNumber: number, html: string, skipPropagation: boolean = false,\r\n symbols: any[] = [], tokens: any[] = [] )\r\n {\r\n const gutterLineHtml = `<span class='line-gutter'>${lineNumber + 1}</span>`;\r\n const oldSymbols = this._updateLineSymbols( lineNumber, symbols );\r\n const lineScope = CodeEditor.debugScopes && this.code.lineScopes[lineNumber]\r\n ? this.code.lineScopes[lineNumber].map( ( s: any ) => `${s.type}` ).join( ', ' )\r\n : '';\r\n const lineSymbols = CodeEditor.debugSymbols && this.code.lineSymbols[lineNumber]\r\n ? this.code.lineSymbols[lineNumber].map( ( s: any ) => `${s.name}(${s.kind})` ).join( ', ' )\r\n : '';\r\n const debugString = lineScope + ( lineScope.length ? ' - ' : '' ) + lineSymbols;\r\n\r\n if ( !force )\r\n { // Single line update\r\n this.code.childNodes[this.toLocalLine( lineNumber )].innerHTML = gutterLineHtml + html + debugString;\r\n\r\n if ( !skipPropagation )\r\n {\r\n this._processExtraLineIfNecessary( lineNumber, tokens, oldSymbols, skipPropagation );\r\n }\r\n\r\n if ( this.mustProcessNextLine )\r\n {\r\n if ( this.mustProcessNextLine( tokens ) && ( ( lineNumber + 1 ) < this.code.lines.length ) )\r\n {\r\n this.processLine( lineNumber + 1, false, true );\r\n }\r\n else\r\n {\r\n delete this.mustProcessNextLine;\r\n }\r\n }\r\n\r\n if ( this.mustProcessPreviousLine )\r\n {\r\n if ( this.mustProcessPreviousLine( tokens ) && ( ( lineNumber - 1 ) >= 0 ) )\r\n {\r\n this.processLine( lineNumber - 1, false, true );\r\n }\r\n else\r\n {\r\n delete this.mustProcessPreviousLine;\r\n }\r\n }\r\n\r\n if ( CodeEditor.debugProcessedLines )\r\n {\r\n this.code.childNodes[lineNumber]?.classList.add( 'debug' );\r\n }\r\n\r\n this._setActiveLine( lineNumber );\r\n this._clearTmpVariables();\r\n }\r\n\r\n this.code.lineSignatures[lineNumber] = this._getLineSignatureFromTokens( tokens );\r\n\r\n // Update all lines at once\r\n return force ? `<pre>${( gutterLineHtml + html + debugString )}</pre>` : undefined;\r\n }\r\n\r\n /**\r\n * Parses a single line of code and extract declared symbols\r\n */\r\n _parseLineForSymbols( lineNumber: number, lineString: string, tokens: string[], pushedScope: boolean = false )\r\n {\r\n const scope = this._scopeStack.at( pushedScope ? -2 : -1 );\r\n\r\n if ( !scope || this._inBlockCommentSection( lineNumber ) )\r\n {\r\n return [];\r\n }\r\n\r\n const scopeName = scope.name;\r\n const scopeType = scope.type;\r\n const symbols: any[] = [];\r\n const symbolsMap = new Map();\r\n const text = lineString.trim();\r\n const previousLineScope = this.code.lineScopes[lineNumber - 1];\r\n\r\n const _pushSymbol = ( s: any ) => {\r\n const signature = `${s.name}_${s.kind}_${s.scope}_${s.line}`;\r\n if ( symbolsMap.has( signature ) )\r\n {\r\n return;\r\n }\r\n symbolsMap.set( signature, s );\r\n symbols.push( s );\r\n };\r\n\r\n // Don't make symbols from preprocessor lines\r\n if ( text.startsWith( '#' ) )\r\n {\r\n return [];\r\n }\r\n\r\n const nativeTypes = CodeEditor.nativeTypes[this.highlight];\r\n\r\n const topLevelRegexes: any = [\r\n [ /^class\\s+([A-Za-z0-9_]+)/, 'class' ],\r\n [ /^struct\\s+([A-Za-z0-9_]+)/, 'struct' ],\r\n [ /^enum\\s+([A-Za-z0-9_]+)/, 'enum' ],\r\n [ /^interface\\s+([A-Za-z0-9_]+)/, 'interface' ],\r\n [ /^type\\s+([A-Za-z0-9_]+)/, 'type' ],\r\n [ /^function\\s+([A-Za-z0-9_]+)/, 'method' ],\r\n [ /^fn\\s+([A-Za-z0-9_]+)/, 'method' ],\r\n [ /^def\\s+([A-Za-z0-9_]+)/, 'method' ],\r\n [ /^([A-Za-z0-9_]+)\\s*=\\s*\\(?.*\\)?\\s*=>/, 'method' ] // arrow functions\r\n ];\r\n\r\n // Add regexes to detect methods, variables ( including \"id : nativeType\" )\r\n {\r\n if ( nativeTypes )\r\n {\r\n topLevelRegexes.push( [ new RegExp( `^(?:${nativeTypes.join( '|' )})\\\\s+([A-Za-z0-9_]+)\\s*[\\(]+` ),\r\n 'method' ] );\r\n\r\n if ( this.highlight === 'WGSL' )\r\n {\r\n topLevelRegexes.push( [ new RegExp( `[A-Za-z0-9]+(\\\\s*)+:(\\\\s*)+(${nativeTypes.join( '|' )})` ),\r\n 'variable', ( m: string[] ) => m[0].split( ':' )[0].trim() ] );\r\n }\r\n }\r\n\r\n const declarationKeywords = CodeEditor.declarationKeywords[this.highlight] ?? [ 'const', 'let', 'var' ];\r\n topLevelRegexes.push( [ new RegExp( `^(?:${declarationKeywords.join( '|' )})\\\\s+([A-Za-z0-9_]+)` ),\r\n 'variable' ] );\r\n }\r\n\r\n for ( let [ regex, kind, fn ] of topLevelRegexes )\r\n {\r\n const m = text.match( regex );\r\n if ( m )\r\n {\r\n _pushSymbol( { name: fn ? fn( m ) : m[1], kind, scope: scopeName, line: lineNumber } );\r\n }\r\n }\r\n\r\n const usageRegexes: any = [\r\n [ /new\\s+([A-Za-z0-9_]+)\\s*\\(/, 'constructor-call' ],\r\n [ /this.([A-Za-z_][A-Za-z0-9_]*)\\s*\\=/, 'class-property' ]\r\n ];\r\n\r\n for ( let [ regex, kind, fn ] of usageRegexes )\r\n {\r\n const m = text.match( regex );\r\n if ( m )\r\n {\r\n _pushSymbol( { name: fn ? fn( m ) : m[1], kind, scope: scopeName, line: lineNumber } );\r\n }\r\n }\r\n\r\n // Detect method calls\r\n const regex = /([A-Za-z0-9_]+)\\s*\\(/g;\r\n let match;\r\n while ( match = regex.exec( text ) )\r\n {\r\n const name = match[1];\r\n const before = text.slice( 0, match.index );\r\n if ( /(new|function|fn|def)\\s+$/.test( before ) ) continue; // skip constructor calls\r\n if ( [ 'constructor', 'location', ...( nativeTypes ?? [] ) ].indexOf( name ) > -1 ) continue; // skip hardcoded non method symbol\r\n if ( previousLineScope && previousLineScope.at( -1 )?.type === 'class' ) continue; // skip class methods\r\n _pushSymbol( { name, kind: 'method-call', scope: scopeName, line: lineNumber } );\r\n }\r\n\r\n // Stop after matches for top-level declarations and usage symbols\r\n if ( symbols.length )\r\n {\r\n return symbols;\r\n }\r\n\r\n const nonWhiteSpaceTokens = tokens.filter( ( t ) => t.trim().length );\r\n\r\n for ( let i = 0; i < nonWhiteSpaceTokens.length; i++ )\r\n {\r\n const prev = nonWhiteSpaceTokens[i - 1];\r\n const token = nonWhiteSpaceTokens[i];\r\n const next = nonWhiteSpaceTokens[i + 1];\r\n\r\n if ( scopeType.startsWith( 'class' ) )\r\n {\r\n if ( next === '(' && /^[a-zA-Z_]\\w*$/.test( token ) && prev === undefined )\r\n {\r\n if ( token === 'constructor' ) continue; // skip constructor symbol\r\n _pushSymbol( { name: token, kind: 'method', scope: scopeName, line: lineNumber } );\r\n }\r\n }\r\n else if ( scopeType.startsWith( 'enum' ) )\r\n {\r\n if ( !isSymbol( token ) && !this._isNumber( token )\r\n && !this._mustHightlightWord( token, CodeEditor.statements ) )\r\n {\r\n _pushSymbol( { name: token, kind: 'enum_value', scope: scopeName, line: lineNumber } );\r\n }\r\n }\r\n }\r\n\r\n return symbols;\r\n }\r\n\r\n /**\r\n * Updates the symbol table for a single line\r\n * - Removes old symbols from that line\r\n * - Inserts the new symbols\r\n */\r\n _updateLineSymbols( lineNumber: number, newSymbols: any[] )\r\n {\r\n this.code.lineSymbols[lineNumber] = this.code.lineSymbols[lineNumber] ?? [];\r\n const oldSymbols = LX.deepCopy( this.code.lineSymbols[lineNumber] );\r\n\r\n // Clean old symbols from current line\r\n for ( let sym of this.code.lineSymbols[lineNumber] )\r\n {\r\n let array = this.code.symbolsTable.get( sym.name );\r\n if ( !array )\r\n {\r\n continue;\r\n }\r\n\r\n array = array.filter( ( s: any ) => s.line !== lineNumber );\r\n\r\n if ( array.length )\r\n {\r\n this.code.symbolsTable.set( sym.name, array );\r\n }\r\n else\r\n {\r\n this.code.symbolsTable.delete( sym.name );\r\n }\r\n }\r\n\r\n // Add new symbols to table\r\n for ( let sym of newSymbols )\r\n {\r\n let arr = this.code.symbolsTable.get( sym.name ) ?? [];\r\n arr.push( sym );\r\n this.code.symbolsTable.set( sym.name, arr );\r\n }\r\n\r\n // Keep lineSymbols in sync\r\n this.code.lineSymbols[lineNumber] = newSymbols;\r\n\r\n return oldSymbols;\r\n }\r\n\r\n _lineHasComment( lineString: string )\r\n {\r\n const lang = CodeEditor.languages[this.highlight];\r\n\r\n if ( !( lang.singleLineComments ?? true ) )\r\n {\r\n return;\r\n }\r\n\r\n const singleLineCommentToken = lang.singleLineCommentToken ?? this.defaultSingleLineCommentToken;\r\n const idx = lineString.indexOf( singleLineCommentToken );\r\n\r\n if ( idx > -1 )\r\n {\r\n const stringKeys = Object.values( this.stringKeys );\r\n // Count times we started a string BEFORE the comment\r\n var err = false;\r\n err = err || ( stringKeys.some( function( v )\r\n {\r\n var re = new RegExp( v, 'g' );\r\n var matches = lineString.substring( 0, idx ).match( re ) || [];\r\n return ( matches.length % 2 ) !== 0;\r\n } ) );\r\n return err ? undefined : idx;\r\n }\r\n }\r\n\r\n _getTokensFromLine( lineString: string, skipNonWords: boolean = false )\r\n {\r\n if ( !lineString || !lineString.length )\r\n {\r\n return [];\r\n }\r\n\r\n // Check if line comment\r\n const ogLine = lineString;\r\n const hasCommentIdx = this._lineHasComment( lineString );\r\n\r\n if ( hasCommentIdx != undefined )\r\n {\r\n lineString = ogLine.substring( 0, hasCommentIdx );\r\n }\r\n\r\n let tokensToEvaluate: string[] = []; // store in a temp array so we know prev and next tokens...\r\n let charCounterList: number[] = [];\r\n let charCounter = 0;\r\n\r\n const pushToken = function( t: string )\r\n {\r\n if ( ( skipNonWords && ( t.includes( '\"' ) || t.length < 3 ) ) )\r\n {\r\n return;\r\n }\r\n tokensToEvaluate.push( t );\r\n charCounterList.push( charCounter );\r\n // Update positions\r\n charCounter += t.length;\r\n };\r\n\r\n let iter = lineString.matchAll( /(<!--|-->|\\*\\/|\\/\\*|::|[\\[\\](){}<>.,;:*\"'`%@$!/= ])/g );\r\n let subtokens = iter.next();\r\n if ( subtokens.value )\r\n {\r\n let idx = 0;\r\n while ( subtokens.value != undefined )\r\n {\r\n const _pt = lineString.substring( idx, subtokens.value.index );\r\n if ( _pt.length ) pushToken( _pt );\r\n pushToken( subtokens.value[0] );\r\n idx = subtokens.value.index + subtokens.value[0].length;\r\n subtokens = iter.next();\r\n if ( !subtokens.value )\r\n {\r\n const _at = lineString.substring( idx );\r\n if ( _at.length ) pushToken( _at );\r\n }\r\n }\r\n }\r\n else pushToken( lineString );\r\n\r\n if ( hasCommentIdx != undefined )\r\n {\r\n pushToken( ogLine.substring( hasCommentIdx ) );\r\n }\r\n\r\n this._currentTokenPositions = charCounterList;\r\n\r\n return this._processTokens( tokensToEvaluate );\r\n }\r\n\r\n _processTokens( tokens: string[], offset: number = 0 ): string[]\r\n {\r\n if ( this.highlight == 'C++' || this.highlight == 'CSS' )\r\n {\r\n var idx = tokens.slice( offset ).findIndex( ( value, index ) => this._isNumber( value ) );\r\n if ( idx > -1 )\r\n {\r\n idx += offset; // Add offset to compute within the whole array of tokens\r\n let data = tokens[idx] + tokens[++idx];\r\n while ( this._isNumber( data ) )\r\n {\r\n tokens[idx - 1] += tokens[idx];\r\n tokens.splice( idx, 1 );\r\n data += tokens[idx];\r\n }\r\n // Scan for numbers again\r\n return this._processTokens( tokens, idx );\r\n }\r\n\r\n const importantIdx = tokens.indexOf( 'important' );\r\n if ( this.highlight == 'CSS' && importantIdx > -1 && tokens[importantIdx - 1] === '!' )\r\n {\r\n tokens[importantIdx - 1] = '!important';\r\n tokens.splice( importantIdx, 1 );\r\n }\r\n }\r\n else if ( this.highlight == 'PHP' )\r\n {\r\n let offset = 0;\r\n let dollarIdx = tokens.indexOf( '$' );\r\n\r\n while ( dollarIdx > -1 )\r\n {\r\n const offsetIdx = dollarIdx + offset;\r\n\r\n if ( tokens[offsetIdx + 1] === 'this-' )\r\n {\r\n tokens[offsetIdx] = '$this';\r\n tokens[offsetIdx + 1] = '-';\r\n }\r\n else\r\n {\r\n tokens[offsetIdx] += tokens[offsetIdx + 1] ?? '';\r\n tokens.splice( offsetIdx + 1, 1 );\r\n }\r\n\r\n dollarIdx = tokens.slice( offsetIdx ).indexOf( '$' );\r\n offset = offsetIdx;\r\n }\r\n }\r\n else if ( this.highlight == 'WGSL' )\r\n {\r\n let offset = 0;\r\n let atIdx = tokens.indexOf( '@' );\r\n\r\n while ( atIdx > -1 )\r\n {\r\n const offsetIdx = atIdx + offset;\r\n\r\n tokens[offsetIdx] += tokens[offsetIdx + 1] ?? '';\r\n tokens.splice( offsetIdx + 1, 1 );\r\n\r\n atIdx = tokens.slice( offsetIdx ).indexOf( '$' );\r\n offset = offsetIdx;\r\n }\r\n }\r\n\r\n return tokens;\r\n }\r\n\r\n _mustHightlightWord( token: string, wordCategory: any, lang?: any ): boolean\r\n {\r\n if ( !lang )\r\n {\r\n lang = CodeEditor.languages[this.highlight];\r\n }\r\n\r\n let t = token;\r\n\r\n if ( lang.ignoreCase )\r\n {\r\n t = t.toLowerCase();\r\n }\r\n\r\n return wordCategory[this.highlight] && wordCategory[this.highlight].has( t );\r\n }\r\n\r\n _getTokenHighlighting( ctx: any, highlight: string )\r\n {\r\n const rules = [ ...HighlightRules.common, ...( HighlightRules[highlight] || [] ),\r\n ...HighlightRules.post_common ];\r\n\r\n for ( const rule of rules )\r\n {\r\n if ( !rule.test( ctx, this ) )\r\n {\r\n continue;\r\n }\r\n\r\n const r = rule.action ? rule.action( ctx, this ) : undefined;\r\n if ( rule.discard ) ctx.discardToken = r;\r\n return rule.className;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n _evaluateToken( ctxData: any )\r\n {\r\n let { token, prev, next, tokenIndex, isFirstToken, isLastToken } = ctxData;\r\n\r\n const lang = CodeEditor.languages[this.highlight];\r\n const highlight = this.highlight.replace( /\\s/g, '' ).replaceAll( '+', 'p' ).toLowerCase();\r\n const customStringKeys = Object.assign( {}, this.stringKeys );\r\n const lineNumber = this._currentLineNumber;\r\n const tokenStartIndex = this._currentTokenPositions[tokenIndex];\r\n const inBlockComment =\r\n ( this._buildingBlockComment ?? this._inBlockCommentSection( lineNumber!, tokenStartIndex, token.length ) )\r\n !== undefined;\r\n\r\n var usePreviousTokenToCheckString = false;\r\n\r\n if ( [ 'cpp', 'c' ].indexOf( highlight ) > -1 && prev && prev.includes( '#' ) )\r\n { // preprocessor code..\r\n customStringKeys['@<'] = '>';\r\n }\r\n else if ( highlight == 'markdown' && ( ctxData.prevWithSpaces == '[' || ctxData.nextWithSpaces == ']' ) )\r\n {\r\n // console.warn(prev, token, next)\r\n usePreviousTokenToCheckString = true;\r\n customStringKeys['@['] = ']';\r\n }\r\n else if ( highlight == 'javascript' || highlight == 'typescript' )\r\n {\r\n customStringKeys['@`'] = '`';\r\n }\r\n\r\n // Manage strings\r\n this._stringEnded = false;\r\n\r\n if ( usePreviousTokenToCheckString\r\n || ( !inBlockComment\r\n && ( lang.tags ?? false ? ( this._enclosedByTokens( token, tokenIndex, '<', '>' ) ) : true ) ) )\r\n {\r\n const _checkIfStringEnded = ( t: string ) => {\r\n if ( this._stringInterpolation )\r\n {\r\n if ( token == '$' && next == '{' )\r\n {\r\n delete this._stringInterpolation;\r\n this._stringInterpolationOpened = true;\r\n this._stringEnded = true;\r\n return;\r\n }\r\n }\r\n\r\n const idx = Object.values( customStringKeys ).indexOf( t );\r\n this._stringEnded = ( idx > -1 )\r\n && ( idx\r\n == Object.values( customStringKeys ).indexOf( customStringKeys['@' + this._buildingString] ) );\r\n };\r\n\r\n if ( this._buildingString != undefined )\r\n {\r\n _checkIfStringEnded( usePreviousTokenToCheckString ? ctxData.nextWithSpaces : token );\r\n }\r\n else if ( customStringKeys['@' + ( usePreviousTokenToCheckString ? ctxData.prevWithSpaces : token )] )\r\n {\r\n // Start new string\r\n this._buildingString = usePreviousTokenToCheckString ? ctxData.prevWithSpaces : token;\r\n\r\n if ( ( highlight == 'javascript' || highlight == 'typescript' ) && token == '`' )\r\n {\r\n this._stringInterpolation = true;\r\n }\r\n\r\n // Check if string ended in same token using next...\r\n if ( usePreviousTokenToCheckString )\r\n {\r\n _checkIfStringEnded( ctxData.nextWithSpaces );\r\n }\r\n }\r\n else if ( this._stringInterpolationOpened && prev == '}' )\r\n {\r\n delete this._stringInterpolationOpened;\r\n this._stringInterpolation = true;\r\n this._buildingString = '`';\r\n }\r\n }\r\n\r\n // Update context data for next tests\r\n ctxData.discardToken = false;\r\n ctxData.inBlockComment = inBlockComment;\r\n ctxData.markdownHeader = this._markdownHeader;\r\n ctxData.inString = this._buildingString !== undefined;\r\n ctxData.singleLineCommentToken = lang.singleLineCommentToken ?? this.defaultSingleLineCommentToken;\r\n ctxData.lang = lang;\r\n ctxData.scope = this._scopeStack.at( -1 );\r\n\r\n // Add utils functions for the rules\r\n ctxData.isVariableSymbol = ( token: string ) =>\r\n this.code.symbolsTable.has( token ) && this.code.symbolsTable.get( token )[0].kind === 'variable';\r\n ctxData.isEnumValueSymbol = ( token: string ) =>\r\n this.code.symbolsTable.has( token ) && this.code.symbolsTable.get( token )[0].kind === 'enum_value';\r\n ctxData.isClassSymbol = ( token: string ) =>\r\n this.code.symbolsTable.has( token ) && this.code.symbolsTable.get( token )[0].kind === 'class';\r\n ctxData.isStructSymbol = ( token: string ) =>\r\n this.code.symbolsTable.has( token ) && this.code.symbolsTable.get( token )[0].kind === 'struct';\r\n ctxData.isEnumSymbol = ( token: string ) =>\r\n this.code.symbolsTable.has( token ) && this.code.symbolsTable.get( token )[0].kind === 'enum';\r\n\r\n // Get highlighting class based on language common and specific rules\r\n let tokenClass = this._getTokenHighlighting( ctxData, highlight );\r\n\r\n if ( this._stringInterpolationOpened && this._pendingString )\r\n {\r\n this._pendingString = this._pendingString.substring( 0, this._pendingString.indexOf( '$' ) );\r\n\r\n if ( ctxData.tokens[tokenIndex + 1] == '{' )\r\n {\r\n ctxData.tokens[tokenIndex + 1] = '${';\r\n }\r\n }\r\n\r\n // We finished constructing a string\r\n if ( this._buildingString && ( this._stringEnded || isLastToken ) && !inBlockComment )\r\n {\r\n token = this._getCurrentString();\r\n tokenClass = 'cm-str';\r\n ctxData.discardToken = false;\r\n }\r\n\r\n // Update state\r\n this._buildingString = this._stringEnded ? undefined : this._buildingString;\r\n\r\n if ( ctxData.discardToken )\r\n {\r\n return '';\r\n }\r\n\r\n // Replace html chars\r\n token = token.replace( '<', '<' ).replace( '>', '>' );\r\n\r\n // No highlighting, no need to put it inside another span..\r\n if ( !tokenClass )\r\n {\r\n return token;\r\n }\r\n\r\n return `<span class=\"${highlight} ${tokenClass}\">${token}</span>`;\r\n }\r\n\r\n _appendStringToken( token: string ): boolean\r\n {\r\n if ( !this._pendingString )\r\n {\r\n this._pendingString = '';\r\n }\r\n\r\n this._pendingString += token;\r\n\r\n return true;\r\n }\r\n\r\n _getCurrentString()\r\n {\r\n const chars = this._pendingString;\r\n delete this._pendingString;\r\n return chars;\r\n }\r\n\r\n _enclosedByTokens( token: string, tokenIndex: number, tagStart: string, tagEnd: string ): number[] | undefined\r\n {\r\n const tokenStartIndex = this._currentTokenPositions[tokenIndex];\r\n const tagStartIndex = indexOfFrom( this._currentLineString!, tagStart, tokenStartIndex, true );\r\n if ( tagStartIndex < 0 )\r\n { // Not found..\r\n return;\r\n }\r\n const tagStartIndexOpposite = indexOfFrom( this._currentLineString!, tagEnd, tokenStartIndex, true );\r\n if ( tagStartIndexOpposite >= 0 && tagStartIndexOpposite > tagStartIndex )\r\n { // Found the opposite first while reversing..\r\n return;\r\n }\r\n const tagEndIndex = indexOfFrom( this._currentLineString!, tagEnd, tokenStartIndex );\r\n if ( tagEndIndex < 0 )\r\n { // Not found..\r\n return;\r\n }\r\n\r\n if ( ( tagStartIndex < tokenStartIndex ) && ( tagEndIndex >= ( tokenStartIndex + token.length ) )\r\n && !this._mustHightlightWord( token, CodeEditor.symbols ) )\r\n {\r\n return [ tagStartIndex, tagEndIndex ];\r\n }\r\n }\r\n\r\n _inBlockCommentSection( lineNumber: number, tokenPosition: number = -1, tokenLength: number = -1 )\r\n {\r\n const lang = CodeEditor.languages[this.highlight];\r\n const blockCommentsTokens = lang.blockCommentsTokens ?? this.defaultBlockCommentTokens;\r\n\r\n for ( let section of this._blockCommentCache )\r\n {\r\n const lineRange = section[0];\r\n const posRange = section[1];\r\n\r\n // Outside the lines range\r\n const meetsLineRange = lineNumber >= lineRange.x && lineNumber <= lineRange.y;\r\n if ( !meetsLineRange )\r\n {\r\n continue;\r\n }\r\n\r\n if ( ( lineNumber != lineRange.x && lineNumber != lineRange.y ) // Inside the block, not first nor last line\r\n || ( lineNumber == lineRange.x && tokenPosition >= posRange.x\r\n && ( ( lineNumber == lineRange.y\r\n && ( tokenPosition + tokenLength ) <= ( posRange.y + blockCommentsTokens[1].length ) )\r\n || lineNumber !== lineRange.y ) )\r\n || ( lineNumber == lineRange.y\r\n && ( ( tokenPosition + tokenLength ) <= ( posRange.y + blockCommentsTokens[1].length ) ) )\r\n && ( ( lineNumber == lineRange.x && tokenPosition >= posRange.x ) || lineNumber !== lineRange.x ) )\r\n {\r\n return section;\r\n }\r\n }\r\n }\r\n\r\n _isKeyword( ctxData: any ): boolean\r\n {\r\n const { token, tokenIndex, tokens, lang } = ctxData;\r\n\r\n let isKwd = this._mustHightlightWord( token, CodeEditor.keywords ) || this.highlight == 'XML';\r\n\r\n if ( this.highlight == 'CMake' )\r\n {\r\n // Highlight $ symbol\r\n if ( token == '$' && this._enclosedByTokens( tokens[tokenIndex + 2], tokenIndex + 2, '{', '}' ) )\r\n {\r\n isKwd = true;\r\n }\r\n // Highlight what is between the { }\r\n else if ( this._enclosedByTokens( token, tokenIndex, '{', '}' ) )\r\n {\r\n isKwd = isKwd || ( ctxData.tokens[tokenIndex - 2] == '$' );\r\n }\r\n }\r\n if ( this.highlight == 'Markdown' )\r\n {\r\n isKwd = this._markdownHeader !== undefined;\r\n }\r\n else if ( lang.tags )\r\n {\r\n isKwd = isKwd && ( this._enclosedByTokens( token, tokenIndex, '<', '>' ) != undefined );\r\n }\r\n\r\n return isKwd;\r\n }\r\n\r\n _isNumber( token: string ): boolean\r\n {\r\n const lang = CodeEditor.languages[this.highlight];\r\n if ( !( lang.numbers ?? true ) )\r\n {\r\n return false;\r\n }\r\n\r\n const subToken = token.substring( 0, token.length - 1 );\r\n\r\n if ( this.highlight == 'C++' )\r\n {\r\n if ( LX.lastChar( token ) == 'f' )\r\n {\r\n return this._isNumber( subToken );\r\n }\r\n else if ( LX.lastChar( token ) == 'u' )\r\n {\r\n return !( token.includes( '.' ) ) && this._isNumber( subToken );\r\n }\r\n }\r\n else if ( this.highlight == 'WGSL' )\r\n {\r\n if ( LX.lastChar( token ) == 'u' )\r\n {\r\n return !( token.includes( '.' ) ) && this._isNumber( subToken );\r\n }\r\n }\r\n else if ( this.highlight == 'CSS' )\r\n {\r\n if ( LX.lastChar( token ) == '%' )\r\n {\r\n return this._isNumber( subToken );\r\n }\r\n }\r\n\r\n return ( token.length > 0 ) && token != ' ' && !Number.isNaN( +token );\r\n }\r\n\r\n _encloseSelectedWordWithKey( key: string, lidx: number, cursor: Cursor ): boolean\r\n {\r\n if ( !cursor.selection || ( cursor.selection.fromY != cursor.selection.toY ) )\r\n {\r\n return false;\r\n }\r\n\r\n cursor.selection.invertIfNecessary();\r\n\r\n // Insert first..\r\n this.code.lines[lidx] = [\r\n this.code.lines[lidx].slice( 0, cursor.selection.fromX ),\r\n key,\r\n this.code.lines[lidx].slice( cursor.selection.fromX )\r\n ].join( '' );\r\n\r\n // Go to the end of the word\r\n this.cursorToPosition( cursor, cursor.selection.toX + 1 );\r\n\r\n // Change next key?\r\n switch ( key )\r\n {\r\n case \"'\":\r\n case '\"':\r\n break;\r\n case '(':\r\n key = ')';\r\n break;\r\n case '{':\r\n key = '}';\r\n break;\r\n }\r\n\r\n // Insert the other\r\n this.code.lines[lidx] = [\r\n this.code.lines[lidx].slice( 0, cursor.position ),\r\n key,\r\n this.code.lines[lidx].slice( cursor.position )\r\n ].join( '' );\r\n\r\n // Recompute and reposition current selection\r\n\r\n cursor.selection.fromX++;\r\n cursor.selection.toX++;\r\n\r\n this._processSelection( cursor );\r\n this.processLine( lidx );\r\n\r\n // Stop propagation\r\n return true;\r\n }\r\n\r\n _detectLanguage( text: string ): string | undefined\r\n {\r\n const tokenSet = new Set( this._getTokensFromLine( text, true ) );\r\n const scores: any = {};\r\n\r\n // Check strong indicators first\r\n const strongIndicators = {\r\n 'JavaScript': [ 'import ', 'export default', 'console.', '=>', 'document.', 'window.' ],\r\n 'TypeScript': [ 'import ', 'export default', 'console.', '=>', 'document.', 'window.' ],\r\n 'C++': [ '#include', '::', 'std::', 'template <', 'using namespace' ],\r\n 'Python': [ 'def ', 'import ', 'print(', 'self', 'None', 'True', 'False' ],\r\n 'HTML': [ '<html', '<div', '<body', '<script', '<style' ],\r\n 'CSS': [ '@media' ],\r\n 'Markdown': [ '#', '##', '###', '](', '![', '**' ]\r\n };\r\n\r\n for ( const [ lang, indicators ] of Object.entries( strongIndicators ) )\r\n {\r\n scores[lang] = scores[lang] ?? 0;\r\n for ( const key of indicators )\r\n {\r\n if ( text.includes( key ) ) scores[lang] += 20;\r\n }\r\n }\r\n\r\n // Check groups' words now with less importance score\r\n const groups = [\r\n CodeEditor.keywords,\r\n CodeEditor.statements,\r\n CodeEditor.utils,\r\n CodeEditor.types,\r\n CodeEditor.builtIn\r\n ];\r\n\r\n for ( const group of groups )\r\n {\r\n for ( let [ lang, wordList ] of Object.entries( group ) )\r\n {\r\n scores[lang] = scores[lang] ?? 0;\r\n for ( let kw of ( wordList as any ) )\r\n {\r\n if ( tokenSet.has( kw ) ) scores[lang]++;\r\n }\r\n }\r\n }\r\n\r\n const sorted = ( Object.entries( scores ) as any ).sort( ( a: any[], b: any[] ) => b[1] - a[1] );\r\n return sorted[0][1] > 0 ? sorted[0][0] : undefined;\r\n }\r\n\r\n lineUp( cursor: Cursor, resetLeft: boolean = false )\r\n {\r\n if ( this.code.lines[cursor.line - 1] == undefined )\r\n {\r\n return false;\r\n }\r\n\r\n cursor.line--;\r\n cursor.line = Math.max( 0, cursor.line );\r\n this.cursorToTop( cursor, resetLeft );\r\n\r\n return true;\r\n }\r\n\r\n lineDown( cursor: Cursor, resetLeft: boolean = false )\r\n {\r\n if ( this.code.lines[cursor.line + 1] == undefined )\r\n {\r\n return false;\r\n }\r\n\r\n cursor.line++;\r\n\r\n this.cursorToBottom( cursor, resetLeft );\r\n\r\n return true;\r\n }\r\n\r\n swapLines( lidx: number, offset: number, cursor: Cursor )\r\n {\r\n if ( this.code.lines[lidx + offset] == undefined )\r\n {\r\n return;\r\n }\r\n\r\n this._addUndoStep( cursor, true );\r\n\r\n swapArrayElements( this.code.lines, lidx + offset, lidx );\r\n\r\n // Process both lines\r\n this.processLine( lidx + offset );\r\n this.processLine( lidx );\r\n\r\n if ( offset > 0 )\r\n {\r\n this.lineDown( cursor );\r\n }\r\n else\r\n {\r\n this.lineUp( cursor );\r\n }\r\n\r\n this.hideAutoCompleteBox();\r\n }\r\n\r\n restartBlink()\r\n {\r\n if ( !this.code ) return;\r\n\r\n clearInterval( this.blinker );\r\n LX.addClass( this.cursorsDOM, 'show' );\r\n\r\n if ( this.cursorBlinkRate > 0 )\r\n {\r\n this.blinker = setInterval( () => {\r\n LX.toggleClass( this.cursorsDOM, 'show' );\r\n }, this.cursorBlinkRate );\r\n }\r\n else if ( this.cursorBlinkRate < 0 )\r\n {\r\n LX.removeClass( this.cursorsDOM, 'show' );\r\n }\r\n }\r\n\r\n startSelection( cursor: Cursor )\r\n {\r\n // Show elements\r\n let selectionContainer = document.createElement( 'div' );\r\n selectionContainer.className = 'selections';\r\n selectionContainer.classList.add( 'show' );\r\n\r\n LX.insertChildAtIndex( this.codeSizer, selectionContainer, 2 );\r\n this.selections[cursor.name] = selectionContainer;\r\n\r\n // Create new selection instance\r\n cursor.selection = new CodeSelection( this, cursor );\r\n }\r\n\r\n deleteSelection( cursor: Cursor )\r\n {\r\n // I think it's not necessary but...\r\n if ( this.disableEdition )\r\n {\r\n return;\r\n }\r\n\r\n // Some selections don't depend on mouse up..\r\n if ( cursor.selection ) cursor.selection.invertIfNecessary();\r\n\r\n const selection = cursor.selection!;\r\n const separator = '_NEWLINE_';\r\n let code = this.code.lines.join( separator );\r\n\r\n // Get linear start index\r\n let index = 0;\r\n for ( let i = 0; i <= selection.fromY; i++ )\r\n {\r\n index += i == selection.fromY ? selection.fromX : this.code.lines[i].length;\r\n }\r\n\r\n index += selection.fromY * separator.length;\r\n\r\n const num_chars = selection.chars + ( selection.toY - selection.fromY ) * separator.length;\r\n const pre = code.slice( 0, index );\r\n const post = code.slice( index + num_chars );\r\n\r\n this.code.lines = ( pre + post ).split( separator );\r\n\r\n this.cursorToLine( cursor, selection.fromY, true );\r\n this.cursorToPosition( cursor, selection.fromX );\r\n this.endSelection( cursor );\r\n this.processLines();\r\n }\r\n\r\n endSelection( cursor?: Cursor )\r\n {\r\n delete this._tripleClickSelection;\r\n delete this._lastSelectionKeyDir;\r\n delete this._currentOcurrences;\r\n delete this._lastResult;\r\n\r\n if ( cursor )\r\n {\r\n LX.deleteElement( this.selections[cursor.name] );\r\n delete this.selections[cursor.name];\r\n cursor.selection = null;\r\n cursor.line = cursor.line; // Update current line\r\n }\r\n else\r\n {\r\n for ( let cursor of this.cursors )\r\n {\r\n cursor.line = cursor.line; // Update current line\r\n LX.deleteElement( this.selections[cursor.name] );\r\n delete this.selections[cursor.name];\r\n cursor.selection = null;\r\n }\r\n }\r\n }\r\n\r\n selectAll()\r\n {\r\n this.endSelection();\r\n\r\n // Use main cursor\r\n this._removeSecondaryCursors();\r\n\r\n var cursor = this.getCurrentCursor();\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT_TOP, cursor, true );\r\n\r\n this.startSelection( cursor );\r\n\r\n const selection = cursor.selection!;\r\n const nlines = this.code.lines.length - 1;\r\n selection.toX = this.code.lines[nlines].length;\r\n selection.toY = nlines;\r\n\r\n this.cursorToPosition( cursor, selection.toX );\r\n this.cursorToLine( cursor, selection.toY );\r\n\r\n this._processSelection( cursor, null, true );\r\n\r\n this.hideAutoCompleteBox();\r\n }\r\n\r\n cursorToRight( text: string, cursor: Cursor )\r\n {\r\n if ( !text || !text.length ) return;\r\n\r\n const chars = text.length;\r\n const offset = chars * this.charWidth;\r\n\r\n cursor.left += offset;\r\n cursor.root.style.left = `calc( ${cursor.left}px + ${this.xPadding} )`;\r\n cursor.position += chars;\r\n\r\n this.restartBlink();\r\n\r\n this.updateScrollLeft( cursor );\r\n }\r\n\r\n cursorToLeft( text: string, cursor: Cursor )\r\n {\r\n if ( !text || !text.length ) return;\r\n\r\n const chars = text.length;\r\n const offset = chars * this.charWidth;\r\n\r\n cursor.left -= offset;\r\n cursor.left = Math.max( cursor.left, 0 );\r\n cursor.root.style.left = `calc( ${cursor.left}px + ${this.xPadding} )`;\r\n cursor.position -= chars;\r\n cursor.position = Math.max( cursor.position, 0 );\r\n\r\n this.restartBlink();\r\n\r\n // Check if we need to add scroll; if not then we might have to reduce it\r\n if ( !this.updateScrollLeft( cursor ) )\r\n {\r\n const leftMargin = this.charWidth;\r\n const cursorX = cursor.position * this.charWidth;\r\n const currentScrollLeft = this.getScrollLeft();\r\n if ( cursorX < ( currentScrollLeft + leftMargin ) )\r\n {\r\n const scroll = Math.max( cursorX - leftMargin, 0 );\r\n this.setScrollLeft( scroll );\r\n }\r\n }\r\n }\r\n\r\n cursorToTop( cursor: Cursor, resetLeft = false )\r\n {\r\n cursor.top -= this.lineHeight;\r\n cursor.top = Math.max( cursor.top, 0 );\r\n cursor.root.style.top = `calc(${cursor.top}px)`;\r\n this.restartBlink();\r\n\r\n if ( resetLeft )\r\n {\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor, true );\r\n }\r\n\r\n const currentScrollTop = this.getScrollTop();\r\n var firstLine = ( currentScrollTop / this.lineHeight ) | 0;\r\n if ( ( cursor.line - 1 ) < firstLine )\r\n {\r\n this.setScrollTop( currentScrollTop - this.lineHeight );\r\n }\r\n }\r\n\r\n cursorToBottom( cursor: Cursor, resetLeft = false )\r\n {\r\n cursor.top += this.lineHeight;\r\n cursor.root.style.top = `calc(${cursor.top}px)`;\r\n\r\n this.restartBlink();\r\n\r\n if ( resetLeft )\r\n {\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor, true );\r\n }\r\n\r\n const currentScrollTop = this.getScrollTop();\r\n const scrollerHeight = this.codeScroller.offsetHeight - this._fullVerticalOffset;\r\n const lastLine = ( ( scrollerHeight + currentScrollTop ) / this.lineHeight ) | 0;\r\n if ( cursor.line >= lastLine )\r\n {\r\n this.setScrollTop( currentScrollTop + this.lineHeight );\r\n }\r\n }\r\n\r\n cursorToString( cursor: Cursor, text: string, reverse: boolean = false )\r\n {\r\n if ( !text.length )\r\n {\r\n return;\r\n }\r\n\r\n if ( reverse )\r\n {\r\n this.cursorToLeft( text, cursor );\r\n }\r\n else\r\n {\r\n this.cursorToRight( text, cursor );\r\n }\r\n }\r\n\r\n cursorToPosition( cursor: Cursor, position: number, updateScroll = false )\r\n {\r\n cursor.position = position;\r\n cursor.left = position * this.charWidth;\r\n cursor.root.style.left = `calc( ${cursor.left}px + ${this.xPadding} )`;\r\n\r\n if ( updateScroll )\r\n {\r\n this.updateScrollLeft( cursor );\r\n }\r\n }\r\n\r\n cursorToLine( cursor: Cursor, line: number, resetLeft: boolean = false )\r\n {\r\n cursor.line = line;\r\n cursor.top = this.lineHeight * line;\r\n cursor.root.style.top = cursor.top + 'px';\r\n if ( resetLeft ) this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor );\r\n }\r\n\r\n saveCursor( cursor: Cursor, state: any = {} )\r\n {\r\n state.position = cursor.position;\r\n state.line = cursor.line;\r\n state.selection = cursor.selection ? cursor.selection.save() : undefined;\r\n return state;\r\n }\r\n\r\n saveCursors()\r\n {\r\n var cursors = [];\r\n\r\n for ( let cursor of this.cursors )\r\n {\r\n cursors.push( this.saveCursor( cursor ) );\r\n }\r\n\r\n return cursors;\r\n }\r\n\r\n getCurrentCursor( removeOthers: boolean = false ): Cursor\r\n {\r\n if ( removeOthers )\r\n {\r\n this._removeSecondaryCursors();\r\n }\r\n\r\n return this.cursors[0];\r\n }\r\n\r\n relocateCursors()\r\n {\r\n for ( let cursor of this.cursors )\r\n {\r\n cursor.set( cursor.position, cursor.line, false );\r\n }\r\n }\r\n\r\n mergeCursors( line: number )\r\n {\r\n console.assert( line >= 0 );\r\n const cursorsInLine = this.cursors.filter( ( v: any ) => v.line == line );\r\n\r\n while ( cursorsInLine.length > 1 )\r\n {\r\n this.removeCursor( cursorsInLine.pop() );\r\n }\r\n }\r\n\r\n restoreCursor( cursor: Cursor, state: any )\r\n {\r\n cursor.set( state.position, state.line );\r\n\r\n if ( state.selection )\r\n {\r\n this.endSelection();\r\n\r\n this.startSelection( cursor );\r\n\r\n cursor.selection?.load( state.selection );\r\n\r\n this._processSelection( cursor, null, true );\r\n }\r\n }\r\n\r\n removeCursor( cursor: Cursor | undefined )\r\n {\r\n if ( !cursor )\r\n {\r\n return;\r\n }\r\n\r\n LX.deleteElement( this.selections[cursor.name] );\r\n delete this.selections[cursor.name];\r\n LX.deleteElement( cursor );\r\n }\r\n\r\n resetCursorPos( flag: number, cursor?: Cursor, resetScroll = false )\r\n {\r\n cursor = cursor ?? this.getCurrentCursor();\r\n\r\n if ( flag & CodeEditor.CURSOR_LEFT )\r\n {\r\n cursor.left = 0;\r\n cursor.root.style.left = 'calc(' + this.xPadding + ')';\r\n cursor.position = 0;\r\n\r\n if ( resetScroll )\r\n {\r\n this.setScrollLeft( 0 );\r\n }\r\n }\r\n\r\n if ( flag & CodeEditor.CURSOR_TOP )\r\n {\r\n cursor.top = 0;\r\n cursor.root.style.top = '0px';\r\n cursor.line = 0;\r\n\r\n if ( resetScroll )\r\n {\r\n this.setScrollTop( 0 );\r\n }\r\n }\r\n }\r\n\r\n _addCursor( line: number = 0, position: number = 0, force: boolean = false, isMain: boolean = false )\r\n {\r\n // If cursor in that position exists, remove it instead..\r\n const exists: any = this.cursors.find( ( v: any ) => v.position == position && v.line == line );\r\n if ( exists && !force )\r\n {\r\n if ( !exists.isMain )\r\n {\r\n exists.remove();\r\n }\r\n\r\n return null;\r\n }\r\n\r\n let cursor: Cursor = new Cursor(\r\n 'cursor' + this.cursors.length,\r\n position,\r\n line,\r\n isMain,\r\n this\r\n );\r\n\r\n this.cursors.push( cursor );\r\n this.cursorsDOM.appendChild( cursor.root );\r\n\r\n return cursor;\r\n }\r\n\r\n _removeSecondaryCursors()\r\n {\r\n while ( this.cursors.length > 1 )\r\n {\r\n const r = this.cursors.pop();\r\n r?.root.remove();\r\n }\r\n }\r\n\r\n _getLastCursor()\r\n {\r\n return this.cursors.at( -1 );\r\n }\r\n\r\n _isLastCursor( cursor: Cursor )\r\n {\r\n return cursor === this._getLastCursor();\r\n }\r\n\r\n _logCursors()\r\n {\r\n for ( let cursor of this.cursors )\r\n {\r\n cursor.print();\r\n }\r\n }\r\n\r\n _addSpaceTabs( cursor: Cursor, n: number )\r\n {\r\n for ( var i = 0; i < n; ++i )\r\n {\r\n this.actions['Tab'].callback( cursor.line, cursor, null );\r\n }\r\n }\r\n\r\n _addSpaces( cursor: Cursor, n: number )\r\n {\r\n if ( cursor.selection && !cursor.selection.sameLine() )\r\n {\r\n cursor.selection.invertIfNecessary();\r\n\r\n for ( let lidx = cursor.selection.fromY; lidx <= cursor.selection.toY; ++lidx )\r\n {\r\n const lineString: string = this.code.lines[lidx];\r\n if ( !lineString.length )\r\n {\r\n continue;\r\n }\r\n\r\n // Remove indentation\r\n let lineStart = firstNonspaceIndex( lineString );\r\n\r\n // Only tabs/spaces in the line...\r\n if ( lineStart == -1 )\r\n {\r\n lineStart = lineString.length;\r\n }\r\n\r\n let indentSpaces = lineStart % this.tabSpaces;\r\n indentSpaces = indentSpaces == 0 ? this.tabSpaces : this.tabSpaces - indentSpaces;\r\n\r\n const spacesString = ' '.repeat( indentSpaces );\r\n\r\n this.code.lines[lidx] = [\r\n lineString.slice( 0, lineStart ),\r\n spacesString,\r\n lineString.slice( lineStart )\r\n ].join( '' );\r\n\r\n this.processLine( lidx );\r\n\r\n if ( cursor.line === lidx )\r\n {\r\n this.cursorToString( cursor, spacesString );\r\n }\r\n\r\n if ( cursor.selection.fromY === lidx )\r\n {\r\n cursor.selection.fromX = Math.max( cursor.selection.fromX + indentSpaces, 0 );\r\n }\r\n if ( cursor.selection.toY === lidx )\r\n {\r\n cursor.selection.toX = Math.max( cursor.selection.toX + indentSpaces, 0 );\r\n }\r\n\r\n this._processSelection( cursor, undefined, true );\r\n }\r\n\r\n return;\r\n }\r\n\r\n for ( var i = 0; i < n; ++i )\r\n {\r\n this.root.dispatchEvent( new CustomEvent( 'keydown', { 'detail': {\r\n skipUndo: true,\r\n key: ' ',\r\n targetCursor: this._lastProcessedCursorIndex\r\n } } ) );\r\n }\r\n }\r\n\r\n _removeSpaces( cursor: Cursor )\r\n {\r\n if ( cursor.selection )\r\n {\r\n cursor.selection.invertIfNecessary();\r\n }\r\n\r\n const lCount = cursor.selection ? 1 + ( cursor.selection.toY - cursor.selection.fromY ) : 1;\r\n\r\n for ( let i = 0; i < lCount; ++i )\r\n {\r\n const lidx = ( cursor.selection ? cursor.selection.fromY : cursor.line ) + i;\r\n const lineString: string = this.code.lines[lidx];\r\n\r\n // Remove indentation\r\n let lineStart = firstNonspaceIndex( lineString );\r\n\r\n // Nothing to remove... we are at the start of the line\r\n if ( lineStart == 0 )\r\n {\r\n continue;\r\n }\r\n\r\n // Only tabs/spaces in the line...\r\n if ( lineStart == -1 )\r\n {\r\n lineStart = lineString.length;\r\n }\r\n\r\n let indentSpaces = lineStart % this.tabSpaces;\r\n indentSpaces = indentSpaces == 0 ? this.tabSpaces : indentSpaces;\r\n const newStart = Math.max( lineStart - indentSpaces, 0 );\r\n\r\n this.code.lines[lidx] = [\r\n lineString.slice( 0, newStart ),\r\n lineString.slice( lineStart )\r\n ].join( '' );\r\n\r\n this.processLine( lidx );\r\n\r\n if ( cursor.line === lidx )\r\n {\r\n this.cursorToString( cursor, ' '.repeat( indentSpaces ), true );\r\n }\r\n\r\n if ( cursor.selection )\r\n {\r\n if ( cursor.selection.fromY === lidx )\r\n {\r\n cursor.selection.fromX = Math.max( cursor.selection.fromX - indentSpaces, 0 );\r\n }\r\n if ( cursor.selection.toY === lidx )\r\n {\r\n cursor.selection.toX = Math.max( cursor.selection.toX - indentSpaces, 0 );\r\n }\r\n\r\n this._processSelection( cursor, undefined, true );\r\n }\r\n }\r\n }\r\n\r\n updateScrollLeft( cursor: Cursor )\r\n {\r\n cursor = cursor ?? this.getCurrentCursor();\r\n\r\n const rightMargin = this.charWidth;\r\n const cursorX = cursor.position * this.charWidth;\r\n const currentScrollLeft = this.getScrollLeft();\r\n const viewportSizeX = this.codeScroller.clientWidth - CodeEditor.LINE_GUTTER_WIDTH; // Gutter offset\r\n const viewportX = viewportSizeX + currentScrollLeft;\r\n\r\n if ( cursorX >= ( viewportX - rightMargin ) )\r\n {\r\n const scroll = Math.max( cursorX - ( viewportSizeX - rightMargin ), 0 );\r\n this.setScrollLeft( scroll );\r\n return true;\r\n }\r\n }\r\n\r\n getScrollLeft()\r\n {\r\n if ( !this.codeScroller ) return 0;\r\n return this.codeScroller.scrollLeft;\r\n }\r\n\r\n getScrollTop()\r\n {\r\n if ( !this.codeScroller ) return 0;\r\n return this.codeScroller.scrollTop;\r\n }\r\n\r\n setScrollLeft( value: number )\r\n {\r\n if ( !this.codeScroller ) return;\r\n LX.doAsync( () => {\r\n this.codeScroller.scrollLeft = value;\r\n this.setScrollBarValue( 'horizontal', 0 );\r\n }, 10 );\r\n }\r\n\r\n setScrollTop( value: number )\r\n {\r\n if ( !this.codeScroller ) return;\r\n LX.doAsync( () => {\r\n this.codeScroller.scrollTop = value;\r\n this.setScrollBarValue( 'vertical' );\r\n }, 10 );\r\n }\r\n\r\n resize( flag: number = CodeEditor.RESIZE_SCROLLBAR_H_V, pMaxLength?: number, onResize?: any )\r\n {\r\n setTimeout( () => {\r\n let scrollWidth, scrollHeight;\r\n\r\n if ( flag & CodeEditor.RESIZE_SCROLLBAR_H )\r\n {\r\n // Update max viewport\r\n const maxLineLength = pMaxLength ?? this.getMaxLineLength();\r\n this._lastMaxLineLength = maxLineLength;\r\n scrollWidth = maxLineLength * this.charWidth + CodeEditor.LINE_GUTTER_WIDTH;\r\n this.codeSizer.style.minWidth = scrollWidth + 'px';\r\n }\r\n\r\n if ( flag & CodeEditor.RESIZE_SCROLLBAR_V )\r\n {\r\n scrollHeight = this.code.lines.length * this.lineHeight;\r\n this.codeSizer.style.minHeight = scrollHeight + 'px';\r\n }\r\n\r\n this.resizeScrollBars( flag );\r\n\r\n if ( onResize )\r\n {\r\n onResize( scrollWidth, scrollHeight );\r\n }\r\n }, 10 );\r\n }\r\n\r\n resizeIfNecessary( cursor: Cursor, force: boolean = false )\r\n {\r\n const maxLineLength = this.getMaxLineLength();\r\n const numViewportChars = Math.floor(\r\n ( this.codeScroller.clientWidth - CodeEditor.LINE_GUTTER_WIDTH ) / this.charWidth\r\n );\r\n if ( force || ( maxLineLength >= numViewportChars && maxLineLength != this._lastMaxLineLength ) )\r\n {\r\n this.resize( CodeEditor.RESIZE_SCROLLBAR_H, maxLineLength, () => {\r\n if ( cursor.position > numViewportChars )\r\n {\r\n this.setScrollLeft( cursor.position * this.charWidth );\r\n }\r\n } );\r\n }\r\n }\r\n\r\n resizeScrollBars( flag = CodeEditor.RESIZE_SCROLLBAR_H_V )\r\n {\r\n if ( flag & CodeEditor.RESIZE_SCROLLBAR_V )\r\n {\r\n const totalLinesInViewport = ( ( this.codeScroller.offsetHeight ) / this.lineHeight ) | 0;\r\n const needsVerticalScrollbar = this.code.lines.length >= totalLinesInViewport;\r\n if ( needsVerticalScrollbar )\r\n {\r\n this.vScrollbar.thumb.size = totalLinesInViewport / this.code.lines.length;\r\n this.vScrollbar.thumb.style.height = ( this.vScrollbar.thumb.size * 100.0 ) + '%';\r\n }\r\n\r\n this.vScrollbar.root.classList.toggle( 'hidden', !needsVerticalScrollbar );\r\n this.hScrollbar.root.style.width = `calc(100% - ${\r\n 48 + ( needsVerticalScrollbar ? ScrollBar.SCROLLBAR_VERTICAL_WIDTH : 0 )\r\n }px)`; // 48 is the line gutter\r\n this.codeArea.root.style.width = `calc(100% - ${\r\n needsVerticalScrollbar ? ScrollBar.SCROLLBAR_VERTICAL_WIDTH : 0\r\n }px)`;\r\n }\r\n\r\n if ( flag & CodeEditor.RESIZE_SCROLLBAR_H )\r\n {\r\n const numViewportChars = Math.floor(\r\n ( this.codeScroller.clientWidth - CodeEditor.LINE_GUTTER_WIDTH ) / this.charWidth\r\n );\r\n const maxLineLength = this._lastMaxLineLength!;\r\n const needsHorizontalScrollbar = maxLineLength >= numViewportChars;\r\n\r\n if ( needsHorizontalScrollbar )\r\n {\r\n this.hScrollbar.thumb.size = numViewportChars / maxLineLength;\r\n this.hScrollbar.thumb.style.width = ( this.hScrollbar.thumb.size * 100.0 ) + '%';\r\n }\r\n\r\n this.hScrollbar.root.classList.toggle( 'hidden', !needsHorizontalScrollbar );\r\n this.codeArea.root.style.height = `calc(100% - ${\r\n this._fullVerticalOffset + ( needsHorizontalScrollbar ? ScrollBar.SCROLLBAR_HORIZONTAL_HEIGHT : 0 )\r\n }px)`;\r\n }\r\n }\r\n\r\n setScrollBarValue( type: string = 'vertical', value?: number )\r\n {\r\n if ( type == 'vertical' )\r\n {\r\n const scrollHeight = this.codeScroller.scrollHeight - this.codeScroller.clientHeight;\r\n\r\n if ( scrollHeight > 0 )\r\n {\r\n const scrollBarHeight = this.vScrollbar.thumb.parentElement.offsetHeight;\r\n const scrollThumbHeight = this.vScrollbar.thumb.offsetHeight;\r\n const currentScroll = this.codeScroller.scrollTop;\r\n this.vScrollbar.thumb._top = ( currentScroll / scrollHeight ) * ( scrollBarHeight - scrollThumbHeight );\r\n this.vScrollbar.thumb.style.top = this.vScrollbar.thumb._top + 'px';\r\n }\r\n }\r\n else\r\n {\r\n if ( value !== undefined )\r\n {\r\n this.codeScroller.scrollLeft += value;\r\n }\r\n\r\n // Only when scroll is needed\r\n const scrollWidth = this.codeScroller.scrollWidth - this.codeScroller.clientWidth;\r\n if ( scrollWidth > 0 )\r\n {\r\n const scrollBarWidth = this.hScrollbar.thumb.parentElement.offsetWidth;\r\n const scrollThumbWidth = this.hScrollbar.thumb.offsetWidth;\r\n const currentScroll = this.codeScroller.scrollLeft;\r\n this.hScrollbar.thumb._left = ( currentScroll / scrollWidth ) * ( scrollBarWidth - scrollThumbWidth );\r\n this.hScrollbar.thumb.style.left = this.hScrollbar.thumb._left + 'px';\r\n }\r\n }\r\n }\r\n\r\n updateHorizontalScrollFromScrollBar( value: number )\r\n {\r\n value = this.hScrollbar.thumb._left - value;\r\n\r\n // Move scrollbar thumb\r\n\r\n const scrollBarWidth = this.hScrollbar.thumb.parentElement.offsetWidth;\r\n const scrollThumbWidth = this.hScrollbar.thumb.offsetWidth;\r\n\r\n this.hScrollbar.thumb._left = LX.clamp( value, 0, scrollBarWidth - scrollThumbWidth );\r\n this.hScrollbar.thumb.style.left = this.hScrollbar.thumb._left + 'px';\r\n\r\n // Scroll code\r\n\r\n const scrollWidth = this.codeScroller.scrollWidth - this.codeScroller.clientWidth;\r\n const currentScroll = ( this.hScrollbar.thumb._left * scrollWidth ) / ( scrollBarWidth - scrollThumbWidth );\r\n this.codeScroller.scrollLeft = currentScroll;\r\n\r\n this._discardScroll = true;\r\n }\r\n\r\n updateVerticalScrollFromScrollBar( value: number ): void\r\n {\r\n value = this.vScrollbar.thumb._top - value;\r\n\r\n // Move scrollbar thumb\r\n\r\n const scrollBarHeight = this.vScrollbar.thumb.parentElement.offsetHeight;\r\n const scrollThumbHeight = this.vScrollbar.thumb.offsetHeight;\r\n\r\n this.vScrollbar.thumb._top = LX.clamp( value, 0, scrollBarHeight - scrollThumbHeight );\r\n this.vScrollbar.thumb.style.top = this.vScrollbar.thumb._top + 'px';\r\n\r\n // Scroll code\r\n\r\n const scrollHeight = this.codeScroller.scrollHeight - this.codeScroller.clientHeight;\r\n const currentScroll = ( this.vScrollbar.thumb._top * scrollHeight ) / ( scrollBarHeight - scrollThumbHeight );\r\n this.codeScroller.scrollTop = currentScroll;\r\n }\r\n\r\n getCharAtPos( cursor: Cursor, offset: number = 0 )\r\n {\r\n return this.code.lines[cursor.line][cursor.position + offset];\r\n }\r\n\r\n getWordAtPos( cursor: Cursor, offset: number = 0 )\r\n {\r\n const col = cursor.line;\r\n const words = this.code.lines[col];\r\n\r\n const isChar = ( char: string ) => {\r\n const exceptions = [ '_', '#', '!' ];\r\n const code = char.charCodeAt( 0 );\r\n return ( exceptions.indexOf( char ) > -1 ) || ( code > 47 && code < 58 ) || ( code > 64 && code < 91 )\r\n || ( code > 96 && code < 123 );\r\n };\r\n\r\n let from = cursor.position + offset;\r\n let to = cursor.position + offset;\r\n\r\n // Check left ...\r\n\r\n while ( words[from] && isChar( words[from] ) )\r\n {\r\n from--;\r\n }\r\n\r\n from++;\r\n\r\n // Check right ...\r\n\r\n while ( words[to] && isChar( words[to] ) )\r\n {\r\n to++;\r\n }\r\n\r\n // Skip spaces ...\r\n\r\n let word = words.substring( from, to );\r\n if ( word == ' ' )\r\n {\r\n if ( offset < 0 )\r\n {\r\n while ( words[from - 1] != undefined && words[from - 1] == ' ' )\r\n {\r\n from--;\r\n }\r\n to++;\r\n word = words.substring( from, to + 1 );\r\n }\r\n else\r\n {\r\n while ( words[to] != undefined && words[to] == ' ' )\r\n {\r\n to++;\r\n }\r\n from--;\r\n word = words.substring( from, to );\r\n }\r\n }\r\n\r\n return [ word, from, to ];\r\n }\r\n\r\n _measureChar( char: string = 'M', useFloating: boolean = true, getBB: boolean = false )\r\n {\r\n const parentContainer = LX.makeContainer( null, 'lexcodeeditor', '', document.body );\r\n const container = LX.makeContainer( null, 'code', '', parentContainer );\r\n const line = document.createElement( 'pre' );\r\n container.appendChild( line );\r\n const text = document.createElement( 'span' );\r\n line.appendChild( text );\r\n text.innerText = char;\r\n var rect = text.getBoundingClientRect();\r\n LX.deleteElement( parentContainer );\r\n const bb = [ useFloating ? rect.width : Math.floor( rect.width ),\r\n useFloating ? rect.height : Math.floor( rect.height ) ];\r\n return getBB ? bb : bb[0];\r\n }\r\n\r\n measureString( str: string )\r\n {\r\n return str.length * this.charWidth;\r\n }\r\n\r\n runScript( code: string )\r\n {\r\n const script = document.createElement( 'script' );\r\n script.type = 'module';\r\n script.innerHTML = code;\r\n // script.src = url[ i ] + ( version ? \"?version=\" + version : \"\" );\r\n script.async = false;\r\n // script.onload = function(e) { };\r\n document.getElementsByTagName( 'head' )[0].appendChild( script );\r\n }\r\n\r\n toJSONFormat( text: string )\r\n {\r\n let params = text.split( ':' );\r\n\r\n for ( let i = 0; i < params.length; i++ )\r\n {\r\n let key: any = params[i].split( ',' );\r\n if ( key.length > 1 )\r\n {\r\n if ( key[key.length - 1].includes( ']' ) )\r\n {\r\n continue;\r\n }\r\n key = key[key.length - 1];\r\n }\r\n else if ( key[0].includes( '}' ) )\r\n {\r\n continue;\r\n }\r\n else\r\n {\r\n key = key[0];\r\n }\r\n key = key.replaceAll( /[{}\\n\\r]/g, '' ).replaceAll( ' ', '' );\r\n if ( key[0] != '\"' && key[key.length - 1] != '\"' )\r\n {\r\n params[i] = params[i].replace( key, '\"' + key + '\"' );\r\n }\r\n }\r\n\r\n text = params.join( ':' );\r\n\r\n try\r\n {\r\n let json = JSON.parse( text );\r\n return JSON.stringify( json, undefined, 4 );\r\n }\r\n catch ( e )\r\n {\r\n alert( 'Invalid JSON format' );\r\n return;\r\n }\r\n }\r\n\r\n showAutoCompleteBox( key: string, cursor: Cursor )\r\n {\r\n if ( !cursor.isMain )\r\n {\r\n return;\r\n }\r\n\r\n const [ word, start, end ] = this.getWordAtPos( cursor, -1 );\r\n if ( key == ' ' || !word.length )\r\n {\r\n this.hideAutoCompleteBox();\r\n return;\r\n }\r\n\r\n this.autocomplete.innerHTML = ''; // Clear all suggestions\r\n\r\n // Add language special keys...\r\n let suggestions = [\r\n ...Array.from( CodeEditor.keywords[this.highlight] ?? [] ),\r\n ...Array.from( CodeEditor.builtIn[this.highlight] ?? [] ),\r\n ...Array.from( CodeEditor.statements[this.highlight] ?? [] ),\r\n ...Array.from( CodeEditor.types[this.highlight] ?? [] ),\r\n ...Array.from( CodeEditor.utils[this.highlight] ?? [] )\r\n ];\r\n\r\n const scopeStack = [ ...this.code.lineScopes[cursor.line] ];\r\n const scope = scopeStack.at( -1 );\r\n if ( scope.type.startsWith( 'enum' ) )\r\n {\r\n const enumValues = Array.from( this.code.symbolsTable ).filter( ( s: any ) =>\r\n s[1][0].kind === 'enum_value' && s[1][0].scope === scope.name\r\n ).map( ( s: any ) => s[0] );\r\n suggestions = suggestions.concat( enumValues.slice( 0, -1 ) );\r\n }\r\n else\r\n {\r\n const otherValues = Array.from( this.code.symbolsTable ).map( ( s: any ) => s[0] );\r\n suggestions = suggestions.concat( otherValues.slice( 0, -1 ) );\r\n }\r\n\r\n // Add custom suggestions...\r\n suggestions = suggestions.concat( this.customSuggestions );\r\n\r\n // Remove 1/2 char words and duplicates...\r\n suggestions = ( Array.from( new Set( suggestions ) ) as string[] ).filter( ( s: string ) =>\r\n s.length > 2 && s.toLowerCase().includes( word.toLowerCase() )\r\n );\r\n\r\n // Order...\r\n\r\n function scoreSuggestion( s: string, prefix: string )\r\n {\r\n if ( s.startsWith( prefix ) ) return 0; // best option\r\n if ( s.includes( prefix ) ) return 1;\r\n return 2; // worst\r\n }\r\n\r\n suggestions = ( suggestions as string[] ).sort( ( a, b ) =>\r\n ( scoreSuggestion( a, word ) - scoreSuggestion( b, word ) ) || a.localeCompare( b )\r\n );\r\n\r\n for ( let s of suggestions )\r\n {\r\n const currSuggestion = s as string;\r\n const pre = document.createElement( 'pre' );\r\n this.autocomplete.appendChild( pre );\r\n\r\n const symbol = this.code.symbolsTable.get( s );\r\n\r\n let iconName = 'CaseLower';\r\n let iconClass = 'foo';\r\n\r\n if ( symbol )\r\n {\r\n switch ( symbol[0].kind )\r\n // Get first occurrence\r\n {\r\n case 'variable':\r\n iconName = 'Cuboid';\r\n iconClass = 'fg-blue-400';\r\n break;\r\n case 'method':\r\n iconName = 'Box';\r\n iconClass = 'fg-fuchsia-500';\r\n break;\r\n case 'class':\r\n iconName = 'CircleNodes';\r\n iconClass = 'fg-orange-500';\r\n break;\r\n }\r\n }\r\n else\r\n {\r\n if ( this._mustHightlightWord( currSuggestion, CodeEditor.utils ) )\r\n {\r\n iconName = 'ToolCase';\r\n }\r\n else if ( this._mustHightlightWord( currSuggestion, CodeEditor.types ) )\r\n {\r\n iconName = 'Type';\r\n iconClass = 'fg-blue-400';\r\n }\r\n }\r\n\r\n pre.appendChild( LX.makeIcon( iconName, { iconClass: 'mr-1', svgClass: 'sm ' + iconClass } ) );\r\n pre.addEventListener( 'click', () => {\r\n this.autoCompleteWord( currSuggestion );\r\n } );\r\n\r\n // Highlight the written part\r\n const index = currSuggestion.toLowerCase().indexOf( word.toLowerCase() );\r\n\r\n var preWord = document.createElement( 'span' );\r\n preWord.innerHTML = currSuggestion.substring( 0, index );\r\n pre.appendChild( preWord );\r\n\r\n var actualWord = document.createElement( 'span' );\r\n actualWord.innerHTML = currSuggestion.substr( index, word.length );\r\n actualWord.classList.add( 'word-highlight' );\r\n pre.appendChild( actualWord );\r\n\r\n var postWord = document.createElement( 'span' );\r\n postWord.innerHTML = currSuggestion.substring( index + word.length );\r\n pre.appendChild( postWord );\r\n }\r\n\r\n if ( !this.autocomplete.childElementCount )\r\n {\r\n this.hideAutoCompleteBox();\r\n return;\r\n }\r\n\r\n const maxX = this.codeScroller.clientWidth - 256; // Viewport - box width\r\n\r\n // Select always first option\r\n ( this.autocomplete.firstChild as any ).classList.add( 'selected' );\r\n\r\n // Show box\r\n this.autocomplete.classList.toggle( 'show', true );\r\n this.autocomplete.classList.toggle( 'no-scrollbar',\r\n !( this.autocomplete.scrollHeight > this.autocomplete.offsetHeight ) );\r\n this.autocomplete.style.left = `${\r\n Math.min( cursor.left + CodeEditor.LINE_GUTTER_WIDTH - this.getScrollLeft(), maxX )\r\n }px`;\r\n this.autocomplete.style.top =\r\n `${( cursor.top + this._verticalTopOffset + this.lineHeight - this.getScrollTop() )}px`;\r\n\r\n this.isAutoCompleteActive = true;\r\n }\r\n\r\n hideAutoCompleteBox()\r\n {\r\n if ( !this.autocomplete )\r\n {\r\n return;\r\n }\r\n\r\n const isActive = this.isAutoCompleteActive;\r\n this.isAutoCompleteActive = false;\r\n this.autocomplete.classList.remove( 'show' );\r\n this.autocomplete.innerHTML = ''; // Clear all suggestions\r\n\r\n return isActive != this.isAutoCompleteActive;\r\n }\r\n\r\n autoCompleteWord( suggestion?: string )\r\n {\r\n if ( !this.isAutoCompleteActive )\r\n {\r\n return;\r\n }\r\n\r\n let [ suggestedWord, idx ] = this._getSelectedAutoComplete();\r\n suggestedWord = suggestion ?? suggestedWord;\r\n\r\n for ( let cursor of this.cursors )\r\n {\r\n const [ word, start, end ] = this.getWordAtPos( cursor, -1 );\r\n\r\n const lineString = this.code.lines[cursor.line];\r\n this.code.lines[cursor.line] = lineString.slice( 0, start ) + suggestedWord + lineString.slice( end );\r\n\r\n // Process lines and remove suggestion box\r\n this.cursorToPosition( cursor, start + suggestedWord.length );\r\n this.processLine( cursor.line );\r\n }\r\n\r\n // Only the main cursor autocompletes, skip the \"Tab\" event for the rest\r\n this._skipTabs = this.cursors.length - 1;\r\n\r\n this.hideAutoCompleteBox();\r\n }\r\n\r\n _getSelectedAutoComplete(): any[]\r\n {\r\n for ( let i = 0; i < this.autocomplete.childElementCount; ++i )\r\n {\r\n const child: any = this.autocomplete.childNodes[i];\r\n if ( child.classList.contains( 'selected' ) )\r\n {\r\n var word = '';\r\n for ( let childSpan of child.childNodes )\r\n {\r\n if ( childSpan.constructor != HTMLSpanElement )\r\n {\r\n continue;\r\n }\r\n word += childSpan.innerHTML;\r\n }\r\n\r\n return [ word, i ]; // Get text of the span inside the 'pre' element\r\n }\r\n }\r\n\r\n return [ null, -1 ];\r\n }\r\n\r\n _moveArrowSelectedAutoComplete( dir: string )\r\n {\r\n if ( !this.isAutoCompleteActive )\r\n {\r\n return;\r\n }\r\n\r\n const [ word, idx ] = this._getSelectedAutoComplete();\r\n const offset = dir == 'down' ? 1 : -1;\r\n const fIdx = idx + offset;\r\n\r\n const autocompleteRowHeight = 22;\r\n const autocompleteHeight = 132;\r\n\r\n if ( dir == 'down' )\r\n {\r\n if ( fIdx >= this.autocomplete.childElementCount ) return;\r\n\r\n if ( ( ( idx + offset * 2 ) * autocompleteRowHeight ) - this.autocomplete.scrollTop > autocompleteHeight )\r\n {\r\n this.autocomplete.scrollTop += autocompleteRowHeight;\r\n }\r\n }\r\n else if ( dir == 'up' )\r\n {\r\n if ( fIdx < 0 ) return;\r\n\r\n if ( ( fIdx * autocompleteRowHeight ) < this.autocomplete.scrollTop )\r\n {\r\n this.autocomplete.scrollTop -= autocompleteRowHeight;\r\n }\r\n }\r\n\r\n // Remove selected from the current word and add it to the next one\r\n LX.removeClass( this.autocomplete.childNodes[idx], 'selected' );\r\n LX.addClass( this.autocomplete.childNodes[idx + offset], 'selected' );\r\n }\r\n\r\n showSearchBox( clear: boolean = false )\r\n {\r\n this.hideSearchLineBox();\r\n\r\n LX.addClass( this.searchbox, 'opened' );\r\n this.isSearchboxActive = true;\r\n\r\n const input: any = this.searchbox.querySelector( 'input' );\r\n\r\n if ( clear )\r\n {\r\n input.value = '';\r\n }\r\n else\r\n {\r\n const cursor = this.getCurrentCursor();\r\n\r\n if ( cursor.selection )\r\n {\r\n input.value = cursor.selection.getText() ?? input.value;\r\n }\r\n }\r\n\r\n input.selectionStart = 0;\r\n input.selectionEnd = input.value.length;\r\n\r\n input.focus();\r\n }\r\n\r\n hideSearchBox()\r\n {\r\n const active = this.isSearchboxActive;\r\n\r\n if ( this.isSearchboxActive )\r\n {\r\n this.searchbox.classList.remove( 'opened' );\r\n this.isSearchboxActive = false;\r\n }\r\n else if ( this._lastResult )\r\n {\r\n LX.deleteElement( this._lastResult.dom );\r\n delete this._lastResult;\r\n }\r\n\r\n this.searchResultSelections.classList.remove( 'show' );\r\n\r\n return ( active != this.isSearchboxActive );\r\n }\r\n\r\n search( text?: string | null, reverse: boolean = false, callback?: any, skipAlert: boolean = false,\r\n forceFocus: boolean = true )\r\n {\r\n text = text ?? this._lastTextFound;\r\n\r\n if ( !text )\r\n {\r\n return;\r\n }\r\n\r\n let cursor = this.getCurrentCursor();\r\n let cursorData = new LX.vec2( cursor.position, cursor.line );\r\n let line = null;\r\n let char = -1;\r\n\r\n if ( this._lastResult )\r\n {\r\n LX.deleteElement( this._lastResult.dom );\r\n cursorData = this._lastResult.pos;\r\n cursorData.x += text.length * ( reverse ? -1 : 1 );\r\n delete this._lastResult;\r\n }\r\n\r\n const getIndex = ( l: number ) => {\r\n var string = this.code.lines[l];\r\n\r\n if ( reverse )\r\n {\r\n string = string.substr( 0, l == cursorData.y ? cursorData.x : string.length );\r\n var reversed = strReverse( string );\r\n var reversedIdx = reversed.indexOf( strReverse( text ) );\r\n return reversedIdx == -1 ? -1 : string.length - reversedIdx - text.length;\r\n }\r\n else\r\n {\r\n return string.substr( l == cursorData.y ? cursorData.x : 0 ).indexOf( text );\r\n }\r\n };\r\n\r\n if ( reverse )\r\n {\r\n for ( var j = cursorData.y; j >= 0; --j )\r\n {\r\n char = getIndex( j );\r\n if ( char > -1 )\r\n {\r\n line = j;\r\n break;\r\n }\r\n }\r\n }\r\n else\r\n {\r\n for ( var j = cursorData.y; j < this.code.lines.length; ++j )\r\n {\r\n char = getIndex( j );\r\n if ( char > -1 )\r\n {\r\n line = j;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if ( line == null )\r\n {\r\n if ( !skipAlert )\r\n {\r\n alert( 'No results!' );\r\n }\r\n\r\n const lastLine = this.code.lines.length - 1;\r\n\r\n this._lastResult = {\r\n 'dom': this.searchResultSelections.lastChild,\r\n 'pos': reverse ? new LX.vec2( this.code.lines[lastLine].length, lastLine ) : new LX.vec2( 0, 0 )\r\n };\r\n\r\n return;\r\n }\r\n\r\n /*\r\n Position idx is computed from last pos, which could be in same line,\r\n so we search in the substring (first_ocurrence, end). That's why we\r\n have to add the length of the substring (0, first_ocurrence)\r\n */\r\n\r\n if ( !reverse )\r\n {\r\n char += line == cursorData.y ? cursorData.x : 0;\r\n }\r\n\r\n // Text found..\r\n\r\n this._lastTextFound = text;\r\n\r\n this.codeScroller.scrollTo(\r\n Math.max( char * this.charWidth - this.codeScroller.clientWidth, 0 ),\r\n Math.max( line - 10, 0 ) * this.lineHeight\r\n );\r\n\r\n if ( callback )\r\n {\r\n callback( char, line );\r\n }\r\n else\r\n {\r\n // Show elements\r\n this.searchResultSelections.classList.add( 'show' );\r\n\r\n // Create new selection instance\r\n cursor.selection = new CodeSelection( this, cursor, 'lexcodesearchresult' );\r\n cursor.selection.selectInline( cursor, char, line, this.measureString( text ), true );\r\n }\r\n\r\n this._lastResult = {\r\n 'dom': this.searchResultSelections.lastChild,\r\n 'pos': new LX.vec2( char, line ),\r\n reverse\r\n };\r\n\r\n // Force focus back to search box\r\n if ( forceFocus )\r\n {\r\n const input: any = this.searchbox.querySelector( 'input' );\r\n input.focus();\r\n }\r\n }\r\n\r\n showSearchLineBox()\r\n {\r\n this.hideSearchBox();\r\n\r\n this.searchlinebox.classList.add( 'opened' );\r\n this.isSearchlineboxActive = true;\r\n\r\n const input: any = this.searchlinebox.querySelector( 'input' );\r\n input.value = ':';\r\n input.focus();\r\n }\r\n\r\n hideSearchLineBox()\r\n {\r\n if ( this.isSearchlineboxActive )\r\n {\r\n this.searchlinebox.classList.remove( 'opened' );\r\n this.isSearchlineboxActive = false;\r\n }\r\n }\r\n\r\n goToLine( line: any )\r\n {\r\n if ( !this._isNumber( line ) )\r\n {\r\n return;\r\n }\r\n\r\n this.codeScroller.scrollTo( 0, Math.max( line - 15 ) * this.lineHeight );\r\n\r\n // Select line ?\r\n var cursor = this.getCurrentCursor( true );\r\n this.cursorToLine( cursor, line - 1, true );\r\n }\r\n\r\n selectNextOcurrence( cursor: Cursor )\r\n {\r\n if ( !cursor.selection )\r\n {\r\n return;\r\n }\r\n\r\n const text = cursor.selection.getText();\r\n if ( !text )\r\n {\r\n return;\r\n }\r\n\r\n if ( !this._currentOcurrences )\r\n {\r\n const currentKey = [ cursor.position - text.length, cursor.line ].join( '_' );\r\n this._currentOcurrences = {};\r\n this._currentOcurrences[currentKey] = true;\r\n }\r\n\r\n this.search( text, false, ( col: number, ln: number ) => {\r\n const key = [ col, ln ].join( '_' );\r\n\r\n if ( this._currentOcurrences[key] )\r\n {\r\n return;\r\n }\r\n\r\n var newCursor = this._addCursor( ln, col, true );\r\n if ( newCursor )\r\n {\r\n this.startSelection( newCursor );\r\n newCursor?.root.selection.selectInline( newCursor, col, ln, this.measureString( text ) );\r\n this.cursorToString( newCursor, text );\r\n }\r\n\r\n this._currentOcurrences[key] = true;\r\n }, true, false );\r\n }\r\n\r\n _updateDataInfoPanel( signal: string, value: any )\r\n {\r\n if ( !this.skipInfo )\r\n {\r\n if ( this.cursors.length > 1 )\r\n {\r\n value = '';\r\n }\r\n\r\n LX.emitSignal( signal, value );\r\n }\r\n }\r\n\r\n _setActiveLine( n?: number )\r\n {\r\n n = n ?? this.state.activeLine;\r\n if ( n === undefined )\r\n {\r\n return;\r\n }\r\n\r\n const cursor = this.getCurrentCursor();\r\n this._updateDataInfoPanel( '@cursor-data', `Ln ${n + 1}, Col ${cursor.position + 1}` );\r\n\r\n const oldLocal = this.toLocalLine( this.state.activeLine );\r\n let line = this.code.childNodes[oldLocal];\r\n\r\n if ( !line )\r\n {\r\n return;\r\n }\r\n\r\n line.classList.remove( 'active-line' );\r\n\r\n // Set new active\r\n {\r\n this.state.activeLine = n;\r\n\r\n const newLocal = this.toLocalLine( n );\r\n line = this.code.childNodes[newLocal];\r\n if ( line ) line.classList.add( 'active-line' );\r\n }\r\n }\r\n\r\n _hideActiveLine()\r\n {\r\n this.code.querySelectorAll( '.active-line' ).forEach( ( e: HTMLElement ) =>\r\n e.classList.remove( 'active-line' )\r\n );\r\n }\r\n\r\n _setFontSize( size: number )\r\n {\r\n // Change font size\r\n this.fontSize = size;\r\n const r: any = document.querySelector( ':root' );\r\n r.style.setProperty( '--code-editor-font-size', `${this.fontSize}px` );\r\n this.charWidth = this._measureChar() as number;\r\n\r\n window.localStorage.setItem( 'lexcodeeditor-font-size', `${this.fontSize}` );\r\n\r\n // Change row size\r\n const rowPixels = this.fontSize + 6;\r\n r.style.setProperty( '--code-editor-row-height', `${rowPixels}px` );\r\n this.lineHeight = rowPixels;\r\n\r\n // Relocate cursors\r\n this.relocateCursors();\r\n\r\n // Resize the code area\r\n this.processLines();\r\n\r\n // Emit event\r\n LX.emitSignal( '@font-size', this.fontSize );\r\n }\r\n\r\n _applyFontSizeOffset( offset = 0 )\r\n {\r\n const newFontSize = LX.clamp( this.fontSize + offset, CodeEditor.CODE_MIN_FONT_SIZE,\r\n CodeEditor.CODE_MAX_FONT_SIZE );\r\n this._setFontSize( newFontSize );\r\n }\r\n\r\n _increaseFontSize()\r\n {\r\n this._applyFontSizeOffset( 1 );\r\n }\r\n\r\n _decreaseFontSize()\r\n {\r\n this._applyFontSizeOffset( -1 );\r\n }\r\n\r\n _clearTmpVariables()\r\n {\r\n delete this._currentLineString;\r\n delete this._currentLineNumber;\r\n delete this._buildingString;\r\n delete this._pendingString;\r\n delete this._buildingBlockComment;\r\n delete this._markdownHeader;\r\n delete this._lastResult;\r\n delete this._scopeStack;\r\n }\r\n\r\n async _requestFileAsync( url: string, dataType?: string, nocache: boolean = false )\r\n {\r\n return new Promise( ( resolve, reject ) => {\r\n dataType = dataType ?? 'arraybuffer';\r\n const mimeType = dataType === 'arraybuffer' ? 'application/octet-stream' : undefined;\r\n var xhr: any = new XMLHttpRequest();\r\n xhr.open( 'GET', url, true );\r\n xhr.responseType = dataType;\r\n if ( mimeType )\r\n {\r\n xhr.overrideMimeType( mimeType );\r\n }\r\n if ( nocache )\r\n {\r\n xhr.setRequestHeader( 'Cache-Control', 'no-cache' );\r\n }\r\n xhr.onload = function()\r\n {\r\n var response = this.response;\r\n if ( this.status != 200 )\r\n {\r\n var err = 'Error ' + this.status;\r\n reject( err );\r\n return;\r\n }\r\n resolve( response );\r\n };\r\n xhr.onerror = function( err: any )\r\n {\r\n reject( err );\r\n };\r\n xhr.send();\r\n return xhr;\r\n } );\r\n }\r\n}\r\n\r\nconst CE = CodeEditor as any;\r\n\r\nCE.languages = {\r\n 'Plain Text': { ext: 'txt', blockComments: false, singleLineComments: false, numbers: false,\r\n icon: 'AlignLeft fg-neutral-500' },\r\n 'JavaScript': { ext: 'js', icon: 'Js fg-yellow-500' },\r\n 'TypeScript': { ext: 'ts', icon: 'Ts fg-blue-600' },\r\n 'C': { ext: [ 'c', 'h' ], usePreprocessor: true, icon: { 'c': 'C fg-sky-400', 'h': 'C fg-fuchsia-500' } },\r\n 'C++': { ext: [ 'cpp', 'hpp' ], usePreprocessor: true,\r\n icon: { 'cpp': 'CPlusPlus fg-sky-400', 'hpp': 'CPlusPlus fg-fuchsia-500' } },\r\n 'CSS': { ext: 'css', icon: 'Hash fg-blue-700' },\r\n 'CMake': { ext: 'cmake', singleLineCommentToken: '#', blockComments: false, ignoreCase: true },\r\n 'GLSL': { ext: 'glsl', usePreprocessor: true },\r\n 'WGSL': { ext: 'wgsl', usePreprocessor: true },\r\n 'JSON': { ext: 'json', blockComments: false, singleLineComments: false, icon: 'Json fg-yellow-400' },\r\n 'XML': { ext: 'xml', tags: true, icon: 'Rss fg-orange-500' },\r\n 'Rust': { ext: 'rs', icon: 'Rust fg-primary' },\r\n 'Python': { ext: 'py', singleLineCommentToken: '#', icon: 'Python fg-cyan-600' },\r\n 'HTML': { ext: 'html', tags: true, singleLineComments: false, blockCommentsTokens: [ '<!--', '-->' ],\r\n numbers: false, icon: 'Code fg-orange-500' },\r\n 'Batch': { ext: 'bat', blockComments: false, singleLineCommentToken: '::', ignoreCase: true,\r\n icon: 'Windows fg-blue-400' },\r\n 'Markdown': { ext: 'md', blockComments: false, singleLineCommentToken: '::', tags: true, numbers: false,\r\n icon: 'Markdown fg-primary' },\r\n 'PHP': { ext: 'php', icon: 'Php fg-purple-700' }\r\n};\r\n\r\nCE.nativeTypes = {\r\n 'C++': [ 'int', 'float', 'double', 'bool', 'long', 'short', 'char', 'wchar_t', 'void' ],\r\n 'WGSL': [ 'bool', 'u32', 'i32', 'f16', 'f32', 'vec2', 'vec3', 'vec4', 'vec2f', 'vec3f', 'vec4f', 'mat2x2f',\r\n 'mat3x3f', 'mat4x4f', 'array', 'vec2u', 'vec3u', 'vec4u', 'ptr', 'sampler' ]\r\n};\r\n\r\nCE.declarationKeywords = {\r\n 'JavaScript': [ 'var', 'let', 'const', 'this', 'static', 'class' ],\r\n 'C++': [ ...CE.nativeTypes['C++'], 'const', 'auto', 'class', 'struct', 'namespace', 'enum', 'extern' ]\r\n};\r\n\r\nCE.keywords = {\r\n 'JavaScript': [ 'var', 'let', 'const', 'this', 'in', 'of', 'true', 'false', 'new', 'function', 'NaN', 'static',\r\n 'class', 'constructor', 'null', 'typeof', 'debugger', 'abstract', 'arguments', 'extends', 'instanceof',\r\n 'Infinity', 'get' ],\r\n 'TypeScript': [ 'var', 'let', 'const', 'this', 'in', 'of', 'true', 'false', 'new', 'function', 'class', 'extends',\r\n 'instanceof', 'Infinity', 'private', 'public', 'protected', 'interface', 'enum', 'type', 'get' ],\r\n 'C': [ 'int', 'float', 'double', 'long', 'short', 'char', 'const', 'void', 'true', 'false', 'auto', 'struct',\r\n 'typedef', 'signed', 'volatile', 'unsigned', 'static', 'extern', 'enum', 'register', 'union' ],\r\n 'C++': [ ...CE.nativeTypes['C++'], 'const', 'static_cast', 'dynamic_cast', 'new', 'delete', 'true', 'false', 'auto',\r\n 'class', 'struct', 'typedef', 'nullptr', 'NULL', 'signed', 'unsigned', 'namespace', 'enum', 'extern', 'union',\r\n 'sizeof', 'static', 'private', 'public' ],\r\n 'CMake': [ 'cmake_minimum_required', 'set', 'not', 'if', 'endif', 'exists', 'string', 'strequal', 'add_definitions',\r\n 'macro', 'endmacro', 'file', 'list', 'source_group', 'add_executable', 'target_include_directories',\r\n 'set_target_properties', 'set_property', 'add_compile_options', 'add_link_options', 'include_directories',\r\n 'add_library', 'target_link_libraries', 'target_link_options', 'add_subdirectory', 'add_compile_definitions',\r\n 'project', 'cache' ],\r\n 'JSON': [ 'true', 'false' ],\r\n 'GLSL': [ 'true', 'false', 'function', 'int', 'float', 'vec2', 'vec3', 'vec4', 'mat2x2', 'mat3x3', 'mat4x4',\r\n 'struct' ],\r\n 'CSS': [ 'body', 'html', 'canvas', 'div', 'input', 'span', '.', 'table', 'tr', 'td', 'th', 'label', 'video', 'img',\r\n 'code', 'button', 'select', 'option', 'svg', 'media', 'all', 'i', 'a', 'li', 'h1', 'h2', 'h3', 'h4', 'h5',\r\n 'last-child', 'tbody', 'pre', 'monospace', 'font-face' ],\r\n 'WGSL': [ ...CE.nativeTypes['WGSL'], 'var', 'let', 'true', 'false', 'fn', 'atomic', 'struct', 'sampler_comparison',\r\n 'texture_depth_2d', 'texture_depth_2d_array', 'texture_depth_cube', 'texture_depth_cube_array',\r\n 'texture_depth_multisampled_2d', 'texture_external', 'texture_1d', 'texture_2d', 'texture_2d_array',\r\n 'texture_3d', 'texture_cube', 'texture_cube_array', 'texture_storage_1d', 'texture_storage_2d',\r\n 'texture_storage_2d_array', 'texture_storage_3d' ],\r\n 'Rust': [ 'as', 'const', 'crate', 'enum', 'extern', 'false', 'fn', 'impl', 'in', 'let', 'mod', 'move', 'mut', 'pub',\r\n 'ref', 'self', 'Self', 'static', 'struct', 'super', 'trait', 'true', 'type', 'unsafe', 'use', 'where',\r\n 'abstract', 'become', 'box', 'final', 'macro', 'override', 'priv', 'typeof', 'unsized', 'virtual' ],\r\n 'Python': [ 'False', 'def', 'None', 'True', 'in', 'is', 'and', 'lambda', 'nonlocal', 'not', 'or' ],\r\n 'Batch': [ 'set', 'echo', 'off', 'del', 'defined', 'setlocal', 'enabledelayedexpansion', 'driverquery', 'print' ],\r\n 'HTML': [ 'html', 'meta', 'title', 'link', 'script', 'body', 'DOCTYPE', 'head', 'br', 'i', 'a', 'li', 'img', 'tr',\r\n 'td', 'h1', 'h2', 'h3', 'h4', 'h5' ],\r\n 'Markdown': [ 'br', 'i', 'a', 'li', 'img', 'table', 'title', 'tr', 'td', 'h1', 'h2', 'h3', 'h4', 'h5' ],\r\n 'PHP': [ 'const', 'function', 'array', 'new', 'int', 'string', '$this', 'public', 'null', 'private', 'protected',\r\n 'implements', 'class', 'use', 'namespace', 'abstract', 'clone', 'final', 'enum' ]\r\n};\r\n\r\n// These ones don't have hightlight, used as suggestions to autocomplete only...\r\nCE.utils = {\r\n 'JavaScript': [ 'querySelector', 'body', 'addEventListener', 'removeEventListener', 'remove', 'sort', 'keys',\r\n 'filter', 'isNaN', 'parseFloat', 'parseInt', 'EPSILON', 'isFinite', 'bind', 'prototype', 'length', 'assign',\r\n 'entries', 'values', 'concat', 'substring', 'substr', 'splice', 'slice', 'buffer', 'appendChild',\r\n 'createElement', 'prompt', 'alert' ],\r\n 'WGSL': [ 'textureSample' ],\r\n 'Python': [ 'abs', 'all', 'any', 'ascii', 'bin', 'bool', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod',\r\n 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'exec', 'filter', 'float',\r\n 'format', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'int',\r\n 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next',\r\n 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property', 'range', 'repr', 'reversed', 'round', 'set',\r\n 'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars', 'zip' ],\r\n 'CSS': [ ...Object.keys( document.body.style ).map( LX.toKebabCase ), 'block', 'inline', 'inline-block', 'flex',\r\n 'grid', 'none', 'inherit', 'initial', 'unset', 'revert', 'sticky', 'relative', 'absolute', 'fixed', 'static',\r\n 'auto', 'visible', 'hidden', 'scroll', 'clip', 'ellipsis', 'nowrap', 'wrap', 'break-word', 'solid', 'dashed',\r\n 'dotted', 'double', 'groove', 'ridge', 'inset', 'outset', 'left', 'right', 'center', 'top', 'bottom', 'start',\r\n 'end', 'justify', 'stretch', 'space-between', 'space-around', 'space-evenly', 'baseline', 'middle', 'normal',\r\n 'bold', 'lighter', 'bolder', 'italic', 'blur', 'uppercase', 'lowercase', 'capitalize', 'transparent',\r\n 'currentColor', 'pointer', 'default', 'move', 'grab', 'grabbing', 'not-allowed', 'none', 'cover', 'contain',\r\n 'repeat', 'no-repeat', 'repeat-x', 'repeat-y', 'round', 'space', 'linear-gradient', 'radial-gradient',\r\n 'conic-gradient', 'url', 'calc', 'min', 'max', 'clamp', 'red', 'blue', 'green', 'black', 'white', 'gray',\r\n 'silver', 'yellow', 'orange', 'purple', 'pink', 'cyan', 'magenta', 'lime', 'teal', 'navy', 'transparent',\r\n 'currentcolor', 'inherit', 'initial', 'unset', 'revert', 'none', 'auto', 'fit-content', 'min-content',\r\n 'max-content' ]\r\n};\r\n\r\nCE.types = {\r\n 'JavaScript': [ 'Object', 'String', 'Function', 'Boolean', 'Symbol', 'Error', 'Number', 'TextEncoder',\r\n 'TextDecoder', 'Array', 'ArrayBuffer', 'InputEvent', 'MouseEvent', 'Int8Array', 'Int16Array', 'Int32Array',\r\n 'Float32Array', 'Float64Array', 'Element' ],\r\n 'TypeScript': [ 'arguments', 'constructor', 'null', 'typeof', 'debugger', 'abstract', 'Object', 'string', 'String',\r\n 'Function', 'Boolean', 'boolean', 'Error', 'Number', 'number', 'TextEncoder', 'TextDecoder', 'Array',\r\n 'ArrayBuffer', 'InputEvent', 'MouseEvent', 'Int8Array', 'Int16Array', 'Int32Array', 'Float32Array',\r\n 'Float64Array', 'Element', 'bigint', 'unknown', 'any', 'Record' ],\r\n 'Rust': [ 'u128' ],\r\n 'Python': [ 'int', 'type', 'float', 'map', 'list', 'ArithmeticError', 'AssertionError', 'AttributeError',\r\n 'Exception', 'EOFError', 'FloatingPointError', 'GeneratorExit', 'ImportError', 'IndentationError', 'IndexError',\r\n 'KeyError', 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'NameError', 'NotImplementedError', 'OSError',\r\n 'OverflowError', 'ReferenceError', 'RuntimeError', 'StopIteration', 'SyntaxError', 'TabError', 'SystemError',\r\n 'SystemExit', 'TypeError', 'UnboundLocalError', 'UnicodeError', 'UnicodeEncodeError', 'UnicodeDecodeError',\r\n 'UnicodeTranslateError', 'ValueError', 'ZeroDivisionError' ],\r\n 'C++': [ 'uint8_t', 'uint16_t', 'uint32_t' ],\r\n 'PHP': [ 'Exception', 'DateTime', 'JsonSerializable' ]\r\n};\r\n\r\nCE.builtIn = {\r\n 'JavaScript': [ 'document', 'console', 'window', 'navigator', 'performance' ],\r\n 'CSS': [ '*', '!important' ],\r\n 'C++': [ 'vector', 'list', 'map' ],\r\n 'WGSL': [ '@vertex', '@fragment' ],\r\n 'HTML': [ 'type', 'xmlns', 'PUBLIC', 'http-equiv', 'src', 'style', 'lang', 'href', 'rel', 'content', 'xml', 'alt' ], // attributes\r\n 'Markdown': [ 'type', 'src', 'style', 'lang', 'href', 'rel', 'content', 'valign', 'alt' ], // attributes\r\n 'PHP': [ 'echo', 'print' ]\r\n};\r\n\r\nCE.statements = {\r\n 'JavaScript': [ 'for', 'if', 'else', 'case', 'switch', 'return', 'while', 'continue', 'break', 'do', 'import',\r\n 'default', 'export', 'from', 'throw', 'async', 'try', 'catch', 'await', 'as' ],\r\n 'TypeScript': [ 'for', 'if', 'else', 'case', 'switch', 'return', 'while', 'continue', 'break', 'do', 'import',\r\n 'default', 'export', 'from', 'throw', 'async', 'try', 'catch', 'await', 'as' ],\r\n 'CSS': [ '@', 'import' ],\r\n 'C': [ 'for', 'if', 'else', 'return', 'continue', 'break', 'case', 'switch', 'while', 'using', 'default', 'goto',\r\n 'do' ],\r\n 'C++': [ 'std', 'for', 'if', 'else', 'return', 'continue', 'break', 'case', 'switch', 'while', 'using', 'glm',\r\n 'spdlog', 'default' ],\r\n 'GLSL': [ 'for', 'if', 'else', 'return', 'continue', 'break' ],\r\n 'WGSL': [ 'const', 'for', 'if', 'else', 'return', 'continue', 'break', 'storage', 'read', 'read_write', 'uniform',\r\n 'function', 'workgroup', 'bitcast' ],\r\n 'Rust': [ 'break', 'else', 'continue', 'for', 'if', 'loop', 'match', 'return', 'while', 'do', 'yield' ],\r\n 'Python': [ 'if', 'raise', 'del', 'import', 'return', 'elif', 'try', 'else', 'while', 'as', 'except', 'with',\r\n 'assert', 'finally', 'yield', 'break', 'for', 'class', 'continue', 'global', 'pass', 'from' ],\r\n 'Batch': [ 'if', 'IF', 'for', 'FOR', 'in', 'IN', 'do', 'DO', 'call', 'CALL', 'goto', 'GOTO', 'exit', 'EXIT' ],\r\n 'PHP': [ 'declare', 'enddeclare', 'foreach', 'endforeach', 'if', 'else', 'elseif', 'endif', 'for', 'endfor',\r\n 'while', 'endwhile', 'switch', 'case', 'default', 'endswitch', 'return', 'break', 'continue', 'try', 'catch',\r\n 'die', 'do', 'exit', 'finally' ]\r\n};\r\n\r\nCE.symbols = {\r\n 'JavaScript': [ '<', '>', '[', ']', '{', '}', '(', ')', ';', '=', '|', '||', '&', '&&', '?', '??' ],\r\n 'TypeScript': [ '<', '>', '[', ']', '{', '}', '(', ')', ';', '=', '|', '||', '&', '&&', '?', '??' ],\r\n 'C': [ '<', '>', '[', ']', '{', '}', '(', ')', ';', '=', '|', '||', '&', '&&', '?', '*', '-', '+' ],\r\n 'C++': [ '<', '>', '[', ']', '{', '}', '(', ')', ';', '=', '|', '||', '&', '&&', '?', '::', '*', '-', '+' ],\r\n 'CMake': [ '{', '}' ],\r\n 'JSON': [ '[', ']', '{', '}', '(', ')' ],\r\n 'GLSL': [ '[', ']', '{', '}', '(', ')' ],\r\n 'WGSL': [ '[', ']', '{', '}', '(', ')', '->' ],\r\n 'CSS': [ '{', '}', '(', ')', '*' ],\r\n 'Rust': [ '<', '>', '[', ']', '(', ')', '=' ],\r\n 'Python': [ '<', '>', '[', ']', '(', ')', '=' ],\r\n 'Batch': [ '[', ']', '(', ')', '%' ],\r\n 'HTML': [ '<', '>', '/' ],\r\n 'XML': [ '<', '>', '/' ],\r\n 'PHP': [ '[', ']', '{', '}', '(', ')' ]\r\n};\r\n\r\nCE.REGISTER_LANGUAGE = function( name: string, options: any = {}, def: any, rules?: any[] )\r\n{\r\n CE.languages[name] = options;\r\n\r\n if ( def?.keywords ) CE.keywords[name] = new Set( def.keywords );\r\n if ( def?.utils ) CE.utils[name] = new Set( def.utils );\r\n if ( def?.types ) CE.types[name] = new Set( def.types );\r\n if ( def?.builtIn ) CE.builtIn[name] = new Set( def.builtIn );\r\n if ( def?.statements ) CE.statements[name] = new Set( def.statements );\r\n if ( def?.symbols ) CE.symbols[name] = new Set( def.symbols );\r\n\r\n if ( rules ) HighlightRules[name] = rules;\r\n};\r\n\r\nLX.CodeEditor = CodeEditor;\r\n"],"names":[],"mappings":";;;AAAA;AAIA,IAAK,CAAC,EAAE,EACR;IACI,OAAQ,uBAAuB;AACnC;AAEA,EAAE,CAAC,UAAU,CAAC,IAAI,CAAE,YAAY,CAAE;AAElC,MAAM,CAAC,GAAG,UAAiB;AACd,EAAE,CAAC;AACH,EAAE,CAAC;AACF,EAAE,CAAC;AACJ,EAAE,CAAC;AACH,EAAE,CAAC;AACI,EAAE,CAAC;AAEvB,SAAS,YAAY,CAAE,GAAQ,EAAE,CAAS,EAAE,CAAS,EAAA;IAEjD,CAAE,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAE,GAAG,CAAE,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAE;AAC3C;AACA,SAAS,iBAAiB,CAAE,KAAe,EAAE,GAAW,EAAE,GAAW,EAAA;IAEjE,CAAE,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAE,GAAG,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ditor.js","sources":["../../src/extensions/CodeEditor.ts"],"sourcesContent":["// CodeEditor.ts @jxarco\r\n\r\nimport { LX } from '../core/Namespace';\r\n\r\nif ( !LX )\r\n{\r\n throw ( 'Missing LX namespace!' );\r\n}\r\n\r\nLX.extensions.push( 'CodeEditor' );\r\n\r\nconst g = globalThis as any;\r\nconst vec2 = LX.vec2;\r\nconst Area = LX.Area;\r\nconst Panel = LX.Panel;\r\nconst Tree = LX.Tree;\r\nconst Tabs = LX.Tabs;\r\nconst ContextMenu = LX.ContextMenu;\r\n\r\nfunction swapElements( obj: any, a: string, b: string )\r\n{\r\n [ obj[a], obj[b] ] = [ obj[b], obj[a] ];\r\n}\r\nfunction swapArrayElements( array: number[], id0: number, id1: number )\r\n{\r\n [ array[id0], array[id1] ] = [ array[id1], array[id0] ];\r\n}\r\nfunction sliceChars( str: string, idx: number, n: number = 1 )\r\n{\r\n return str.substr( 0, idx ) + str.substr( idx + n );\r\n}\r\nfunction firstNonspaceIndex( str: string )\r\n{\r\n const index = str.search( /\\S|$/ );\r\n return index < str.length ? index : -1;\r\n}\r\nfunction strReverse( str: string )\r\n{\r\n return str.split( '' ).reverse().join( '' );\r\n}\r\nfunction isLetter( c: string )\r\n{\r\n return /[a-zA-Z]/.test( c );\r\n}\r\nfunction isSymbol( c: string )\r\n{\r\n return /[^\\w\\s]/.test( c );\r\n}\r\n\r\nfunction indexOfFrom( str: string, reg: string, from?: number, reverse: boolean = false )\r\n{\r\n from = from ?? 0;\r\n\r\n if ( reverse )\r\n {\r\n str = str.substring( 0, from );\r\n var k = from - 1;\r\n while ( str[k] && str[k] != reg )\r\n {\r\n k--;\r\n }\r\n return str[k] ? k : -1;\r\n }\r\n else\r\n {\r\n str = str.substring( from );\r\n return from + str.indexOf( reg );\r\n }\r\n}\r\n\r\nfunction codeScopesEqual( a: any, b: any )\r\n{\r\n if ( a.length !== b.length ) return false;\r\n for ( let i = 0; i < a.length; i++ )\r\n {\r\n if ( a[i].type !== b[i].type ) return false;\r\n }\r\n return true;\r\n}\r\n\r\nclass Cursor\r\n{\r\n root: any;\r\n name: string = '';\r\n editor: CodeEditor;\r\n isMain: boolean = false;\r\n selection: CodeSelection | null = null;\r\n\r\n private _line: number = 0;\r\n private _position: number = 0;\r\n\r\n get line(): number\r\n {\r\n return this._line;\r\n }\r\n set line( v: number )\r\n {\r\n this._line = v;\r\n if ( this.isMain ) this.editor._setActiveLine( v );\r\n }\r\n\r\n get position(): number\r\n {\r\n return this._position;\r\n }\r\n set position( v: number )\r\n {\r\n this._position = v;\r\n if ( this.isMain )\r\n {\r\n const activeLine = this.editor.state.activeLine;\r\n this.editor._updateDataInfoPanel( '@cursor-data', `Ln ${activeLine + 1}, Col ${v + 1}` );\r\n }\r\n }\r\n\r\n left: number = 0;\r\n top: number = 0;\r\n\r\n constructor( name: string, position: number = 0, line: number = 0, isMain: boolean = false, editor: CodeEditor )\r\n {\r\n this.name = name;\r\n this.editor = editor;\r\n this.isMain = isMain;\r\n\r\n this.root = document.createElement( 'div' );\r\n this.root.name = name;\r\n this.root.className = 'cursor';\r\n this.root.innerHTML = ' ';\r\n\r\n this.set( position, line, false );\r\n }\r\n\r\n set( position: number = 0, line: number = 0, updateEditor: boolean = true )\r\n {\r\n this.left = position * this.editor.charWidth;\r\n this.top = line * this.editor.lineHeight;\r\n this.root.style.left = `calc( ${this.left}px + ${this.editor.xPadding} )`;\r\n this.root.style.top = `${this.top}px`;\r\n\r\n if ( updateEditor )\r\n {\r\n this.line = line;\r\n this.position = position;\r\n }\r\n else\r\n {\r\n this._line = line;\r\n this._position = position;\r\n }\r\n }\r\n\r\n print()\r\n {\r\n console.log( this.line, this.position );\r\n }\r\n\r\n destroy()\r\n {\r\n LX.deleteElement( this.root );\r\n }\r\n\r\n isLast(): boolean\r\n {\r\n return ( this.editor._getLastCursor() == this );\r\n }\r\n}\r\n\r\nclass CodeSelection\r\n{\r\n fromX: number;\r\n toX: number;\r\n fromY: number;\r\n toY: number;\r\n chars: number = 0;\r\n\r\n editor: CodeEditor;\r\n cursor: Cursor;\r\n className: string;\r\n\r\n constructor( editor: CodeEditor, cursor: Cursor, className: string = 'lexcodeselection' )\r\n {\r\n this.editor = editor;\r\n this.cursor = cursor;\r\n this.className = className;\r\n\r\n this.fromX = cursor.position;\r\n this.toX = cursor.position;\r\n this.fromY = cursor.line;\r\n this.toY = cursor.line;\r\n }\r\n\r\n sameLine()\r\n {\r\n return this.fromY === this.toY;\r\n }\r\n\r\n samePosition()\r\n {\r\n return this.fromX === this.toX;\r\n }\r\n\r\n isEmpty()\r\n {\r\n return this.sameLine() && this.samePosition();\r\n }\r\n\r\n invertIfNecessary()\r\n {\r\n if ( this.fromY > this.toY )\r\n {\r\n swapElements( this, 'fromX', 'toX' );\r\n swapElements( this, 'fromY', 'toY' );\r\n }\r\n else if ( this.sameLine() && this.fromX > this.toX )\r\n {\r\n swapElements( this, 'fromX', 'toX' );\r\n }\r\n }\r\n\r\n selectInline( cursor: Cursor, x: number, y: number, width: number, isSearchResult?: boolean )\r\n {\r\n this.chars = width / this.editor.charWidth;\r\n this.fromX = x;\r\n this.toX = x + this.chars;\r\n this.fromY = this.toY = y;\r\n\r\n var domEl: any = document.createElement( 'div' );\r\n domEl.className = this.className;\r\n domEl._top = y * this.editor.lineHeight;\r\n domEl.style.top = domEl._top + 'px';\r\n domEl._left = x * this.editor.charWidth;\r\n domEl.style.left = 'calc(' + domEl._left + 'px + ' + this.editor.xPadding + ')';\r\n domEl.style.width = width + 'px';\r\n\r\n if ( isSearchResult )\r\n {\r\n this.editor.searchResultSelections.appendChild( domEl );\r\n }\r\n else\r\n {\r\n this.editor.selections[cursor.name].appendChild( domEl );\r\n }\r\n\r\n // Hide active line background\r\n this.editor._hideActiveLine();\r\n }\r\n\r\n save()\r\n {\r\n return {\r\n fromX: this.fromX,\r\n fromY: this.fromY,\r\n toX: this.toX,\r\n toY: this.toY\r\n };\r\n }\r\n\r\n load( data: any )\r\n {\r\n this.fromX = data.fromX;\r\n this.fromY = data.fromY;\r\n this.toX = data.toX;\r\n this.toY = data.toY;\r\n }\r\n\r\n getText()\r\n {\r\n if ( !this.editor.code || !this.sameLine() )\r\n {\r\n return null;\r\n }\r\n\r\n return this.editor.code.lines[this.fromY].substring( this.fromX, this.toX );\r\n }\r\n}\r\n\r\nclass ScrollBar\r\n{\r\n static SCROLLBAR_VERTICAL = 1;\r\n static SCROLLBAR_HORIZONTAL = 2;\r\n\r\n static SCROLLBAR_VERTICAL_WIDTH = 10;\r\n static SCROLLBAR_HORIZONTAL_HEIGHT = 10;\r\n\r\n editor: CodeEditor;\r\n type: number;\r\n root: any;\r\n thumb: any;\r\n lastPosition: typeof vec2;\r\n\r\n constructor( editor: CodeEditor, type: number )\r\n {\r\n this.editor = editor;\r\n this.type = type;\r\n\r\n this.root = document.createElement( 'div' );\r\n this.root.className = 'lexcodescrollbar hidden';\r\n\r\n if ( type & ScrollBar.SCROLLBAR_VERTICAL )\r\n {\r\n this.root.classList.add( 'vertical' );\r\n }\r\n else if ( type & ScrollBar.SCROLLBAR_HORIZONTAL )\r\n {\r\n this.root.classList.add( 'horizontal' );\r\n }\r\n\r\n this.thumb = document.createElement( 'div' );\r\n this.thumb._top = 0;\r\n this.thumb._left = 0;\r\n\r\n this.root.appendChild( this.thumb );\r\n\r\n this.thumb.addEventListener( 'mousedown', inner_mousedown );\r\n\r\n this.lastPosition = new LX.vec2( 0, 0 );\r\n\r\n let that = this;\r\n\r\n function inner_mousedown( e: MouseEvent )\r\n {\r\n var doc = editor.root.ownerDocument;\r\n doc.addEventListener( 'mousemove', inner_mousemove );\r\n doc.addEventListener( 'mouseup', inner_mouseup );\r\n that.lastPosition.set( e.x, e.y );\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n\r\n function inner_mousemove( e: MouseEvent )\r\n {\r\n var dt = that.lastPosition.sub( new LX.vec2( e.x, e.y ) );\r\n if ( that.type & ScrollBar.SCROLLBAR_VERTICAL )\r\n {\r\n editor.updateVerticalScrollFromScrollBar( dt.y );\r\n }\r\n else\r\n {\r\n editor.updateHorizontalScrollFromScrollBar( dt.x );\r\n }\r\n that.lastPosition.set( e.x, e.y );\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n\r\n function inner_mouseup( e: MouseEvent )\r\n {\r\n var doc = editor.root.ownerDocument;\r\n doc.removeEventListener( 'mousemove', inner_mousemove );\r\n doc.removeEventListener( 'mouseup', inner_mouseup );\r\n }\r\n }\r\n}\r\n\r\n/* Highlight rules\r\n- test: function that receives a context object and returns true or false\r\n- className: class to apply if test is true\r\n- action: optional function to execute if test is true, receives context and editor as parameter\r\n- discard: optional boolean, if true the token is discarded, action value is returned\r\n to \"ctx.discardToken\" and no class is applied\r\n*/\r\n\r\nconst HighlightRules: Record<string, any> = {\r\n common: [\r\n { test: ( ctx: any ) => ctx.inBlockComment, className: 'cm-com' },\r\n { test: ( ctx: any ) => ctx.inString, action: ( ctx: any, editor: CodeEditor ) => editor._appendStringToken( ctx.token ), discard: true },\r\n { test: ( ctx: any ) => ctx.token.substr( 0, ctx.singleLineCommentToken.length ) == ctx.singleLineCommentToken, className: 'cm-com' },\r\n { test: ( ctx: any, editor: CodeEditor ) => editor._isKeyword( ctx ), className: 'cm-kwd' },\r\n {\r\n test: ( ctx: any, editor: CodeEditor ) =>\r\n editor._mustHightlightWord( ctx.token, CE.builtIn, ctx.lang ) && ( ctx.lang.tags ?? false\r\n ? ( editor._enclosedByTokens( ctx.token, ctx.tokenIndex, '<', '>' ) )\r\n : true ),\r\n className: 'cm-bln'\r\n },\r\n { test: ( ctx: any, editor: CodeEditor ) => editor._mustHightlightWord( ctx.token, CE.statements, ctx.lang ), className: 'cm-std' },\r\n { test: ( ctx: any, editor: CodeEditor ) => editor._mustHightlightWord( ctx.token, CE.symbols, ctx.lang ), className: 'cm-sym' },\r\n { test: ( ctx: any, editor: CodeEditor ) => editor._mustHightlightWord( ctx.token, CE.types, ctx.lang ), className: 'cm-typ' },\r\n {\r\n test: ( ctx: any, editor: CodeEditor ) => editor._isNumber( ctx.token ) || editor._isNumber( ctx.token.replace( /[px]|[em]|%/g, '' ) ),\r\n className: 'cm-dec'\r\n },\r\n { test: ( ctx: any ) => ctx.lang.usePreprocessor && ctx.token.includes( '#' ), className: 'cm-ppc' }\r\n ],\r\n\r\n javascript: [\r\n { test: ( ctx: any ) => ( ctx.prev === 'class' && ctx.next === '{' ), className: 'cm-typ' }\r\n ],\r\n\r\n typescript: [\r\n { test: ( ctx: any ) => ctx.scope && ( ctx.token !== ',' && ctx.scope.type == 'enum' ), className: 'cm-enu' },\r\n {\r\n test: ( ctx: any ) =>\r\n ( ctx.prev === ':' && ctx.next !== undefined && isLetter( ctx.token ) )\r\n || ( ctx.prev === 'interface' && ctx.next === '{' ) || ( ctx.prev === 'enum' && ctx.next === '{' ),\r\n className: 'cm-typ'\r\n },\r\n {\r\n test: ( ctx: any ) =>\r\n ( ctx.prev === 'class' && ctx.next === '{' ) || ( ctx.prev === 'class' && ctx.next === '<' )\r\n || ( ctx.prev === 'new' && ctx.next === '(' ) || ( ctx.prev === 'new' && ctx.next === '<' ),\r\n className: 'cm-typ'\r\n },\r\n {\r\n test: ( ctx: any, editor: CodeEditor ) => ctx.token !== ',' && editor._enclosedByTokens( ctx.token, ctx.tokenIndex, '<', '>' ),\r\n className: 'cm-typ'\r\n }\r\n ],\r\n\r\n cpp: [\r\n { test: ( ctx: any ) => ctx.scope && ( ctx.token !== ',' && ctx.scope.type == 'enum' ), className: 'cm-enu' },\r\n { test: ( ctx: any ) => ctx.isEnumValueSymbol( ctx.token ), className: 'cm-enu' },\r\n {\r\n test: ( ctx: any ) => ( ctx.prev === 'class' && ctx.next === '{' ) || ( ctx.prev === 'struct' && ctx.next === '{' ),\r\n className: 'cm-typ'\r\n },\r\n { test: ( ctx: any ) => ctx.prev === '<' && ( ctx.next === '>' || ctx.next === '*' ), className: 'cm-typ' }, // Defining template type in C++\r\n { test: ( ctx: any ) => ctx.next === '::' || ( ctx.prev === '::' && ctx.next !== '(' ), className: 'cm-typ' }, // C++ Class\r\n { test: ( ctx: any ) => ctx.isClassSymbol( ctx.token ) || ctx.isStructSymbol( ctx.token ), className: 'cm-typ' }\r\n ],\r\n\r\n wgsl: [\r\n { test: ( ctx: any ) => ctx.prev === '>' && ( !ctx.next || ctx.next === '{' ), className: 'cm-typ' }, // Function return type\r\n {\r\n test: ( ctx: any ) => ( ctx.prev === ':' && ctx.next !== undefined ) || ( ctx.prev === 'struct' && ctx.next === '{' ),\r\n className: 'cm-typ'\r\n },\r\n {\r\n test: ( ctx: any, editor: CodeEditor ) => ctx.token !== ',' && editor._enclosedByTokens( ctx.token, ctx.tokenIndex, '<', '>' ),\r\n className: 'cm-typ'\r\n }\r\n ],\r\n\r\n css: [\r\n {\r\n test: (\r\n ctx: any\r\n ) => ( ctx.prev == '.' || ctx.prev == '::' || ( ctx.prev == ':' && ctx.next == '{' )\r\n || ( ctx.token[0] == '#' && ctx.prev != ':' ) ),\r\n className: 'cm-kwd'\r\n },\r\n { test: ( ctx: any ) => ctx.prev === ':' && ( ctx.next === ';' || ctx.next === '!important' ), className: 'cm-str' }, // CSS value\r\n { test: ( ctx: any ) => ( ctx.prev === undefined || ctx.prev === '{' || ctx.prev === ';' ) && ctx.next === ':', className: 'cm-typ' }, // CSS attribute\r\n { test: ( ctx: any ) => ctx.prev === '(' && ctx.next === ')' && ctx.token.startsWith( '--' ), className: 'cm-typ' } // CSS vars\r\n ],\r\n\r\n batch: [\r\n { test: ( ctx: any ) => ctx.token === '@' || ctx.prev === ':' || ctx.prev === '@', className: 'cm-kwd' }\r\n ],\r\n\r\n markdown: [\r\n { test: ( ctx: any ) => ctx.isFirstToken && ctx.token.replaceAll( '#', '' ).length != ctx.token.length,\r\n action: ( ctx: any, editor: CodeEditor ) => editor._markdownHeader = true, className: 'cm-kwd' }\r\n ],\r\n\r\n php: [\r\n { test: ( ctx: any ) => ctx.token.startsWith( '$' ), className: 'cm-var' },\r\n {\r\n test: ( ctx: any ) =>\r\n ( ctx.prev === 'class' && ( ctx.next === '{' || ctx.next === 'implements' ) )\r\n || ( ctx.prev === 'enum' ),\r\n className: 'cm-typ'\r\n }\r\n ],\r\n\r\n post_common: [\r\n {\r\n test: ( ctx: any ) => isLetter( ctx.token ) && ( ctx.token[0] != '@' ) && ( ctx.token[0] != ',' ) && ( ctx.next === '(' ),\r\n className: 'cm-mtd'\r\n }\r\n ]\r\n};\r\n\r\n/**\r\n * @class CodeEditor\r\n */\r\n\r\nexport class CodeEditor\r\n{\r\n static __instances: CodeEditor[] = [];\r\n\r\n static CURSOR_LEFT = 1;\r\n static CURSOR_TOP = 2;\r\n static CURSOR_LEFT_TOP = CodeEditor.CURSOR_LEFT | CodeEditor.CURSOR_TOP;\r\n\r\n static SELECTION_X = 1;\r\n static SELECTION_Y = 2;\r\n static SELECTION_X_Y = CodeEditor.SELECTION_X | CodeEditor.SELECTION_Y;\r\n\r\n static KEEP_VISIBLE_LINES = 1;\r\n static UPDATE_VISIBLE_LINES = 2;\r\n\r\n static WORD_TYPE_METHOD = 0;\r\n static WORD_TYPE_CLASS = 1;\r\n\r\n static CODE_MIN_FONT_SIZE = 9;\r\n static CODE_MAX_FONT_SIZE = 22;\r\n\r\n static LINE_GUTTER_WIDTH = 48;\r\n\r\n static RESIZE_SCROLLBAR_H = 1;\r\n static RESIZE_SCROLLBAR_V = 2;\r\n static RESIZE_SCROLLBAR_H_V = CodeEditor.RESIZE_SCROLLBAR_H | CodeEditor.RESIZE_SCROLLBAR_V;\r\n\r\n static languages: Record<string, any> = {};\r\n static keywords: any;\r\n static utils: any;\r\n static types: any;\r\n static builtIn: any;\r\n static statements: any;\r\n static declarationKeywords: any;\r\n static symbols: any;\r\n static nativeTypes: any;\r\n\r\n static debugScopes: boolean = false;\r\n static debugSymbols: boolean = false;\r\n static debugProcessedLines: boolean = false;\r\n\r\n static _staticReady: boolean = false;\r\n\r\n // Layout\r\n root: any;\r\n baseArea: typeof Area;\r\n area: typeof Area;\r\n codeArea: typeof Area;\r\n explorerArea: any;\r\n code: any;\r\n gutter!: HTMLElement;\r\n xPadding: string = '0px';\r\n hScrollbar!: ScrollBar;\r\n vScrollbar!: ScrollBar;\r\n codeScroller: any;\r\n codeSizer: any;\r\n explorer: typeof Tree;\r\n tabs: typeof Tabs;\r\n cursorsDOM: any;\r\n cursors: Cursor[] = [];\r\n mustProcessLines: boolean = false;\r\n blinker: any;\r\n statusPanel: typeof Panel;\r\n leftStatusPanel: typeof Panel;\r\n rightStatusPanel: typeof Panel;\r\n lineScrollMargin: typeof vec2;\r\n autocomplete!: HTMLElement;\r\n searchbox!: HTMLElement;\r\n searchlinebox!: HTMLElement;\r\n\r\n // Editor\r\n openedTabs: Record<string, any> = {};\r\n loadedTabs: Record<string, any> = {};\r\n actions: Record<string, any> = {};\r\n state!: Record<string, any>;\r\n pairKeys!: Record<string, string>;\r\n stringKeys!: Record<string, string>;\r\n visibleLinesViewport: typeof vec2 = new LX.vec2( 0, 0 );\r\n searchResultSelections: any;\r\n firstLineInViewport: number = -1;\r\n selections: Record<string, any> = {};\r\n specialKeys!: string[];\r\n canOpenContextMenu: boolean = true;\r\n wasKeyPaired: boolean | undefined = undefined;\r\n mustProcessNextLine!: (( s: string[] ) => boolean) | undefined;\r\n mustProcessPreviousLine!: (( s: string[] ) => boolean) | undefined;\r\n\r\n // Code\r\n cursorBlinkRate: number = 550;\r\n tabSpaces: number = 4;\r\n maxUndoSteps: number = 16;\r\n lineHeight: number = 20;\r\n charWidth: number = 7; // To update later depending on size..\r\n fontSize: number = 14;\r\n defaultSingleLineCommentToken: string = '//';\r\n defaultBlockCommentTokens: string[] = [ '/*', '*/' ];\r\n isAutoCompleteActive: boolean = false;\r\n isSearchboxActive: boolean = false;\r\n isSearchlineboxActive: boolean = false;\r\n\r\n // Editor options\r\n skipInfo: boolean = false;\r\n disableEdition: boolean = false;\r\n skipTabs: boolean = false;\r\n useFileExplorer: boolean = false;\r\n useAutoComplete: boolean = true;\r\n allowClosingTabs: boolean = true;\r\n allowLoadingFiles: boolean = true;\r\n highlight: string = 'Plain Text';\r\n explorerName: string = 'EXPLORER';\r\n newTabOptions: any;\r\n customSuggestions: any[] = [];\r\n\r\n // Editor callbacks\r\n onContextMenu: any;\r\n onCreateFile: any;\r\n onCreateStatusPanel: any;\r\n onCtrlSpace: any;\r\n onNewTab: any;\r\n onSave: any;\r\n onSelectTab: any;\r\n onReady: any;\r\n onRun: any;\r\n\r\n // Inner functions\r\n addExplorerItem: any;\r\n\r\n // Internal variables\r\n _blockCommentCache: any[] = [];\r\n _buildingBlockComment: any = undefined;\r\n _buildingString: any = undefined;\r\n _currentOcurrences: any = undefined;\r\n _currentLineNumber: number | undefined = undefined;\r\n _currentLineString: string | undefined = undefined;\r\n _currentTokenPositions: any = undefined;\r\n _discardScroll: boolean = false;\r\n _displayObserver: any = null;\r\n _fullVerticalOffset: number = -1;\r\n _isReady: boolean = false;\r\n _lastTime: any = null;\r\n _lastProcessedLine: number = -1;\r\n _lastResult: any = undefined;\r\n _lastSelectionKeyDir: any = undefined;\r\n _lastProcessedCursorIndex: any = null;\r\n _lastMaxLineLength: number | undefined = undefined;\r\n _lastMouseDown: number = 0;\r\n _lastTextFound: string = '';\r\n _lastBaseareaWidth: number | undefined = undefined;\r\n _markdownHeader: any = undefined;\r\n _mouseDown: boolean | undefined = undefined;\r\n _nextCursorPositionOffset: number | undefined = undefined;\r\n _pendingString: string | undefined = undefined;\r\n _preparedAt: number | undefined = undefined;\r\n _scopeStack: any = null;\r\n _scopesUpdated: boolean | undefined = undefined;\r\n _skipTabs: number | undefined = undefined;\r\n _stringEnded: boolean = false;\r\n _stringInterpolation: boolean | undefined = undefined;\r\n _stringInterpolationOpened: boolean | undefined = undefined;\r\n _tabStorage: Record<string, any> = {};\r\n _tripleClickSelection: any = undefined;\r\n _verticalBottomOffset: number = -1;\r\n _verticalTopOffset: number = -1;\r\n\r\n constructor( area: typeof Area, options: any = {} )\r\n {\r\n if ( options.filesAsync )\r\n {\r\n options.files = [ ...options.filesAsync ];\r\n\r\n const instance: any = ( async () => {\r\n await this._init( area, options );\r\n // Constructors return `this` implicitly, but this is an IIFE, so\r\n // return `this` explicitly (else we'd return an empty object).\r\n return this;\r\n } )();\r\n return instance;\r\n }\r\n else\r\n {\r\n this._init( area, options );\r\n }\r\n }\r\n\r\n async _init( area: typeof Area, options: any = {} ): Promise<void>\r\n {\r\n g.editor = this;\r\n\r\n CodeEditor.__instances.push( this );\r\n\r\n this.skipInfo = options.skipInfo ?? this.skipInfo;\r\n this.disableEdition = options.disableEdition ?? this.disableEdition;\r\n this.skipTabs = options.skipTabs ?? this.skipTabs;\r\n this.useFileExplorer = ( options.fileExplorer ?? this.useFileExplorer ) && !this.skipTabs;\r\n this.useAutoComplete = options.autocomplete ?? this.useAutoComplete;\r\n this.allowClosingTabs = options.allowClosingTabs ?? this.allowClosingTabs;\r\n this.allowLoadingFiles = options.allowLoadingFiles ?? this.allowLoadingFiles;\r\n this.highlight = options.highlight ?? this.highlight;\r\n this.newTabOptions = options.newTabOptions;\r\n this.customSuggestions = options.customSuggestions ?? [];\r\n this.explorerName = options.explorerName ?? this.explorerName;\r\n\r\n // Editor callbacks\r\n this.onSave = options.onSave ?? options.onsave; // LEGACY onsave\r\n this.onRun = options.onRun ?? options.onrun; // LEGACY onrun\r\n this.onCtrlSpace = options.onCtrlSpace;\r\n this.onCreateStatusPanel = options.onCreateStatusPanel;\r\n this.onContextMenu = options.onContextMenu;\r\n this.onNewTab = options.onNewTab;\r\n this.onSelectTab = options.onSelectTab;\r\n this.onReady = options.onReady;\r\n\r\n // File explorer\r\n if ( this.useFileExplorer )\r\n {\r\n let [ explorerArea, editorArea ] = area.split( { sizes: [ '15%', '85%' ] } );\r\n // explorerArea.setLimitBox( 180, 20, 512 );\r\n this.explorerArea = explorerArea;\r\n\r\n let panel = new LX.Panel();\r\n\r\n panel.addTitle( this.explorerName );\r\n\r\n let sceneData: any[] = [];\r\n\r\n this.explorer = panel.addTree( null, sceneData, {\r\n filter: false,\r\n rename: false,\r\n skipDefaultIcon: true\r\n } );\r\n\r\n this.explorer.on( \"dblClick\", ( event: any ) => {\r\n const node = event.items[0];\r\n this.loadTab( node.id );\r\n } );\r\n\r\n this.explorer.on( \"delete\", ( event: any ) => {\r\n const node = event.items[0];\r\n this.closeTab( node.id );\r\n } );\r\n\r\n this.addExplorerItem = function( item: any )\r\n {\r\n if ( !this.explorer.innerTree.data.find( ( value: any, index: number ) => value.id === item.id ) )\r\n {\r\n this.explorer.innerTree.data.push( item );\r\n }\r\n };\r\n\r\n explorerArea.attach( panel );\r\n\r\n // Update area\r\n area = editorArea;\r\n }\r\n\r\n this.baseArea = area;\r\n this.area = new LX.Area( { className: 'lexcodeeditor outline-none overflow-hidden size-full select-none bg-inherit', skipAppend: true } );\r\n\r\n if ( !this.skipTabs )\r\n {\r\n this.tabs = this.area.addTabs( { onclose: ( name: string ) => {\r\n delete this.openedTabs[name];\r\n if ( Object.keys( this.openedTabs ).length < 2 )\r\n {\r\n clearInterval( this.blinker );\r\n LX.removeClass( this.cursorsDOM, 'show' );\r\n }\r\n } } );\r\n\r\n LX.addClass( this.tabs.root.parentElement, 'rounded-t-lg' );\r\n\r\n if ( !this.disableEdition )\r\n {\r\n this.tabs.root.parentElement.addEventListener( 'dblclick', ( e: MouseEvent ) => {\r\n if ( options.allowAddScripts ?? true )\r\n {\r\n e.preventDefault();\r\n this._onCreateNewFile();\r\n }\r\n } );\r\n }\r\n\r\n this.codeArea = this.tabs.area;\r\n }\r\n else\r\n {\r\n this.codeArea = new LX.Area( { skipAppend: true } );\r\n this.area.attach( this.codeArea );\r\n const loadFileButton = LX.makeElement( 'button',\r\n 'grid absolute place-self-center z-100 p-3 rounded-full bg-secondary hover:bg-accent cursor-pointer border-color',\r\n LX.makeIcon( 'FolderOpen' ).innerHTML, this.area, {\r\n bottom: '8px'\r\n } );\r\n loadFileButton.addEventListener( 'click', ( e: MouseEvent ) => {\r\n const dropdownOptions = [];\r\n\r\n for ( const [ key, value ] of [ ...Object.entries( this.loadedTabs ).slice( 1 ), ...Object.entries( this._tabStorage ) ] )\r\n {\r\n const icon = this._getFileIcon( key );\r\n const classes = icon ? icon.split( ' ' ) : [];\r\n dropdownOptions.push( {\r\n name: key,\r\n icon: classes[0],\r\n svgClass: classes.slice( 0 ).join( ' ' ),\r\n callback: ( entryName: string ) => {\r\n this.loadCode( entryName );\r\n }\r\n } );\r\n }\r\n\r\n new LX.DropdownMenu( loadFileButton, dropdownOptions, { side: 'top', align: 'center' } );\r\n } );\r\n }\r\n\r\n this.codeArea.root.classList.add( 'lexcodearea', 'scrollbar-hidden' );\r\n\r\n const codeResizeObserver = new ResizeObserver( ( entries ) => {\r\n if ( !this.code )\r\n {\r\n return;\r\n }\r\n\r\n this.resize();\r\n } );\r\n codeResizeObserver.observe( this.codeArea.root );\r\n\r\n // Full editor\r\n area.root.className = LX.mergeClass( area.root.className, 'codebasearea flex relative bg-card' );\r\n\r\n const observer = new MutationObserver( ( e ) => {\r\n if ( e[0].attributeName == 'style' )\r\n {\r\n this.resize();\r\n }\r\n } );\r\n\r\n observer.observe( area.root.parentNode, {\r\n attributes: true,\r\n attributeFilter: [ 'class', 'style' ]\r\n } );\r\n\r\n this.root = this.area.root;\r\n this.root.tabIndex = -1;\r\n area.attach( this.root );\r\n\r\n if ( !this.disableEdition )\r\n {\r\n this.root.addEventListener( 'keydown', this.processKey.bind( this ) );\r\n this.root.addEventListener( 'focus', this.processFocus.bind( this, true ) );\r\n this.root.addEventListener( 'focusout', this.processFocus.bind( this, false ) );\r\n }\r\n else\r\n {\r\n this.root.classList.add( 'disabled' );\r\n }\r\n\r\n this.root.addEventListener( 'mousedown', this.processMouse.bind( this ) );\r\n this.root.addEventListener( 'mouseup', this.processMouse.bind( this ) );\r\n this.root.addEventListener( 'mousemove', this.processMouse.bind( this ) );\r\n this.root.addEventListener( 'click', this.processMouse.bind( this ) );\r\n this.root.addEventListener( 'contextmenu', this.processMouse.bind( this ) );\r\n\r\n // Add mouseup event to document as well to detect when selections end\r\n document.body.addEventListener( 'mouseup', this._onMouseUp.bind( this ) );\r\n\r\n // Cursors and selection\r\n\r\n this.cursorsDOM = document.createElement( 'div' );\r\n this.cursorsDOM.className = 'cursors';\r\n this.codeArea.attach( this.cursorsDOM );\r\n\r\n this.searchResultSelections = document.createElement( 'div' );\r\n this.searchResultSelections.id = 'search-selections';\r\n this.searchResultSelections.className = 'selections';\r\n this.codeArea.attach( this.searchResultSelections );\r\n\r\n // Store here selections per cursor\r\n this.selections = {};\r\n\r\n // Css char synchronization\r\n this.xPadding = CodeEditor.LINE_GUTTER_WIDTH + 'px';\r\n\r\n // Add main cursor\r\n this._addCursor( 0, 0, true, true );\r\n\r\n // Scroll stuff\r\n {\r\n this.codeScroller = this.codeArea.root;\r\n this.firstLineInViewport = 0;\r\n this.lineScrollMargin = new LX.vec2( 20, 20 ); // [ mUp, mDown ]\r\n\r\n let lastScrollTopValue = -1;\r\n\r\n if ( !this.disableEdition )\r\n {\r\n this.codeScroller.addEventListener( 'scroll', ( e: any ) => {\r\n if ( this._discardScroll )\r\n {\r\n this._discardScroll = false;\r\n return;\r\n }\r\n\r\n // Vertical scroll\r\n {\r\n this.setScrollBarValue( 'vertical' );\r\n\r\n const scrollTop = this.getScrollTop();\r\n\r\n // Scroll down...\r\n if ( scrollTop > lastScrollTopValue )\r\n {\r\n if ( this.visibleLinesViewport.y < ( this.code.lines.length - 1 ) )\r\n {\r\n const totalLinesInViewport = ( ( this.codeScroller.offsetHeight ) / this.lineHeight )\r\n | 0;\r\n const scrollDownBoundary = ( Math.max( this.visibleLinesViewport.y - totalLinesInViewport, 0 ) - 1 )\r\n * this.lineHeight;\r\n\r\n if ( scrollTop >= scrollDownBoundary )\r\n {\r\n this.processLines( CodeEditor.UPDATE_VISIBLE_LINES );\r\n }\r\n }\r\n }\r\n // Scroll up...\r\n else\r\n {\r\n const scrollUpBoundary = parseInt( this.code.style.top );\r\n if ( scrollTop < scrollUpBoundary )\r\n {\r\n this.processLines( CodeEditor.UPDATE_VISIBLE_LINES );\r\n }\r\n }\r\n\r\n lastScrollTopValue = scrollTop;\r\n }\r\n\r\n // Horizontal scroll\r\n {\r\n this.setScrollBarValue( 'horizontal' );\r\n }\r\n } );\r\n\r\n this.codeScroller.addEventListener( 'wheel', ( e: WheelEvent ) => {\r\n if ( e.ctrlKey )\r\n {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n e.deltaY > 0.0 ? this._decreaseFontSize() : this._increaseFontSize();\r\n }\r\n } );\r\n\r\n this.codeScroller.addEventListener( 'wheel', ( e: WheelEvent ) => {\r\n if ( !e.ctrlKey )\r\n {\r\n const dX = ( e.deltaY > 0.0 ? 10.0 : -10.0 ) * ( e.shiftKey ? 1.0 : 0.0 );\r\n if ( dX != 0.0 ) this.setScrollBarValue( 'horizontal', dX );\r\n }\r\n }, { passive: true } );\r\n }\r\n }\r\n\r\n // Line numbers and scrollbars\r\n {\r\n // This is only the container, line numbers are in the same line div\r\n this.gutter = document.createElement( 'div' );\r\n this.gutter.className = 'lexcodegutter';\r\n area.attach( this.gutter );\r\n\r\n // Add custom vertical scroll bar\r\n this.vScrollbar = new ScrollBar( this, ScrollBar.SCROLLBAR_VERTICAL );\r\n area.attach( this.vScrollbar.root );\r\n\r\n // Add custom horizontal scroll bar\r\n this.hScrollbar = new ScrollBar( this, ScrollBar.SCROLLBAR_HORIZONTAL );\r\n area.attach( this.hScrollbar.root );\r\n }\r\n\r\n // Add autocomplete, search boxes (IF edition enabled)\r\n if ( !this.disableEdition )\r\n {\r\n // Add autocomplete box\r\n {\r\n this.autocomplete = document.createElement( 'div' );\r\n this.autocomplete.className = 'autocomplete';\r\n this.codeArea.attach( this.autocomplete );\r\n }\r\n\r\n // Add search box\r\n {\r\n const box = document.createElement( 'div' );\r\n box.className = 'searchbox';\r\n\r\n const searchPanel = new LX.Panel();\r\n box.appendChild( searchPanel.root );\r\n\r\n searchPanel.sameLine( 4 );\r\n searchPanel.addText( null, '', null, { placeholder: 'Find', inputClass: 'bg-secondary' } );\r\n searchPanel.addButton( null, 'up', () => this.search( null, true ), { icon: 'ArrowUp', buttonClass: 'ghost', title: 'Previous Match',\r\n tooltip: true } );\r\n searchPanel.addButton( null, 'down', () => this.search(), { icon: 'ArrowDown', buttonClass: 'ghost', title: 'Next Match',\r\n tooltip: true } );\r\n searchPanel.addButton( null, 'x', this.hideSearchBox.bind( this ), { icon: 'X', buttonClass: 'ghost', title: 'Close',\r\n tooltip: true } );\r\n\r\n const searchInput = box.querySelector( 'input' );\r\n searchInput?.addEventListener( 'keyup', ( e ) => {\r\n if ( e.key == 'Escape' ) this.hideSearchBox();\r\n else if ( e.key == 'Enter' ) this.search( ( e.target as any ).value, !!e.shiftKey );\r\n } );\r\n\r\n this.searchbox = box;\r\n this.codeArea.attach( box );\r\n }\r\n\r\n // Add search LINE box\r\n {\r\n const box = document.createElement( 'div' );\r\n box.className = 'searchbox';\r\n\r\n const searchPanel = new LX.Panel();\r\n box.appendChild( searchPanel.root );\r\n\r\n searchPanel.sameLine( 2 );\r\n searchPanel.addText( null, '', ( value: string ) => {\r\n input.value = ':' + value.replaceAll( ':', '' );\r\n this.goToLine( input.value.slice( 1 ) );\r\n }, { placeholder: 'Go to line', trigger: 'input' } );\r\n searchPanel.addButton( null, 'x', this.hideSearchLineBox.bind( this ), { icon: 'X', title: 'Close', buttonClass: 'ghost',\r\n tooltip: true } );\r\n\r\n let input: any = box.querySelector( 'input' );\r\n input.addEventListener( 'keyup', ( e: KeyboardEvent ) => {\r\n if ( e.key == 'Escape' ) this.hideSearchLineBox();\r\n } );\r\n\r\n this.searchlinebox = box;\r\n this.codeArea.attach( box );\r\n }\r\n }\r\n\r\n // Add code-sizer\r\n {\r\n this.codeSizer = document.createElement( 'div' );\r\n this.codeSizer.className = 'code-sizer pseudoparent-tabs';\r\n\r\n // Append all childs\r\n while ( this.codeScroller.firstChild )\r\n {\r\n this.codeSizer.appendChild( this.codeScroller.firstChild );\r\n }\r\n\r\n this.codeScroller.appendChild( this.codeSizer );\r\n }\r\n\r\n // State\r\n\r\n this.state = {\r\n focused: false,\r\n selectingText: false,\r\n activeLine: null,\r\n keyChain: null\r\n };\r\n\r\n // Code\r\n\r\n this.pairKeys = {\r\n '\"': '\"',\r\n \"'\": \"'\",\r\n '(': ')',\r\n '{': '}',\r\n '[': ']'\r\n };\r\n\r\n this.stringKeys = { // adding @ because some words are always true in (e.g. constructor..)\r\n '@\"': '\"',\r\n \"@'\": \"'\"\r\n };\r\n\r\n // Scan tokens..\r\n // setInterval( this.scanWordSuggestions.bind( this ), 2000 );\r\n\r\n this.specialKeys = [\r\n 'Backspace',\r\n 'Enter',\r\n 'ArrowUp',\r\n 'ArrowDown',\r\n 'ArrowRight',\r\n 'ArrowLeft',\r\n 'Delete',\r\n 'Home',\r\n 'End',\r\n 'Tab',\r\n 'Escape'\r\n ];\r\n\r\n // Convert reserved word arrays to maps so we can search tokens faster\r\n\r\n if ( !CodeEditor._staticReady )\r\n {\r\n for ( let lang in CodeEditor.keywords ) CodeEditor.keywords[lang] = new Set( CodeEditor.keywords[lang] );\r\n for ( let lang in CodeEditor.utils ) CodeEditor.utils[lang] = new Set( CodeEditor.utils[lang] );\r\n for ( let lang in CodeEditor.types ) CodeEditor.types[lang] = new Set( CodeEditor.types[lang] );\r\n for ( let lang in CodeEditor.builtIn ) CodeEditor.builtIn[lang] = new Set( CodeEditor.builtIn[lang] );\r\n for ( let lang in CodeEditor.statements ) CodeEditor.statements[lang] = new Set( CodeEditor.statements[lang] );\r\n for ( let lang in CodeEditor.symbols ) CodeEditor.symbols[lang] = new Set( CodeEditor.symbols[lang] );\r\n\r\n CodeEditor._staticReady = true;\r\n }\r\n\r\n // Action keys\r\n {\r\n this.action( 'Escape', false, ( ln, cursor, e ) => {\r\n if ( this.hideAutoCompleteBox() )\r\n {\r\n return;\r\n }\r\n if ( this.hideSearchBox() )\r\n {\r\n return;\r\n }\r\n // Remove selections and cursors\r\n this.endSelection();\r\n this._removeSecondaryCursors();\r\n } );\r\n\r\n this.action( 'Backspace', false, ( ln, cursor, e ) => {\r\n this._addUndoStep( cursor );\r\n\r\n if ( cursor.selection )\r\n {\r\n this.deleteSelection( cursor );\r\n // Remove entire line when selecting with triple click\r\n if ( this._tripleClickSelection )\r\n {\r\n this.actions['Backspace'].callback( ln, cursor, e );\r\n this.lineDown( cursor, true );\r\n }\r\n }\r\n else\r\n {\r\n var letter = this.getCharAtPos( cursor, -1 );\r\n if ( letter )\r\n {\r\n var deleteFromPosition = cursor.position - 1;\r\n var numCharsDeleted = 1;\r\n\r\n // Delete full word\r\n if ( e.ctrlKey )\r\n {\r\n const [ word, from, to ] = this.getWordAtPos( cursor, -1 );\r\n\r\n if ( word.length > 1 )\r\n {\r\n deleteFromPosition = from;\r\n numCharsDeleted = word.length - ( to - cursor.position );\r\n }\r\n }\r\n\r\n this.code.lines[ln] = sliceChars( this.code.lines[ln], deleteFromPosition, numCharsDeleted );\r\n this.processLine( ln );\r\n\r\n this.cursorToPosition( cursor, deleteFromPosition );\r\n\r\n if ( this.useAutoComplete )\r\n {\r\n this.showAutoCompleteBox( 'foo', cursor );\r\n }\r\n }\r\n else if ( this.code.lines[ln - 1] != undefined )\r\n {\r\n this.lineUp( cursor );\r\n e.cancelShift = true;\r\n this.actions['End'].callback( cursor.line, cursor, e );\r\n // Move line on top\r\n this.code.lines[ln - 1] += this.code.lines[ln];\r\n this.code.lines.splice( ln, 1 );\r\n this.processLines();\r\n }\r\n }\r\n\r\n this.resizeIfNecessary( cursor, true );\r\n } );\r\n\r\n this.action( 'Delete', false, ( ln, cursor, e ) => {\r\n this._addUndoStep( cursor );\r\n\r\n if ( cursor.selection )\r\n {\r\n // Use 'Backspace' as it's the same callback...\r\n this.actions['Backspace'].callback( ln, cursor, e );\r\n }\r\n else\r\n {\r\n var letter = this.getCharAtPos( cursor );\r\n if ( letter )\r\n {\r\n this.code.lines[ln] = sliceChars( this.code.lines[ln], cursor.position );\r\n this.processLine( ln );\r\n\r\n // \"Delete\" removes the char at the right, so cursor position does not change\r\n // but line length does and next cursor position must be updated 1 position to the left\r\n this._nextCursorPositionOffset = -1;\r\n }\r\n else if ( this.code.lines[ln + 1] != undefined )\r\n {\r\n this.code.lines[ln] += this.code.lines[ln + 1];\r\n this.code.lines.splice( ln + 1, 1 );\r\n this.processLines();\r\n }\r\n }\r\n\r\n this.resizeIfNecessary( cursor, true );\r\n } );\r\n\r\n this.action( 'Tab', true, ( ln, cursor, e ) => {\r\n if ( this._skipTabs )\r\n {\r\n this._skipTabs--;\r\n if ( !this._skipTabs )\r\n {\r\n delete this._skipTabs;\r\n }\r\n }\r\n else if ( this.isAutoCompleteActive )\r\n {\r\n this.autoCompleteWord();\r\n }\r\n else\r\n {\r\n this._addUndoStep( cursor );\r\n\r\n if ( e && e.shiftKey )\r\n {\r\n this._removeSpaces( cursor );\r\n }\r\n else\r\n {\r\n const indentSpaces = this.tabSpaces - ( cursor.position % this.tabSpaces );\r\n this._addSpaces( cursor, indentSpaces );\r\n }\r\n }\r\n }, ( cursor: Cursor, e: KeyboardEvent ) => {\r\n return e.shiftKey || ( cursor.selection && !cursor.selection.sameLine() );\r\n } );\r\n\r\n this.action( 'Home', false, ( ln, cursor, e ) => {\r\n let idx = firstNonspaceIndex( this.code.lines[ln] );\r\n\r\n // We already are in the first non space index...\r\n if ( idx == cursor.position ) idx = 0;\r\n\r\n const prestring = this.code.lines[ln].substring( 0, idx );\r\n let lastX = cursor.position;\r\n\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor, true );\r\n if ( idx > 0 )\r\n {\r\n this.cursorToString( cursor, prestring );\r\n }\r\n else\r\n {\r\n // No spaces, start from char 0\r\n idx = 0;\r\n }\r\n\r\n this.mergeCursors( ln );\r\n\r\n if ( e.shiftKey && !e.cancelShift )\r\n {\r\n // Get last selection range\r\n if ( cursor.selection )\r\n {\r\n lastX += cursor.selection.chars;\r\n }\r\n\r\n if ( !cursor.selection )\r\n {\r\n this.startSelection( cursor );\r\n }\r\n\r\n var string = this.code.lines[ln].substring( idx, lastX );\r\n if ( cursor.selection!.sameLine() )\r\n {\r\n cursor.selection!.selectInline( cursor, idx, cursor.line, this.measureString( string ) );\r\n }\r\n else\r\n {\r\n this._processSelection( cursor, e );\r\n }\r\n }\r\n else if ( !e.keepSelection )\r\n {\r\n this.endSelection();\r\n }\r\n } );\r\n\r\n this.action( 'End', false, ( ln, cursor, e ) => {\r\n if ( ( e.shiftKey || e._shiftKey ) && !e.cancelShift )\r\n {\r\n var string = this.code.lines[ln].substring( cursor.position );\r\n if ( !cursor.selection )\r\n {\r\n this.startSelection( cursor );\r\n }\r\n if ( cursor.selection!.sameLine() )\r\n {\r\n cursor.selection!.selectInline( cursor, cursor.position, cursor.line, this.measureString( string ) );\r\n }\r\n else\r\n {\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor );\r\n this.cursorToString( cursor, this.code.lines[ln] );\r\n this._processSelection( cursor, e );\r\n }\r\n }\r\n else if ( !e.keepSelection )\r\n {\r\n this.endSelection();\r\n }\r\n\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor );\r\n this.cursorToString( cursor, this.code.lines[ln] );\r\n\r\n var viewportSizeX = ( this.codeScroller.clientWidth + this.getScrollLeft() )\r\n - CodeEditor.LINE_GUTTER_WIDTH; // Gutter offset\r\n if ( ( cursor.position * this.charWidth ) >= viewportSizeX )\r\n {\r\n this.setScrollLeft( this.code.lines[ln].length * this.charWidth );\r\n }\r\n\r\n // Merge cursors\r\n this.mergeCursors( ln );\r\n } );\r\n\r\n this.action( 'Enter', true, ( ln, cursor, e ) => {\r\n // Add word\r\n if ( this.isAutoCompleteActive )\r\n {\r\n this.autoCompleteWord();\r\n return;\r\n }\r\n\r\n if ( e.ctrlKey && this.onRun )\r\n {\r\n this.onRun( this.getText() );\r\n return;\r\n }\r\n\r\n this._addUndoStep( cursor, true );\r\n\r\n var _c0 = this.getCharAtPos( cursor, -1 );\r\n var _c1 = this.getCharAtPos( cursor );\r\n\r\n this.code.lines.splice( cursor.line + 1, 0, '' );\r\n this.code.lines[cursor.line + 1] = this.code.lines[ln].substr( cursor.position ); // new line (below)\r\n this.code.lines[ln] = this.code.lines[ln].substr( 0, cursor.position ); // line above\r\n\r\n this.lineDown( cursor, true );\r\n\r\n // Check indentation\r\n var spaces = firstNonspaceIndex( this.code.lines[ln] );\r\n var tabs = Math.floor( spaces / this.tabSpaces );\r\n\r\n if ( _c0 == '{' && _c1 == '}' )\r\n {\r\n this.code.lines.splice( cursor.line, 0, '' );\r\n this._addSpaceTabs( cursor, tabs + 1 );\r\n this.code.lines[cursor.line + 1] = ' '.repeat( spaces ) + this.code.lines[cursor.line + 1];\r\n }\r\n else\r\n {\r\n this._addSpaceTabs( cursor, tabs );\r\n }\r\n\r\n this.processLines();\r\n } );\r\n\r\n this.action( 'ArrowUp', false, ( ln, cursor, e ) => {\r\n // Move cursor..\r\n if ( !this.isAutoCompleteActive )\r\n {\r\n if ( e.shiftKey )\r\n {\r\n if ( !cursor.selection )\r\n {\r\n this.startSelection( cursor );\r\n }\r\n\r\n this.lineUp( cursor );\r\n\r\n var letter = this.getCharAtPos( cursor );\r\n if ( !letter )\r\n {\r\n this.cursorToPosition( cursor, this.code.lines[cursor.line].length );\r\n }\r\n\r\n this._processSelection( cursor, e, false );\r\n }\r\n else\r\n {\r\n this.endSelection();\r\n this.lineUp( cursor );\r\n // Go to end of line if out of line\r\n var letter = this.getCharAtPos( cursor );\r\n if ( !letter ) this.actions['End'].callback( cursor.line, cursor, e );\r\n }\r\n }\r\n // Move up autocomplete selection\r\n else\r\n {\r\n this._moveArrowSelectedAutoComplete( 'up' );\r\n }\r\n } );\r\n\r\n this.action( 'ArrowDown', false, ( ln, cursor, e ) => {\r\n // Move cursor..\r\n if ( !this.isAutoCompleteActive )\r\n {\r\n if ( e.shiftKey )\r\n {\r\n if ( !cursor.selection )\r\n {\r\n this.startSelection( cursor );\r\n }\r\n }\r\n else\r\n {\r\n this.endSelection();\r\n }\r\n\r\n const canGoDown = this.lineDown( cursor );\r\n const letter = this.getCharAtPos( cursor );\r\n\r\n // Go to end of line if out of range\r\n if ( !letter || !canGoDown )\r\n {\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor );\r\n this.cursorToRight( this.code.lines[cursor.line], cursor );\r\n }\r\n\r\n if ( e.shiftKey )\r\n {\r\n this._processSelection( cursor, e );\r\n }\r\n }\r\n // Move down autocomplete selection\r\n else\r\n {\r\n this._moveArrowSelectedAutoComplete( 'down' );\r\n }\r\n } );\r\n\r\n this.action( 'ArrowLeft', false, ( ln, cursor, e ) => {\r\n // Nothing to do..\r\n if ( cursor.line == 0 && cursor.position == 0 )\r\n {\r\n return;\r\n }\r\n\r\n if ( e.metaKey )\r\n { // Apple devices (Command)\r\n e.preventDefault();\r\n this.actions['Home'].callback( ln, cursor, e );\r\n }\r\n else if ( e.ctrlKey )\r\n {\r\n // Get next word\r\n const [ word, from, to ] = this.getWordAtPos( cursor, -1 );\r\n // If no length, we change line..\r\n if ( !word.length && this.lineUp( cursor, true ) )\r\n {\r\n const cS = e.cancelShift, kS = e.keepSelection;\r\n e.cancelShift = true;\r\n e.keepSelection = true;\r\n this.actions['End'].callback( cursor.line, cursor, e );\r\n e.cancelShift = cS;\r\n e.keepSelection = kS;\r\n }\r\n var diff = Math.max( cursor.position - from, 1 );\r\n var substr = word.substr( 0, diff );\r\n\r\n // Selections...\r\n if ( e.shiftKey )\r\n {\r\n if ( !cursor.selection )\r\n {\r\n this.startSelection( cursor );\r\n }\r\n }\r\n else\r\n {\r\n this.endSelection();\r\n }\r\n\r\n this.cursorToString( cursor, substr, true );\r\n\r\n if ( e.shiftKey )\r\n {\r\n this._processSelection( cursor, e );\r\n }\r\n }\r\n else\r\n {\r\n var letter = this.getCharAtPos( cursor, -1 );\r\n if ( letter )\r\n {\r\n if ( e.shiftKey )\r\n {\r\n if ( !cursor.selection ) this.startSelection( cursor );\r\n this.cursorToLeft( letter, cursor );\r\n this._processSelection( cursor, e, false, CodeEditor.SELECTION_X );\r\n }\r\n else\r\n {\r\n if ( cursor.selection )\r\n {\r\n cursor.selection.invertIfNecessary();\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT_TOP, cursor );\r\n this.cursorToLine( cursor, cursor.selection.fromY );\r\n this.cursorToPosition( cursor, cursor.selection.fromX, true );\r\n this.endSelection( cursor );\r\n }\r\n else\r\n {\r\n this.cursorToLeft( letter, cursor );\r\n if ( this.useAutoComplete && this.isAutoCompleteActive )\r\n {\r\n this.showAutoCompleteBox( 'foo', cursor );\r\n }\r\n }\r\n }\r\n }\r\n else if ( cursor.line > 0 )\r\n {\r\n if ( e.shiftKey && !cursor.selection ) this.startSelection( cursor );\r\n\r\n this.lineUp( cursor );\r\n\r\n e.cancelShift = e.keepSelection = true;\r\n this.actions['End'].callback( cursor.line, cursor, e );\r\n delete e.cancelShift;\r\n delete e.keepSelection;\r\n\r\n if ( e.shiftKey ) this._processSelection( cursor, e, false );\r\n }\r\n }\r\n } );\r\n\r\n this.action( 'ArrowRight', false, ( ln, cursor, e ) => {\r\n // Nothing to do..\r\n if ( cursor.line == this.code.lines.length - 1\r\n && cursor.position == this.code.lines[cursor.line].length )\r\n {\r\n return;\r\n }\r\n\r\n if ( e.metaKey )\r\n { // Apple devices (Command)\r\n e.preventDefault();\r\n this.actions['End'].callback( ln, cursor, e );\r\n }\r\n else if ( e.ctrlKey )\r\n { // Next word\r\n // Get next word\r\n const [ word, from, to ] = this.getWordAtPos( cursor );\r\n\r\n // If no length, we change line..\r\n if ( !word.length ) this.lineDown( cursor, true );\r\n var diff = cursor.position - from;\r\n var substr = word.substr( diff );\r\n\r\n // Selections...\r\n if ( e.shiftKey )\r\n {\r\n if ( !cursor.selection )\r\n {\r\n this.startSelection( cursor );\r\n }\r\n }\r\n else\r\n {\r\n this.endSelection();\r\n }\r\n\r\n this.cursorToString( cursor, substr );\r\n\r\n if ( e.shiftKey )\r\n {\r\n this._processSelection( cursor, e );\r\n }\r\n }\r\n // Next char\r\n else\r\n {\r\n var letter = this.getCharAtPos( cursor );\r\n if ( letter )\r\n {\r\n // Selecting chars\r\n if ( e.shiftKey )\r\n {\r\n if ( !cursor.selection )\r\n {\r\n this.startSelection( cursor );\r\n }\r\n\r\n this.cursorToRight( letter, cursor );\r\n this._processSelection( cursor, e, false, CodeEditor.SELECTION_X );\r\n }\r\n else\r\n {\r\n if ( !cursor.selection )\r\n {\r\n this.cursorToRight( letter, cursor );\r\n if ( this.useAutoComplete && this.isAutoCompleteActive )\r\n {\r\n this.showAutoCompleteBox( 'foo', cursor );\r\n }\r\n }\r\n else\r\n {\r\n cursor.selection.invertIfNecessary();\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT_TOP, cursor );\r\n this.cursorToLine( cursor, cursor.selection.toY );\r\n this.cursorToPosition( cursor, cursor.selection.toX, true );\r\n this.endSelection( cursor );\r\n }\r\n }\r\n }\r\n else if ( this.code.lines[cursor.line + 1] !== undefined )\r\n {\r\n if ( e.shiftKey )\r\n {\r\n if ( !cursor.selection ) this.startSelection( cursor );\r\n }\r\n else\r\n {\r\n this.endSelection();\r\n }\r\n\r\n this.lineDown( cursor, true );\r\n\r\n if ( e.shiftKey ) this._processSelection( cursor, e, false );\r\n\r\n this.hideAutoCompleteBox();\r\n }\r\n }\r\n } );\r\n }\r\n\r\n // Default code tab\r\n\r\n const onLoadAll = async () => {\r\n // Create inspector panel when the initial state is complete\r\n // and we have at least 1 tab opened\r\n this.statusPanel = this._createStatusPanel( options );\r\n if ( this.statusPanel )\r\n {\r\n area.attach( this.statusPanel );\r\n }\r\n\r\n this._setupDisplayObserver();\r\n\r\n g.editor = this;\r\n };\r\n\r\n if ( options.allowAddScripts ?? true )\r\n {\r\n this.onCreateFile = options.onCreateFile;\r\n this.addTab( '+', false, 'Create file' );\r\n }\r\n\r\n if ( options.files )\r\n {\r\n console.assert( options.files.constructor === Array, '_files_ must be an Array!' );\r\n const numFiles = options.files.length;\r\n const loadAsync = options.filesAsync !== undefined;\r\n let filesLoaded = 0;\r\n for ( let url of options.files )\r\n {\r\n const finalUrl = url.constructor === Array ? url[0] : url;\r\n const finalFileName = url.constructor === Array ? url[1] : undefined;\r\n\r\n await this.loadFile( finalUrl, { filename: finalFileName, async: loadAsync, callback: ( name: string, text: string ) => {\r\n filesLoaded++;\r\n if ( filesLoaded == numFiles )\r\n {\r\n onLoadAll();\r\n\r\n if ( options.onFilesLoaded )\r\n {\r\n options.onFilesLoaded( this, this.loadedTabs, numFiles );\r\n }\r\n }\r\n } } );\r\n }\r\n }\r\n else\r\n {\r\n if ( options.defaultTab ?? true )\r\n {\r\n this.addTab( options.name || 'untitled', true, options.title, {\r\n language: options.highlight ?? 'Plain Text'\r\n } );\r\n }\r\n\r\n onLoadAll();\r\n }\r\n }\r\n\r\n _setupDisplayObserver()\r\n {\r\n if ( this._displayObserver ) return;\r\n\r\n this._isReady = false;\r\n\r\n const root = this.root;\r\n\r\n const _isVisible = () => {\r\n return (\r\n root.offsetParent !== null\r\n && root.clientWidth > 0\r\n && root.clientHeight > 0\r\n );\r\n };\r\n\r\n const _tryPrepare = async () => {\r\n if ( this._isReady ) return;\r\n if ( !_isVisible() ) return;\r\n\r\n this._isReady = true;\r\n\r\n // Stop observing once prepared\r\n intersectionObserver.disconnect();\r\n resizeObserver.disconnect();\r\n\r\n await this._setupEditorWhenVisible();\r\n };\r\n\r\n // IntersectionObserver (for viewport)\r\n const intersectionObserver = new IntersectionObserver( ( entries ) => {\r\n for ( const entry of entries )\r\n {\r\n if ( entry.isIntersecting )\r\n {\r\n _tryPrepare();\r\n }\r\n }\r\n } );\r\n intersectionObserver.observe( root );\r\n\r\n // ResizeObserver (for display property changes)\r\n const resizeObserver = new ResizeObserver( () => {\r\n _tryPrepare();\r\n } );\r\n resizeObserver.observe( root );\r\n\r\n // Fallback polling (don't use it for now)\r\n // const interval = setInterval( () => {\r\n // if ( this._isReady ) {\r\n // clearInterval( interval );\r\n // return;\r\n // }\r\n // _tryPrepare();\r\n // }, 250 );\r\n\r\n this._displayObserver = {\r\n intersectionObserver,\r\n resizeObserver\r\n // interval,\r\n };\r\n }\r\n\r\n async _setupEditorWhenVisible()\r\n {\r\n if ( document.fonts.status == 'loading' )\r\n {\r\n await document.fonts.ready;\r\n }\r\n\r\n // Load any font size from local storage\r\n const savedFontSize = window.localStorage.getItem( 'lexcodeeditor-font-size' );\r\n if ( savedFontSize )\r\n {\r\n this._setFontSize( parseInt( savedFontSize ) );\r\n }\r\n // Use default size\r\n else\r\n {\r\n const r: any = document.querySelector( ':root' );\r\n const s = getComputedStyle( r );\r\n this.fontSize = parseInt( s.getPropertyValue( '--code-editor-font-size' ) );\r\n this.charWidth = this._measureChar() as number;\r\n }\r\n\r\n LX.emitSignal( '@font-size', this.fontSize );\r\n\r\n // Get final sizes for editor elements based on Tabs and status bar offsets\r\n LX.doAsync( () => {\r\n this._verticalTopOffset = this.tabs?.root.getBoundingClientRect().height ?? 0;\r\n this._verticalBottomOffset = this.statusPanel?.root.getBoundingClientRect().height ?? 0;\r\n this._fullVerticalOffset = this._verticalTopOffset + this._verticalBottomOffset;\r\n\r\n this.gutter.style.marginTop = `${this._verticalTopOffset}px`;\r\n this.gutter.style.height = `calc(100% - ${this._fullVerticalOffset}px)`;\r\n this.vScrollbar.root.style.marginTop = `${this._verticalTopOffset}px`;\r\n this.vScrollbar.root.style.height = `calc(100% - ${this._fullVerticalOffset}px)`;\r\n this.hScrollbar.root.style.bottom = `${this._verticalBottomOffset}px`;\r\n this.codeArea.root.style.height = `calc(100% - ${this._fullVerticalOffset}px)`;\r\n\r\n // Process lines on finish computing final sizes\r\n this.processLines();\r\n }, 50 );\r\n\r\n if ( this.onReady )\r\n {\r\n this.onReady( this );\r\n }\r\n\r\n this._preparedAt = performance.now();\r\n\r\n console.log( `[LX.CodeEditor] Ready! (font size: ${this.fontSize}px)` );\r\n }\r\n\r\n // Clear signals\r\n clear()\r\n {\r\n console.assert( this.rightStatusPanel && this.leftStatusPanel, 'No panels to clear.' );\r\n this.rightStatusPanel.clear();\r\n this.leftStatusPanel.clear();\r\n }\r\n\r\n static getInstances()\r\n {\r\n return CodeEditor.__instances;\r\n }\r\n\r\n // This received key inputs from the entire document...\r\n onKeyPressed( e: KeyboardEvent )\r\n {\r\n // Toggle visibility of the file explorer\r\n if ( e.key == 'b' && e.ctrlKey && this.useFileExplorer )\r\n {\r\n this.explorerArea.root.classList.toggle( 'hidden' );\r\n if ( this._lastBaseareaWidth )\r\n {\r\n this.baseArea.root.style.width = this._lastBaseareaWidth;\r\n delete this._lastBaseareaWidth;\r\n }\r\n else\r\n {\r\n this._lastBaseareaWidth = this.baseArea.root.style.width;\r\n this.baseArea.root.style.width = '100%';\r\n }\r\n }\r\n }\r\n\r\n getText( min: boolean = false )\r\n {\r\n return this.code.lines.join( min ? ' ' : '\\n' );\r\n }\r\n\r\n // This can be used to empty all text...\r\n setText( text: string = '', langString?: string, detectLanguage: boolean = false )\r\n {\r\n let newLines = text.split( '\\n' );\r\n this.code.lines = ( [] as string[] ).concat( newLines );\r\n\r\n this._removeSecondaryCursors();\r\n\r\n let cursor = this.getCurrentCursor( true );\r\n let lastLine = newLines.pop();\r\n\r\n this.cursorToLine( cursor, newLines.length ); // Already substracted 1\r\n this.cursorToPosition( cursor, lastLine?.length ?? 0, true );\r\n\r\n this.mustProcessLines = true;\r\n\r\n if ( detectLanguage )\r\n {\r\n langString = this._detectLanguage( text );\r\n }\r\n\r\n if ( langString )\r\n {\r\n this._changeLanguage( langString );\r\n }\r\n\r\n this._processLinesIfNecessary();\r\n }\r\n\r\n appendText( text: string, cursor: Cursor )\r\n {\r\n let lidx = cursor.line;\r\n\r\n if ( cursor.selection )\r\n {\r\n this.deleteSelection( cursor );\r\n lidx = cursor.line;\r\n }\r\n\r\n this.endSelection();\r\n\r\n const newLines = text.replaceAll( '\\r', '' ).split( '\\n' );\r\n\r\n // Pasting Multiline...\r\n if ( newLines.length != 1 )\r\n {\r\n let numLines = newLines.length;\r\n console.assert( numLines > 0 );\r\n const firstLine = newLines.shift();\r\n numLines--;\r\n\r\n const remaining = this.code.lines[lidx].slice( cursor.position );\r\n\r\n // Add first line\r\n this.code.lines[lidx] = [\r\n this.code.lines[lidx].slice( 0, cursor.position ),\r\n firstLine\r\n ].join( '' );\r\n\r\n this.cursorToPosition( cursor, cursor.position + ( firstLine?.length ?? 0 ) );\r\n\r\n // Enter next lines...\r\n\r\n let _text = null;\r\n\r\n for ( var i = 0; i < newLines.length; ++i )\r\n {\r\n _text = newLines[i];\r\n this.cursorToLine( cursor, cursor.line++, true );\r\n // Add remaining...\r\n if ( i == ( newLines.length - 1 ) )\r\n {\r\n _text += remaining;\r\n }\r\n this.code.lines.splice( 1 + lidx + i, 0, _text );\r\n }\r\n\r\n if ( _text ) this.cursorToPosition( cursor, _text.length );\r\n this.cursorToLine( cursor, cursor.line + numLines );\r\n this.processLines();\r\n }\r\n // Pasting one line...\r\n else\r\n {\r\n this.code.lines[lidx] = [\r\n this.code.lines[lidx].slice( 0, cursor.position ),\r\n newLines[0],\r\n this.code.lines[lidx].slice( cursor.position )\r\n ].join( '' );\r\n\r\n this.cursorToPosition( cursor, cursor.position + newLines[0].length );\r\n this.processLine( lidx );\r\n }\r\n\r\n this.resize( CodeEditor.RESIZE_SCROLLBAR_H_V, undefined, () => {\r\n var viewportSizeX = ( this.codeScroller.clientWidth + this.getScrollLeft() ) - CodeEditor.LINE_GUTTER_WIDTH; // Gutter offset\r\n if ( ( cursor.position * this.charWidth ) >= viewportSizeX )\r\n {\r\n this.setScrollLeft( this.code.lines[lidx].length * this.charWidth );\r\n }\r\n } );\r\n }\r\n\r\n setCustomSuggestions( suggestions: string[] )\r\n {\r\n if ( !suggestions || suggestions.constructor !== Array )\r\n {\r\n return;\r\n }\r\n\r\n this.customSuggestions = suggestions;\r\n }\r\n\r\n async loadFile( file: File, options: any = {} )\r\n {\r\n const _innerAddTab = ( text: string, name: string, title?: string ) => {\r\n // Remove Carriage Return in some cases and sub tabs using spaces\r\n text = text.replaceAll( '\\r', '' ).replaceAll( /\\t|\\\\t/g, ' '.repeat( this.tabSpaces ) );\r\n\r\n // Set current text and language\r\n const lines = text.split( '\\n' );\r\n\r\n // Add item in the explorer if used\r\n if ( this.useFileExplorer || this.skipTabs )\r\n {\r\n this._tabStorage[name] = {\r\n lines: lines,\r\n options: options\r\n };\r\n\r\n const ext = CodeEditor.languages[options.language]?.ext;\r\n\r\n if ( this.useFileExplorer )\r\n {\r\n this.addExplorerItem( { id: name, skipVisibility: true, icon: this._getFileIcon( name, ext ) } );\r\n this.explorer.innerTree.frefresh( name );\r\n }\r\n }\r\n else\r\n {\r\n this.addTab( name, true, title, options );\r\n this.code.lines = lines;\r\n\r\n // Default inferred language if not specified\r\n if ( !options.language )\r\n {\r\n this._changeLanguageFromExtension( LX.getExtension( name ) );\r\n }\r\n }\r\n\r\n if ( options.callback )\r\n {\r\n options.callback( name, text );\r\n }\r\n };\r\n\r\n if ( file.constructor == String )\r\n {\r\n const filename: string = file;\r\n const name = options.filename ?? filename.substring( filename.lastIndexOf( '/' ) + 1 );\r\n\r\n if ( options.async ?? false )\r\n {\r\n const text: string = await this._requestFileAsync( filename, 'text' ) as string;\r\n _innerAddTab( text, name, options.filename ?? filename );\r\n }\r\n else\r\n {\r\n LX.request( { url: filename, success: ( text: string ) => {\r\n _innerAddTab( text, name, options.filename ?? filename );\r\n } } );\r\n }\r\n }\r\n // File Blob\r\n else\r\n {\r\n const fr = new FileReader();\r\n fr.readAsText( file );\r\n fr.onload = ( e ) => {\r\n const text = ( e.currentTarget as any ).result;\r\n _innerAddTab( text, file.name );\r\n };\r\n }\r\n }\r\n\r\n _addUndoStep( cursor: Cursor, force: boolean = false, deleteRedo: boolean = true )\r\n {\r\n // Only the mainc cursor stores undo steps\r\n if ( !cursor.isMain )\r\n {\r\n return;\r\n }\r\n\r\n const d = new Date();\r\n const current = d.getTime();\r\n\r\n if ( !force )\r\n {\r\n if ( !this._lastTime )\r\n {\r\n this._lastTime = current;\r\n }\r\n else\r\n {\r\n if ( ( current - this._lastTime ) > 2000 )\r\n {\r\n this._lastTime = null;\r\n }\r\n else\r\n {\r\n // If time not enough, reset timer\r\n this._lastTime = current;\r\n return;\r\n }\r\n }\r\n }\r\n\r\n if ( deleteRedo )\r\n {\r\n // Remove all redo steps\r\n this.code.redoSteps.length = 0;\r\n }\r\n\r\n this.code.undoSteps.push( {\r\n lines: LX.deepCopy( this.code.lines ),\r\n cursors: this.saveCursors()\r\n } );\r\n }\r\n\r\n _doUndo( cursor: Cursor )\r\n {\r\n if ( !this.code.undoSteps.length )\r\n {\r\n return;\r\n }\r\n\r\n this._addRedoStep( cursor );\r\n\r\n // Extract info from the last code state\r\n const step = this.code.undoSteps.pop();\r\n\r\n // Set old state lines\r\n this.code.lines = step.lines;\r\n this.processLines();\r\n\r\n this._removeSecondaryCursors();\r\n\r\n for ( let i = 0; i < step.cursors.length; ++i )\r\n {\r\n var currentCursor: Cursor | null = this.cursors[i];\r\n\r\n // Generate new if needed\r\n if ( !currentCursor )\r\n {\r\n currentCursor = this._addCursor();\r\n }\r\n\r\n this.restoreCursor( currentCursor as Cursor, step.cursors[i] );\r\n }\r\n\r\n this._hideActiveLine();\r\n }\r\n\r\n _addRedoStep( cursor: Cursor )\r\n {\r\n // Only the mainc cursor stores redo steps\r\n if ( !cursor.isMain )\r\n {\r\n return;\r\n }\r\n\r\n this.code.redoSteps.push( {\r\n lines: LX.deepCopy( this.code.lines ),\r\n cursors: this.saveCursors()\r\n } );\r\n }\r\n\r\n _doRedo( cursor: Cursor )\r\n {\r\n if ( !this.code.redoSteps.length )\r\n {\r\n return;\r\n }\r\n\r\n this._addUndoStep( cursor, true, false );\r\n\r\n // Extract info from the next saved code state\r\n const step = this.code.redoSteps.pop();\r\n\r\n // Set old state lines\r\n this.code.lines = step.lines;\r\n this.processLines();\r\n\r\n this._removeSecondaryCursors();\r\n\r\n for ( let i = 0; i < step.cursors.length; ++i )\r\n {\r\n var currentCursor: Cursor | null = this.cursors[i];\r\n\r\n // Generate new if needed\r\n if ( !currentCursor )\r\n {\r\n currentCursor = this._addCursor();\r\n }\r\n\r\n this.restoreCursor( currentCursor as Cursor, step.cursors[i] );\r\n }\r\n }\r\n\r\n _changeLanguage( langString: string, langExtension?: string, override: boolean = false )\r\n {\r\n this.code.language = langString;\r\n this.highlight = langString;\r\n\r\n if ( override )\r\n {\r\n this.code.languageOverride = langString;\r\n }\r\n\r\n this._updateDataInfoPanel( '@highlight', langString );\r\n\r\n this.mustProcessLines = true;\r\n\r\n const ext = langExtension ?? CodeEditor.languages[langString].ext;\r\n const icon = this._getFileIcon( null, ext );\r\n\r\n // Update tab icon\r\n if ( !this.skipTabs )\r\n {\r\n const tab = this.tabs.tabDOMs[this.code.tabName];\r\n tab.firstChild.remove();\r\n console.assert( tab != undefined );\r\n var iconEl;\r\n if ( !icon.includes( '.' ) )\r\n { // Not a file\r\n const classes = icon.split( ' ' );\r\n iconEl = LX.makeIcon( classes[0], { svgClass: classes.slice( 0 ).join( ' ' ) } );\r\n }\r\n else\r\n {\r\n iconEl = document.createElement( 'img' );\r\n iconEl.src = 'https://raw.githubusercontent.com/jxarco/lexgui.js/master/' + icon;\r\n }\r\n tab.prepend( iconEl );\r\n }\r\n\r\n // Update explorer icon\r\n if ( this.useFileExplorer )\r\n {\r\n const item = this.explorer.innerTree.data.filter( ( v: HTMLElement ) => v.id === this.code.tabName )[0];\r\n console.assert( item != undefined );\r\n item.icon = icon;\r\n this.explorer.innerTree.frefresh( this.code.tabName );\r\n }\r\n }\r\n\r\n _changeLanguageFromExtension( ext: string )\r\n {\r\n if ( !ext )\r\n {\r\n return this._changeLanguage( this.code.language );\r\n }\r\n\r\n for ( let l in CodeEditor.languages )\r\n {\r\n const langExtension = CodeEditor.languages[l].ext;\r\n\r\n if ( langExtension.constructor == Array )\r\n {\r\n if ( langExtension.indexOf( ext ) > -1 )\r\n {\r\n return this._changeLanguage( l, ext );\r\n }\r\n }\r\n else\r\n {\r\n if ( langExtension == ext )\r\n {\r\n return this._changeLanguage( l );\r\n }\r\n }\r\n }\r\n\r\n this._changeLanguage( 'Plain Text' );\r\n }\r\n\r\n _createStatusPanel( options: any = {} )\r\n {\r\n if ( this.skipInfo )\r\n {\r\n return;\r\n }\r\n\r\n let panel = new LX.Panel( { className: 'lexcodetabinfo flex flex-row', height: 'auto' } );\r\n\r\n if ( this.onCreateStatusPanel )\r\n {\r\n this.onCreateStatusPanel( panel, this );\r\n }\r\n\r\n let leftStatusPanel = this.leftStatusPanel = new LX.Panel( { id: 'FontSizeZoomStatusComponent',\r\n className: 'pad-xs content-center items-center flex-auto-keep', width: 'auto', height: 'auto' } );\r\n leftStatusPanel.sameLine();\r\n\r\n leftStatusPanel.addButton( null, 'ZoomOutButton', this._decreaseFontSize.bind( this ), { icon: 'ZoomOut', buttonClass: 'ghost sm',\r\n title: 'Zoom Out', tooltip: true } );\r\n leftStatusPanel.addLabel( this.fontSize, { fit: true, signal: '@font-size' } );\r\n leftStatusPanel.addButton( null, 'ZoomInButton', this._increaseFontSize.bind( this ), { icon: 'ZoomIn', buttonClass: 'ghost sm',\r\n title: 'Zoom In', tooltip: true } );\r\n leftStatusPanel.endLine( 'justify-start' );\r\n panel.attach( leftStatusPanel.root );\r\n\r\n let rightStatusPanel = this.rightStatusPanel = new LX.Panel( { className: 'pad-xs content-center items-center', height: 'auto' } );\r\n rightStatusPanel.sameLine();\r\n rightStatusPanel.addLabel( this.code?.title ?? '', { id: 'EditorFilenameStatusComponent', fit: true, inputClass: 'text-xs',\r\n signal: '@tab-name' } );\r\n rightStatusPanel.addButton( null, 'Ln 1, Col 1', this.showSearchLineBox.bind( this ), {\r\n id: 'EditorSelectionStatusComponent',\r\n buttonClass: 'outline xs',\r\n fit: true,\r\n signal: '@cursor-data'\r\n } );\r\n rightStatusPanel.addButton( null, 'Spaces: ' + this.tabSpaces, ( value: any, event: any ) => {\r\n LX.addContextMenu( 'Spaces', event, ( m: typeof ContextMenu ) => {\r\n const options = [ 2, 4, 8 ];\r\n for ( const n of options )\r\n {\r\n m.add( n, ( v: any ) => {\r\n this.tabSpaces = v;\r\n this.processLines();\r\n this._updateDataInfoPanel( '@tab-spaces', 'Spaces: ' + this.tabSpaces );\r\n } );\r\n }\r\n } );\r\n }, { id: 'EditorIndentationStatusComponent', buttonClass: 'outline xs', signal: '@tab-spaces' } );\r\n rightStatusPanel.addButton( '<b>{ }</b>', this.highlight, ( value: any, event: any ) => {\r\n LX.addContextMenu( 'Language', event, ( m: typeof ContextMenu ) => {\r\n for ( const lang of Object.keys( CodeEditor.languages ) )\r\n {\r\n m.add( lang, ( v: any ) => {\r\n this._changeLanguage( v, undefined, true );\r\n this.processLines();\r\n } );\r\n }\r\n } );\r\n }, { id: 'EditorLanguageStatusComponent', nameWidth: 'auto', buttonClass: 'outline xs', signal: '@highlight', title: '' } );\r\n rightStatusPanel.endLine( 'justify-end' );\r\n panel.attach( rightStatusPanel.root );\r\n\r\n const itemVisibilityMap: Record<string, boolean> = {\r\n 'Font Size Zoom': options.statusShowFontSizeZoom ?? true,\r\n 'Editor Filename': options.statusShowEditorFilename ?? true,\r\n 'Editor Selection': options.statusShowEditorSelection ?? true,\r\n 'Editor Indentation': options.statusShowEditorIndentation ?? true,\r\n 'Editor Language': options.statusShowEditorLanguage ?? true\r\n };\r\n\r\n const _setVisibility = ( itemName: string ) => {\r\n const b = panel.root.querySelector( `#${itemName.replaceAll( ' ', '' )}StatusComponent` );\r\n console.assert( b, `${itemName} has no status button!` );\r\n b.classList.toggle( 'hidden', !itemVisibilityMap[itemName] );\r\n };\r\n\r\n for ( const [ itemName, v ] of Object.entries( itemVisibilityMap ) )\r\n {\r\n _setVisibility( itemName );\r\n }\r\n\r\n panel.root.addEventListener( 'contextmenu', ( e: any ) => {\r\n if ( e.target\r\n && ( e.target.classList.contains( 'lexpanel' )\r\n || e.target.classList.contains( 'lexinlinecomponents' ) ) )\r\n {\r\n return;\r\n }\r\n\r\n const menuOptions = Object.keys( itemVisibilityMap ).map( ( itemName, idx ) => {\r\n const item: any = {\r\n name: itemName,\r\n icon: 'Check',\r\n callback: () => {\r\n itemVisibilityMap[itemName] = !itemVisibilityMap[itemName];\r\n _setVisibility( itemName );\r\n }\r\n };\r\n if ( !itemVisibilityMap[itemName] ) delete item.icon;\r\n return item;\r\n } );\r\n new LX.DropdownMenu( e.target, menuOptions, { side: 'top', align: 'start' } );\r\n } );\r\n\r\n return panel;\r\n }\r\n\r\n _getFileIcon( name: string | null, extension?: string, langString?: string )\r\n {\r\n const isNewTabButton = name ? ( name === '+' ) : false;\r\n if ( isNewTabButton )\r\n {\r\n return;\r\n }\r\n\r\n if ( !langString )\r\n {\r\n if ( !extension )\r\n {\r\n extension = LX.getExtension( name );\r\n }\r\n else\r\n {\r\n const possibleExtensions = ( [] as string[] ).concat( extension );\r\n\r\n if ( name )\r\n {\r\n const fileExtension = LX.getExtension( name );\r\n const idx = possibleExtensions.indexOf( fileExtension );\r\n\r\n if ( idx > -1 )\r\n {\r\n extension = possibleExtensions[idx];\r\n }\r\n }\r\n else\r\n {\r\n extension = possibleExtensions[0];\r\n }\r\n }\r\n\r\n for ( const [ l, lData ] of Object.entries( CodeEditor.languages ) )\r\n {\r\n const extensions = ( [] as string[] ).concat( ( lData as any ).ext );\r\n if ( extensions.includes( extension! ) )\r\n {\r\n langString = l;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if ( langString === undefined )\r\n {\r\n return 'AlignLeft text-neutral-500';\r\n }\r\n\r\n const iconPlusClasses = CodeEditor.languages[langString]?.icon;\r\n if ( iconPlusClasses )\r\n {\r\n return iconPlusClasses[extension!] ?? iconPlusClasses;\r\n }\r\n\r\n return 'AlignLeft text-neutral-500';\r\n }\r\n\r\n _onNewTab( e: any )\r\n {\r\n this.processFocus( false );\r\n\r\n if ( this.onNewTab )\r\n {\r\n this.onNewTab( e );\r\n return;\r\n }\r\n\r\n const dmOptions = this.newTabOptions ?? [\r\n { name: 'Create file', icon: 'FilePlus', callback: this._onCreateNewFile.bind( this ) },\r\n { name: 'Load file', icon: 'FileUp', disabled: !this.allowLoadingFiles, callback: this.loadTabFromFile.bind( this ) }\r\n ];\r\n\r\n new LX.DropdownMenu( e.target, dmOptions, { side: 'bottom', align: 'start' } );\r\n }\r\n\r\n _onCreateNewFile()\r\n {\r\n let options: any = {};\r\n\r\n if ( this.onCreateFile )\r\n {\r\n options = this.onCreateFile( this );\r\n if ( !options )\r\n { // Skip adding new file\r\n return;\r\n }\r\n }\r\n\r\n const name = options.name ?? 'unnamed.js';\r\n this.addTab( name, true, name, { indexOffset: options.indexOffset, language: options.language ?? 'JavaScript' } );\r\n }\r\n\r\n _onSelectTab( isNewTabButton: boolean, event: any, name: string )\r\n {\r\n if ( this.disableEdition )\r\n {\r\n return;\r\n }\r\n\r\n if ( isNewTabButton )\r\n {\r\n this._onNewTab( event );\r\n return;\r\n }\r\n\r\n this._removeSecondaryCursors();\r\n\r\n const cursor = this.getCurrentCursor( true );\r\n const lastCode = this.code;\r\n\r\n if ( lastCode )\r\n {\r\n this.saveCursor( cursor, lastCode.cursorState );\r\n }\r\n\r\n this.code = this.loadedTabs[name];\r\n\r\n this.restoreCursor( cursor, this.code.cursorState );\r\n\r\n this.endSelection();\r\n\r\n this.hideAutoCompleteBox();\r\n\r\n this._updateDataInfoPanel( '@tab-name', name );\r\n\r\n if ( this.code.languageOverride )\r\n {\r\n this._changeLanguage( this.code.languageOverride );\r\n }\r\n else\r\n {\r\n this._changeLanguageFromExtension( LX.getExtension( name ) );\r\n }\r\n\r\n this.processLines();\r\n\r\n if ( !isNewTabButton && this.onSelectTab )\r\n {\r\n this.onSelectTab( name, this );\r\n }\r\n }\r\n\r\n _onContextMenuTab( isNewTabButton: boolean = false, event: any, name: string )\r\n {\r\n if ( isNewTabButton )\r\n {\r\n return;\r\n }\r\n\r\n new LX.DropdownMenu( event.target, [\r\n { name: 'Close', kbd: 'MWB', disabled: !this.allowClosingTabs, callback: () => {\r\n this.closeTab( name );\r\n } },\r\n { name: 'Close Others', disabled: !this.allowClosingTabs, callback: () => {\r\n for ( const [ key, data ] of Object.entries( this.tabs.tabs ) )\r\n {\r\n if ( key === '+' || key === name ) continue;\r\n this.closeTab( key );\r\n }\r\n } },\r\n { name: 'Close All', disabled: !this.allowClosingTabs, callback: () => {\r\n for ( const [ key, data ] of Object.entries( this.tabs.tabs ) )\r\n {\r\n if ( key === '+' ) continue;\r\n this.closeTab( key );\r\n }\r\n } },\r\n null,\r\n { name: 'Copy Path', icon: 'Copy', callback: () => {\r\n navigator.clipboard.writeText( this.openedTabs[name].path ?? '' );\r\n } }\r\n ], { side: 'bottom', align: 'start', event } );\r\n }\r\n\r\n addTab( name: string, selected: boolean, title?: string, options: any = {} )\r\n {\r\n // If already loaded, set new name...\r\n const repeats = Object.keys( this.loadedTabs ).slice( 1 ).reduce( ( v, key ) => {\r\n const noRepeatName = key.replace( /[_\\d+]/g, '' );\r\n return v + ( noRepeatName == name ? 1 : 0 );\r\n }, 0 );\r\n\r\n if ( repeats > 0 )\r\n {\r\n name = name.split( '.' ).join( '_' + repeats + '.' );\r\n }\r\n\r\n const isNewTabButton = name === '+';\r\n\r\n // Create code content\r\n let code = document.createElement( 'div' );\r\n let codeAny = code as any;\r\n Object.assign( code, {\r\n path: options.path ?? '',\r\n className: 'code',\r\n lines: [ '' ],\r\n language: options.language ?? 'Plain Text',\r\n cursorState: {},\r\n undoSteps: [],\r\n redoSteps: [],\r\n lineScopes: [],\r\n lineSymbols: [],\r\n lineSignatures: [],\r\n symbolsTable: new Map(),\r\n tabName: name,\r\n title: title ?? name,\r\n tokens: {}\r\n } );\r\n\r\n code.style.left = '0px', code.style.top = '0px', code.addEventListener( 'dragenter', function( e )\r\n {\r\n e.preventDefault();\r\n this.parentElement?.classList.add( 'dragging' );\r\n } );\r\n code.addEventListener( 'dragleave', function( e )\r\n {\r\n e.preventDefault();\r\n this.parentElement?.classList.remove( 'dragging' );\r\n } );\r\n code.addEventListener( 'drop', ( e ) => {\r\n e.preventDefault();\r\n code.parentElement?.classList.remove( 'dragging' );\r\n if ( e.dataTransfer?.files )\r\n {\r\n for ( let i = 0; i < e.dataTransfer.files.length; ++i )\r\n {\r\n this.loadFile( e.dataTransfer.files[i] );\r\n }\r\n }\r\n } );\r\n\r\n this.loadedTabs[name] = code;\r\n this.openedTabs[name] = code;\r\n\r\n const lastCode = this.code;\r\n\r\n this.code = code;\r\n\r\n const tabIcon = this._getFileIcon( name );\r\n\r\n if ( this.useFileExplorer && !isNewTabButton )\r\n {\r\n this.addExplorerItem( { id: name, skipVisibility: true, icon: tabIcon } );\r\n this.explorer.innerTree.frefresh( name );\r\n }\r\n\r\n if ( !this.skipTabs )\r\n {\r\n this.tabs.add( name, code, {\r\n selected: selected,\r\n fixed: isNewTabButton,\r\n title: code.title,\r\n icon: tabIcon,\r\n onSelect: this._onSelectTab.bind( this, isNewTabButton ),\r\n onContextMenu: this._onContextMenuTab.bind( this, isNewTabButton ),\r\n allowDelete: this.allowClosingTabs,\r\n indexOffset: options.indexOffset\r\n } );\r\n }\r\n\r\n // Move into the sizer..\r\n this.codeSizer.appendChild( code );\r\n\r\n this.endSelection();\r\n\r\n if ( options.language )\r\n {\r\n codeAny.languageOverride = options.language;\r\n this._changeLanguage( codeAny.languageOverride );\r\n this.mustProcessLines = true;\r\n }\r\n\r\n if ( options.codeLines )\r\n {\r\n codeAny.lines = options.codeLines;\r\n this.mustProcessLines = true;\r\n }\r\n\r\n if ( selected )\r\n {\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT_TOP, undefined, true );\r\n this.mustProcessLines = true;\r\n }\r\n else\r\n {\r\n this.code = lastCode;\r\n }\r\n\r\n this._processLinesIfNecessary();\r\n\r\n this._updateDataInfoPanel( '@tab-name', name );\r\n\r\n // Bc it could be overrided..\r\n return name;\r\n }\r\n\r\n loadCode( name: string )\r\n {\r\n // Hide all others\r\n this.codeSizer.querySelectorAll( '.code' ).forEach( ( c: HTMLElement ) => c.classList.add( 'hidden' ) );\r\n\r\n // Already open...\r\n if ( this.openedTabs[name] )\r\n {\r\n let code = this.openedTabs[name];\r\n code.classList.remove( 'hidden' );\r\n return;\r\n }\r\n\r\n let code = this.loadedTabs[name];\r\n if ( !code )\r\n {\r\n this.addTab( name, true );\r\n\r\n // Unload lines from storage...\r\n const tabData = this._tabStorage[name];\r\n if ( tabData )\r\n {\r\n this.code.lines = tabData.lines;\r\n\r\n if ( tabData.options.language )\r\n {\r\n this._changeLanguage( tabData.options.language, undefined, true );\r\n }\r\n else\r\n {\r\n this._changeLanguageFromExtension( LX.getExtension( name ) );\r\n }\r\n\r\n delete this._tabStorage[name];\r\n }\r\n\r\n this._processLinesIfNecessary();\r\n\r\n return;\r\n }\r\n\r\n this.openedTabs[name] = code;\r\n\r\n // Move into the sizer..\r\n this.codeSizer.appendChild( code );\r\n\r\n this.endSelection();\r\n\r\n // Select as current...\r\n this.code = code;\r\n this.mustProcessLines = true;\r\n\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT_TOP, undefined, true );\r\n this.processLines();\r\n this._changeLanguageFromExtension( LX.getExtension( name ) );\r\n this._processLinesIfNecessary();\r\n this._updateDataInfoPanel( '@tab-name', code.tabName );\r\n }\r\n\r\n loadTab( name: string )\r\n {\r\n // Already open...\r\n if ( this.openedTabs[name] )\r\n {\r\n this.tabs.select( name );\r\n return;\r\n }\r\n\r\n let code = this.loadedTabs[name];\r\n\r\n if ( !code )\r\n {\r\n this.addTab( name, true );\r\n\r\n // Unload lines from storage...\r\n const tabData = this._tabStorage[name];\r\n if ( tabData )\r\n {\r\n this.code.lines = tabData.lines;\r\n\r\n if ( tabData.options.language )\r\n {\r\n this._changeLanguage( tabData.options.language, undefined, true );\r\n }\r\n else\r\n {\r\n this._changeLanguageFromExtension( LX.getExtension( name ) );\r\n }\r\n\r\n delete this._tabStorage[name];\r\n }\r\n\r\n this._processLinesIfNecessary();\r\n\r\n return;\r\n }\r\n\r\n // Reset visibility\r\n code.style.display = 'block';\r\n\r\n this.openedTabs[name] = code;\r\n\r\n const isNewTabButton = name === '+';\r\n const tabIcon = this._getFileIcon( name );\r\n\r\n this.tabs.add( name, code, {\r\n selected: true,\r\n fixed: isNewTabButton,\r\n title: code.title,\r\n icon: tabIcon,\r\n onSelect: this._onSelectTab.bind( this, isNewTabButton ),\r\n onContextMenu: this._onContextMenuTab.bind( this, isNewTabButton ),\r\n allowDelete: this.allowClosingTabs\r\n } );\r\n\r\n // Move into the sizer..\r\n this.codeSizer.appendChild( code );\r\n\r\n this.endSelection();\r\n\r\n // Select as current...\r\n this.code = code;\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT_TOP, undefined, true );\r\n this._changeLanguageFromExtension( LX.getExtension( name ) );\r\n this._updateDataInfoPanel( '@tab-name', code.tabName );\r\n\r\n this.processLines();\r\n }\r\n\r\n closeTab( name: string, eraseAll: boolean = false )\r\n {\r\n if ( !this.allowClosingTabs )\r\n {\r\n return;\r\n }\r\n\r\n this.tabs.delete( name );\r\n\r\n if ( eraseAll )\r\n {\r\n delete this.openedTabs[name];\r\n delete this.loadedTabs[name];\r\n delete this._tabStorage[name];\r\n }\r\n }\r\n\r\n getSelectedTabName()\r\n {\r\n return this.tabs.selected;\r\n }\r\n\r\n loadTabFromFile()\r\n {\r\n const input = document.createElement( 'input' );\r\n input.type = 'file';\r\n document.body.appendChild( input );\r\n input.click();\r\n input.addEventListener( 'change', ( e ) => {\r\n const target = e.target as HTMLInputElement;\r\n if ( target.files && target.files[0] )\r\n {\r\n this.loadFile( target.files[0] );\r\n }\r\n input.remove();\r\n } );\r\n }\r\n\r\n processFocus( active: boolean = false )\r\n {\r\n if ( active )\r\n {\r\n this.restartBlink();\r\n }\r\n else\r\n {\r\n clearInterval( this.blinker );\r\n LX.removeClass( this.cursorsDOM, 'show' );\r\n }\r\n }\r\n\r\n processMouse( e: MouseEvent )\r\n {\r\n const target = e.target as HTMLElement;\r\n if ( !target.classList.contains( 'code' ) && !target.classList.contains( 'lexcodearea' ) ) return;\r\n if ( !this.code ) return;\r\n\r\n var cursor = this.getCurrentCursor();\r\n var code_rect = this.code.getBoundingClientRect();\r\n var mouse_pos = [ e.clientX - code_rect.x, e.clientY - code_rect.y ];\r\n\r\n // Discard out of lines click...\r\n var ln = ( mouse_pos[1] / this.lineHeight ) | 0;\r\n if ( ln < 0 ) return;\r\n\r\n if ( e.type == 'mousedown' )\r\n {\r\n // Left click only...\r\n if ( e.button === 2 )\r\n {\r\n this.processClick( e );\r\n\r\n this.canOpenContextMenu = !cursor.selection;\r\n\r\n if ( cursor.selection )\r\n {\r\n this.canOpenContextMenu = this.canOpenContextMenu\r\n || ( cursor.line >= cursor.selection.fromY && cursor.line <= cursor.selection.toY\r\n && cursor.position >= cursor.selection.fromX && cursor.position <= cursor.selection.toX );\r\n if ( this.canOpenContextMenu )\r\n {\r\n return;\r\n }\r\n }\r\n }\r\n\r\n this._mouseDown = true;\r\n this._lastMouseDown = LX.getTime();\r\n this.endSelection();\r\n this.processClick( e );\r\n }\r\n else if ( e.type == 'mouseup' )\r\n {\r\n this._onMouseUp( e );\r\n }\r\n else if ( e.type == 'mousemove' )\r\n {\r\n if ( this._mouseDown )\r\n {\r\n this.state.selectingText = true;\r\n this.processSelections( e );\r\n }\r\n }\r\n else if ( e.type == 'click' )\r\n { // trip\r\n switch ( e.detail )\r\n {\r\n case LX.MOUSE_DOUBLE_CLICK:\r\n const [ word, from, to ] = this.getWordAtPos( cursor );\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor );\r\n this.cursorToPosition( cursor, from );\r\n this.startSelection( cursor );\r\n cursor.selection!.selectInline( cursor, from, cursor.line, this.measureString( word ) );\r\n this.cursorToString( cursor, word ); // Go to the end of the word\r\n break;\r\n // Select entire line\r\n case LX.MOUSE_TRIPLE_CLICK:\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor );\r\n ( e as any )._shiftKey = true;\r\n this.actions['End'].callback( cursor.line, cursor, e );\r\n this._tripleClickSelection = true;\r\n break;\r\n }\r\n }\r\n else if ( e.type == 'contextmenu' )\r\n {\r\n e.preventDefault();\r\n\r\n if ( !this.canOpenContextMenu )\r\n {\r\n return;\r\n }\r\n\r\n LX.addContextMenu( null, e, ( m: typeof ContextMenu ) => {\r\n m.add( 'Copy', () => {\r\n this._copyContent( cursor );\r\n } );\r\n\r\n if ( !this.disableEdition )\r\n {\r\n m.add( 'Cut', () => {\r\n this._cutContent( cursor );\r\n } );\r\n m.add( 'Paste', () => {\r\n this._pasteContent( cursor );\r\n } );\r\n }\r\n\r\n if ( !this.onContextMenu )\r\n {\r\n return;\r\n }\r\n\r\n let content = null;\r\n\r\n if ( cursor.selection )\r\n {\r\n // Some selections don't depend on mouse up..\r\n if ( cursor.selection ) cursor.selection.invertIfNecessary();\r\n\r\n const separator = '_NEWLINE_';\r\n let code = this.code.lines.join( separator );\r\n\r\n // Get linear start index\r\n let index = 0;\r\n\r\n for ( let i = 0; i <= cursor.selection.fromY; i++ )\r\n {\r\n index += i == cursor.selection.fromY ? cursor.selection.fromX : this.code.lines[i].length;\r\n }\r\n\r\n index += cursor.selection.fromY * separator.length;\r\n const num_chars = cursor.selection.chars\r\n + ( cursor.selection.toY - cursor.selection.fromY ) * separator.length;\r\n const text = code.substr( index, num_chars );\r\n content = text.split( separator ).join( '\\n' );\r\n }\r\n\r\n const options = this.onContextMenu( this, content, e );\r\n if ( options.length )\r\n {\r\n m.add( '' );\r\n\r\n for ( const o of options )\r\n {\r\n m.add( o.path, { disabled: o.disabled, callback: o.callback } );\r\n }\r\n\r\n // m.add( \"Format/JSON\", () => {\r\n // let json = this.toJSONFormat( this.getText() );\r\n // if( !json )\r\n // return;\r\n // this.code.lines = json.split( \"\\n\" );\r\n // this.processLines();\r\n // } );\r\n }\r\n } );\r\n\r\n this.canOpenContextMenu = false;\r\n }\r\n }\r\n\r\n _onMouseUp( e: MouseEvent )\r\n {\r\n if ( ( LX.getTime() - this._lastMouseDown ) < 120 )\r\n {\r\n this.state.selectingText = false;\r\n this.endSelection();\r\n }\r\n\r\n const cursor = this.getCurrentCursor();\r\n if ( cursor.selection )\r\n {\r\n cursor.selection.invertIfNecessary();\r\n\r\n // If single line selection and no chars selected, remove selection\r\n const deltaY = cursor.selection.toY - cursor.selection.fromY;\r\n if ( cursor.selection.chars == 0 && deltaY == 0 )\r\n {\r\n this.endSelection();\r\n }\r\n }\r\n\r\n this._mouseDown = false;\r\n this.state.selectingText = false;\r\n delete this._lastSelectionKeyDir;\r\n }\r\n\r\n processClick( e: MouseEvent )\r\n {\r\n var cursor = this.getCurrentCursor();\r\n var code_rect = this.codeScroller.getBoundingClientRect();\r\n var position = [ ( e.clientX - code_rect.x ) + this.getScrollLeft(), ( e.clientY - code_rect.y ) + this.getScrollTop() ];\r\n var ln = ( position[1] / this.lineHeight ) | 0;\r\n\r\n // Check out of range line\r\n const outOfRange = ln > this.code.lines.length - 1;\r\n ln = Math.min( ln, this.code.lines.length - 1 );\r\n\r\n var ch = ( ( position[0] - parseInt( this.xPadding ) + 3 ) / this.charWidth ) | 0;\r\n var string = outOfRange ? this.code.lines[ln] : this.code.lines[ln].slice( 0, ch );\r\n\r\n // Move main cursor there...\r\n if ( !e.altKey )\r\n {\r\n // Make sure we only keep the main cursor..\r\n this._removeSecondaryCursors();\r\n this.cursorToLine( cursor, ln );\r\n this.cursorToPosition( cursor, string.length );\r\n }\r\n // Add new cursor\r\n else\r\n {\r\n this._addCursor( ln, string.length );\r\n }\r\n\r\n this.hideAutoCompleteBox();\r\n }\r\n\r\n updateSelections( e: any, keepRange: boolean = false, flags: number = CodeEditor.SELECTION_X_Y )\r\n {\r\n for ( let cursor of this.cursors )\r\n {\r\n if ( !cursor.selection )\r\n {\r\n continue;\r\n }\r\n\r\n this._processSelection( cursor, e, keepRange, flags );\r\n }\r\n }\r\n\r\n processSelections( e: any, keepRange: boolean = false, flags: number = CodeEditor.SELECTION_X_Y )\r\n {\r\n for ( let cursor of this.cursors )\r\n {\r\n this._processSelection( cursor, e, keepRange, flags );\r\n }\r\n }\r\n\r\n _processSelection( cursor: Cursor, e?: any, keepRange: boolean = false, flags: number = CodeEditor.SELECTION_X_Y )\r\n {\r\n const isMouseEvent = e && ( e.constructor == MouseEvent );\r\n\r\n if ( isMouseEvent )\r\n {\r\n this.processClick( e );\r\n }\r\n\r\n if ( !cursor.selection )\r\n {\r\n this.startSelection( cursor );\r\n }\r\n\r\n const selection = cursor.selection!;\r\n\r\n this._hideActiveLine();\r\n\r\n // Update selection\r\n if ( !keepRange )\r\n {\r\n let ccw = true;\r\n\r\n // Check if we must change ccw or not ... (not with mouse)\r\n if ( !isMouseEvent && cursor.line >= selection.fromY\r\n && ( cursor.line == selection.fromY ? cursor.position >= selection.fromX : true ) )\r\n {\r\n ccw = e && this._lastSelectionKeyDir\r\n && ( e.key == 'ArrowRight' || e.key == 'ArrowDown' || e.key == 'End' );\r\n }\r\n\r\n if ( ccw )\r\n {\r\n if ( flags & CodeEditor.SELECTION_X ) selection.fromX = cursor.position;\r\n if ( flags & CodeEditor.SELECTION_Y ) selection.fromY = cursor.line;\r\n }\r\n else\r\n {\r\n if ( flags & CodeEditor.SELECTION_X ) selection.toX = cursor.position;\r\n if ( flags & CodeEditor.SELECTION_Y ) selection.toY = cursor.line;\r\n }\r\n\r\n this._lastSelectionKeyDir = ccw;\r\n }\r\n\r\n // Only leave if not a mouse selection...\r\n if ( !isMouseEvent && selection.isEmpty() )\r\n {\r\n this.endSelection();\r\n return;\r\n }\r\n\r\n selection.chars = 0;\r\n\r\n const fromX = selection.fromX,\r\n fromY = selection.fromY,\r\n toX = selection.toX,\r\n toY = selection.toY;\r\n const deltaY = toY - fromY;\r\n\r\n let cursorSelections = this.selections[cursor.name];\r\n\r\n // Selection goes down...\r\n if ( deltaY >= 0 )\r\n {\r\n while ( deltaY < ( cursorSelections.childElementCount - 1 ) )\r\n {\r\n LX.deleteElement( cursorSelections.lastChild );\r\n }\r\n\r\n for ( let i = fromY; i <= toY; i++ )\r\n {\r\n const sId = i - fromY;\r\n const isVisible = i >= this.visibleLinesViewport.x && i <= this.visibleLinesViewport.y;\r\n let domEl = null;\r\n\r\n if ( isVisible )\r\n {\r\n // Make sure that the line selection is generated...\r\n domEl = cursorSelections.childNodes[sId];\r\n if ( !domEl )\r\n {\r\n domEl = document.createElement( 'div' );\r\n domEl.className = 'lexcodeselection';\r\n cursorSelections.appendChild( domEl );\r\n }\r\n }\r\n\r\n // Compute new width and selection margins\r\n let string = '';\r\n\r\n if ( sId == 0 )\r\n { // First line 2 cases (single line, multiline)\r\n const reverse = fromX > toX;\r\n if ( deltaY == 0 )\r\n {\r\n string = !reverse\r\n ? this.code.lines[i].substring( fromX, toX )\r\n : this.code.lines[i].substring( toX, fromX );\r\n }\r\n else string = this.code.lines[i].substr( fromX );\r\n const pixels = ( reverse && deltaY == 0 ? toX : fromX ) * this.charWidth;\r\n if ( isVisible ) domEl.style.left = `calc(${pixels}px + ${this.xPadding})`;\r\n }\r\n else\r\n {\r\n string = ( i == toY ) ? this.code.lines[i].substring( 0, toX ) : this.code.lines[i]; // Last line, any multiple line...\r\n if ( isVisible ) domEl.style.left = this.xPadding;\r\n }\r\n\r\n const stringWidth = this.measureString( string );\r\n selection.chars += stringWidth / this.charWidth;\r\n\r\n if ( isVisible )\r\n {\r\n domEl.style.width = ( stringWidth || ( deltaY == 0 ? 0 : 8 ) ) + 'px';\r\n domEl._top = i * this.lineHeight;\r\n domEl.style.top = domEl._top + 'px';\r\n }\r\n }\r\n }\r\n // Selection goes up...\r\n else\r\n {\r\n while ( Math.abs( deltaY ) < ( cursorSelections.childElementCount - 1 ) )\r\n {\r\n LX.deleteElement( cursorSelections.firstChild );\r\n }\r\n\r\n for ( let i = toY; i <= fromY; i++ )\r\n {\r\n const sId = i - toY;\r\n const isVisible = i >= this.visibleLinesViewport.x && i <= this.visibleLinesViewport.y;\r\n let domEl = null;\r\n\r\n if ( isVisible )\r\n {\r\n // Make sure that the line selection is generated...\r\n domEl = cursorSelections.childNodes[sId];\r\n if ( !domEl )\r\n {\r\n domEl = document.createElement( 'div' );\r\n domEl.className = 'lexcodeselection';\r\n cursorSelections.appendChild( domEl );\r\n }\r\n }\r\n\r\n // Compute new width and selection margins\r\n let string;\r\n\r\n if ( sId == 0 )\r\n {\r\n string = this.code.lines[i].substr( toX );\r\n const pixels = toX * this.charWidth;\r\n if ( isVisible ) domEl.style.left = 'calc(' + pixels + 'px + ' + this.xPadding + ')';\r\n }\r\n else\r\n {\r\n string = ( i == fromY ) ? this.code.lines[i].substring( 0, fromX ) : this.code.lines[i]; // Last line, any multiple line...\r\n if ( isVisible ) domEl.style.left = this.xPadding;\r\n }\r\n\r\n const stringWidth = this.measureString( string );\r\n selection.chars += stringWidth / this.charWidth;\r\n\r\n if ( isVisible )\r\n {\r\n domEl.style.width = ( stringWidth || 8 ) + 'px';\r\n domEl._top = i * this.lineHeight;\r\n domEl.style.top = domEl._top + 'px';\r\n }\r\n }\r\n }\r\n }\r\n\r\n async processKey( e: KeyboardEvent )\r\n {\r\n const numCursors = this.cursors.length;\r\n\r\n if ( !this.code || e.target?.constructor != HTMLDivElement )\r\n {\r\n return;\r\n }\r\n\r\n const detail = ( e as any ).detail ?? {};\r\n const key = e.key ?? detail.key;\r\n\r\n // Don't propagate \"space to scroll\" event\r\n if ( key == ' ' )\r\n {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n }\r\n\r\n const target = detail.targetCursor;\r\n\r\n // Global keys\r\n\r\n if ( this._processGlobalKeys( e, key ) )\r\n {\r\n // Stop propagation..\r\n return;\r\n }\r\n\r\n // By cursor keys\r\n\r\n if ( target !== undefined )\r\n {\r\n this.processKeyAtTargetCursor( e, key, target );\r\n return;\r\n }\r\n\r\n this._lastProcessedCursorIndex = null;\r\n this._nextCursorPositionOffset = 0;\r\n\r\n var lastProcessedCursor = null;\r\n var cursorOffset = new LX.vec2( 0, 0 );\r\n\r\n for ( var i = 0; i < numCursors; i++ )\r\n {\r\n let cursor = this.cursors[i];\r\n\r\n // We could delete secondary cursor while iterating..\r\n if ( !cursor )\r\n {\r\n break;\r\n }\r\n\r\n // Arrows don't modify code lines.. And only add offset if in the same line\r\n if ( lastProcessedCursor && lastProcessedCursor.line == cursor.line && !key.includes( 'Arrow' ) )\r\n {\r\n cursor.position += cursorOffset.x;\r\n cursor.line += cursorOffset.y;\r\n\r\n this.relocateCursors();\r\n\r\n // Apart from relocation based on offsets, its selection (if any) must be relocated too\r\n if ( cursor.selection )\r\n {\r\n cursor.selection.fromX += cursorOffset.x;\r\n cursor.selection.toX += cursorOffset.x;\r\n cursor.selection.fromY += cursorOffset.y;\r\n cursor.selection.toY += cursorOffset.y;\r\n\r\n this._processSelection( cursor );\r\n }\r\n }\r\n else if ( lastProcessedCursor && lastProcessedCursor.line != cursor.line )\r\n {\r\n // Reset offset X in case we changed line\r\n cursorOffset.x = 0;\r\n }\r\n\r\n lastProcessedCursor = this.saveCursor( cursor );\r\n this._lastProcessedCursorIndex = i;\r\n\r\n this._processKeyAtCursor( e, key, cursor );\r\n\r\n // Apply difference offset between last processed cursor and current positions plus any offset generated\r\n // during processing the key pressed\r\n const totalCursorOffsetX = ( cursor.position - lastProcessedCursor.position ) + this._nextCursorPositionOffset;\r\n const totalCursorOffsetY = cursor.line - lastProcessedCursor.line;\r\n\r\n cursorOffset.x += totalCursorOffsetX;\r\n cursorOffset.y += totalCursorOffsetY;\r\n\r\n // Set active line in case it's blurred\r\n if ( !cursor.selection )\r\n {\r\n cursor.line = cursor.line;\r\n }\r\n }\r\n\r\n // Clear tmp\r\n delete this._nextCursorPositionOffset;\r\n delete this._lastProcessedCursorIndex;\r\n }\r\n\r\n async processKeyAtTargetCursor( e: KeyboardEvent, key: string, targetIdx: number )\r\n {\r\n let cursor = this.cursors[targetIdx];\r\n\r\n // We could delete secondary cursor while iterating..\r\n if ( !cursor )\r\n {\r\n return;\r\n }\r\n\r\n this._processKeyAtCursor( e, key, cursor );\r\n this._processGlobalKeys( e, key );\r\n }\r\n\r\n _processGlobalKeys( e: KeyboardEvent, key: string )\r\n {\r\n let cursor = this.getCurrentCursor();\r\n\r\n if ( e.ctrlKey || e.metaKey )\r\n {\r\n switch ( key.toLowerCase() )\r\n {\r\n case 'a': // select all\r\n e.preventDefault();\r\n this.selectAll();\r\n return true;\r\n case 'b': // k+b comment block\r\n e.preventDefault();\r\n if ( this.state.keyChain == 'k' )\r\n {\r\n this._commentLines( cursor, true );\r\n return true;\r\n }\r\n return false;\r\n case 'c': // k+c, comment line\r\n e.preventDefault();\r\n if ( this.state.keyChain == 'k' )\r\n {\r\n this._commentLines( cursor );\r\n return true;\r\n }\r\n return false;\r\n case 'd': // next ocurrence\r\n e.preventDefault();\r\n this.selectNextOcurrence( cursor );\r\n return true;\r\n case 'f': // find/search\r\n e.preventDefault();\r\n this.showSearchBox();\r\n return true;\r\n case 'g': // find line\r\n e.preventDefault();\r\n this.showSearchLineBox();\r\n return true;\r\n case 'k': // shortcut chain\r\n e.preventDefault();\r\n this.state.keyChain = 'k';\r\n return true;\r\n case 's': // save\r\n e.preventDefault();\r\n if ( this.onSave )\r\n {\r\n this.onSave( this.getText() );\r\n }\r\n return true;\r\n case 'u': // k+u, uncomment line\r\n e.preventDefault();\r\n if ( this.state.keyChain == 'k' )\r\n {\r\n this._uncommentLines( cursor );\r\n return true;\r\n }\r\n return false;\r\n case 'y': // redo\r\n e.preventDefault();\r\n this._doRedo( cursor );\r\n return true;\r\n case 'z': // undo\r\n e.preventDefault();\r\n this._doUndo( cursor );\r\n return true;\r\n case '+': // increase size\r\n e.preventDefault();\r\n this._increaseFontSize();\r\n return true;\r\n case '-': // decrease size\r\n e.preventDefault();\r\n this._decreaseFontSize();\r\n return true;\r\n case ' ': // custom event\r\n if ( this.onCtrlSpace )\r\n {\r\n e.preventDefault();\r\n this.onCtrlSpace( cursor );\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n this.state.keyChain = null;\r\n return false;\r\n }\r\n\r\n async _processKeyAtCursor( e: KeyboardEvent, key: string, cursor: Cursor )\r\n {\r\n const detail = ( e as any ).detail ?? {};\r\n const skipUndo = detail.skipUndo ?? false;\r\n const skipDeleteSelection = detail.skipDeleteSelection ?? false;\r\n\r\n // keys with length > 1 are probably special keys\r\n if ( key.length > 1 && this.specialKeys.indexOf( key ) == -1 )\r\n {\r\n return;\r\n }\r\n\r\n let lidx = cursor.line;\r\n this.code.lines[lidx] = this.code.lines[lidx] ?? '';\r\n\r\n // Check combinations\r\n\r\n const isLastCursor = cursor.isLast();\r\n\r\n if ( e.ctrlKey || e.metaKey )\r\n {\r\n switch ( key.toLowerCase() )\r\n {\r\n case 'c': // copy\r\n this._copyContent( cursor );\r\n return;\r\n case 'v': // paste\r\n this._pasteContent( cursor );\r\n return;\r\n case 'x': // cut line\r\n this._cutContent( cursor );\r\n this.hideAutoCompleteBox();\r\n return;\r\n case 'arrowdown': // add cursor below only for the main cursor..\r\n // Make sure shift is not pressed..\r\n if ( !e.shiftKey && isLastCursor && this.code.lines[lidx + 1] != undefined )\r\n {\r\n var newCursor: Cursor | null = this._addCursor( cursor.line, cursor.position, true );\r\n if ( !newCursor ) return;\r\n this.lineDown( newCursor );\r\n return;\r\n }\r\n }\r\n }\r\n else if ( e.altKey )\r\n {\r\n switch ( key )\r\n {\r\n case 'd': // duplicate line\r\n e.preventDefault();\r\n this._duplicateLine( lidx, cursor );\r\n return;\r\n case 'ArrowUp':\r\n this.swapLines( lidx, -1, cursor );\r\n return;\r\n case 'ArrowDown':\r\n this.swapLines( lidx, 1, cursor );\r\n return;\r\n }\r\n }\r\n\r\n // Apply binded actions...\r\n\r\n for ( const actKey in this.actions )\r\n {\r\n if ( key != actKey )\r\n {\r\n continue;\r\n }\r\n\r\n e.preventDefault();\r\n\r\n if ( this._actionMustDelete( cursor, this.actions[key], e ) )\r\n {\r\n this.actions['Backspace'].callback( lidx, cursor, e );\r\n }\r\n\r\n return this.actions[key].callback( lidx, cursor, e );\r\n }\r\n\r\n // From now on, don't allow ctrl, shift or meta (mac) combinations\r\n if ( e.ctrlKey || e.metaKey )\r\n {\r\n return;\r\n }\r\n\r\n // Add undo steps\r\n\r\n if ( !skipUndo && this.code.lines.length )\r\n {\r\n this._addUndoStep( cursor );\r\n }\r\n\r\n // Some custom cases for word enclosing (), {}, \"\", '', ...\r\n\r\n const enclosableKeys = [ '\"', \"'\", '(', '{' ];\r\n if ( enclosableKeys.indexOf( key ) > -1 )\r\n {\r\n if ( this._encloseSelectedWordWithKey( key, lidx, cursor ) )\r\n {\r\n return;\r\n }\r\n }\r\n\r\n // Until this point, if there was a selection, we need\r\n // to delete the content..\r\n\r\n if ( cursor.selection && !skipDeleteSelection )\r\n {\r\n this.actions['Backspace'].callback( lidx, cursor, e );\r\n lidx = cursor.line;\r\n }\r\n\r\n // Append key\r\n\r\n const nextChar = this.getCharAtPos( cursor ); // Only pair keys if no next char or its a space\r\n const isPairKey = ( Object.values( this.pairKeys ).indexOf( key ) > -1 ) && !this.wasKeyPaired;\r\n const sameKeyNext = isPairKey && ( nextChar === key );\r\n\r\n if ( !sameKeyNext )\r\n {\r\n this.code.lines[lidx] = [\r\n this.code.lines[lidx].slice( 0, cursor.position ),\r\n key,\r\n this.code.lines[lidx].slice( cursor.position )\r\n ].join( '' );\r\n }\r\n\r\n this.cursorToRight( key, cursor );\r\n\r\n // Some custom cases for auto key pair (), {}, \"\", '', ...\r\n\r\n const keyMustPair = ( this.pairKeys[key] !== undefined ) && ( !nextChar || /\\s/.test( nextChar ) );\r\n if ( keyMustPair && !this.wasKeyPaired )\r\n {\r\n // Make sure to detect later that the key is paired automatically to avoid loops...\r\n this.wasKeyPaired = true;\r\n\r\n if ( sameKeyNext ) return;\r\n\r\n this.root.dispatchEvent( new KeyboardEvent( 'keydown', { 'key': this.pairKeys[key] } ) );\r\n this.cursorToLeft( key, cursor );\r\n return;\r\n }\r\n\r\n // Once here we can pair keys again\r\n delete this.wasKeyPaired;\r\n\r\n // Update only the current line, since it's only an appended key\r\n this.processLine( lidx );\r\n\r\n // We are out of the viewport and max length is different? Resize scrollbars...\r\n this.resizeIfNecessary( cursor );\r\n\r\n // Manage autocomplete\r\n\r\n if ( this.useAutoComplete )\r\n {\r\n this.showAutoCompleteBox( key, cursor );\r\n }\r\n }\r\n\r\n async _pasteContent( cursor: Cursor )\r\n {\r\n const mustDetectLanguage = !this.getText().length;\r\n\r\n let text = await navigator.clipboard.readText();\r\n\r\n // Remove any possible tabs (\\t) and add spaces\r\n text = text.replaceAll( /\\t|\\\\t/g, ' '.repeat( this.tabSpaces ) );\r\n\r\n this._addUndoStep( cursor, true );\r\n\r\n this.appendText( text, cursor );\r\n\r\n const currentScroll = this.getScrollTop();\r\n const scroll = Math.max( cursor.line * this.lineHeight - this.codeScroller.offsetWidth, 0 );\r\n\r\n if ( currentScroll < scroll )\r\n {\r\n this.codeScroller.scrollTo( 0, cursor.line * this.lineHeight );\r\n }\r\n\r\n if ( mustDetectLanguage )\r\n {\r\n const detectedLang = this._detectLanguage( text );\r\n if ( detectedLang )\r\n {\r\n this._changeLanguage( detectedLang );\r\n }\r\n }\r\n }\r\n\r\n async _copyContent( cursor: Cursor )\r\n {\r\n let textToCopy = '';\r\n\r\n if ( !cursor.selection )\r\n {\r\n textToCopy = '\\n' + this.code.lines[cursor.line];\r\n }\r\n else\r\n {\r\n // Some selections don't depend on mouse up..\r\n if ( cursor.selection ) cursor.selection.invertIfNecessary();\r\n\r\n const separator = '_NEWLINE_';\r\n let code = this.code.lines.join( separator );\r\n\r\n // Get linear start index\r\n let index = 0;\r\n\r\n for ( let i = 0; i <= cursor.selection.fromY; i++ )\r\n {\r\n index += i == cursor.selection.fromY ? cursor.selection.fromX : this.code.lines[i].length;\r\n }\r\n\r\n index += cursor.selection.fromY * separator.length;\r\n const num_chars = cursor.selection.chars\r\n + ( cursor.selection.toY - cursor.selection.fromY ) * separator.length;\r\n const text = code.substr( index, num_chars );\r\n const lines = text.split( separator );\r\n textToCopy = lines.join( '\\n' );\r\n }\r\n\r\n navigator.clipboard.writeText( textToCopy );\r\n // .then(() => console.log(\"Successfully copied\"), (err) => console.error(\"Error\"));\r\n }\r\n\r\n async _cutContent( cursor: Cursor )\r\n {\r\n let lidx = cursor.line;\r\n let textToCut = '';\r\n\r\n this._addUndoStep( cursor, true );\r\n\r\n if ( !cursor.selection )\r\n {\r\n textToCut = '\\n' + this.code.lines[cursor.line];\r\n this.code.lines.splice( lidx, 1 );\r\n this.processLines();\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor );\r\n if ( this.code.lines[lidx] == undefined )\r\n {\r\n this.lineUp( cursor );\r\n }\r\n }\r\n else\r\n {\r\n // Some selections don't depend on mouse up..\r\n if ( cursor.selection ) cursor.selection.invertIfNecessary();\r\n\r\n const separator = '_NEWLINE_';\r\n let code = this.code.lines.join( separator );\r\n\r\n // Get linear start index\r\n let index = 0;\r\n\r\n for ( let i = 0; i <= cursor.selection.fromY; i++ )\r\n {\r\n index += i == cursor.selection.fromY ? cursor.selection.fromX : this.code.lines[i].length;\r\n }\r\n\r\n index += cursor.selection.fromY * separator.length;\r\n const numChars = cursor.selection.chars\r\n + ( cursor.selection.toY - cursor.selection.fromY ) * separator.length;\r\n const text = code.substr( index, numChars );\r\n const lines = text.split( separator );\r\n textToCut = lines.join( '\\n' );\r\n\r\n this.deleteSelection( cursor );\r\n }\r\n\r\n navigator.clipboard.writeText( textToCut );\r\n // .then(() => console.log(\"Successfully cut\"), (err) => console.error(\"Error\"));\r\n }\r\n\r\n _duplicateLine( lidx: number, cursor: Cursor )\r\n {\r\n this.endSelection();\r\n this._addUndoStep( cursor, true );\r\n this.code.lines.splice( lidx, 0, this.code.lines[lidx] );\r\n this.lineDown( cursor );\r\n this.processLines();\r\n this.hideAutoCompleteBox();\r\n }\r\n\r\n _commentLines( cursor: Cursor, useCommentBlock: boolean = false )\r\n {\r\n const lang = CodeEditor.languages[this.highlight];\r\n\r\n this.state.keyChain = null;\r\n\r\n cursor = cursor ?? this.getCurrentCursor();\r\n\r\n if ( cursor.selection )\r\n {\r\n if ( !( ( useCommentBlock ? lang.blockComments : lang.singleLineComments ) ?? true ) )\r\n {\r\n return;\r\n }\r\n\r\n this._addUndoStep( cursor, true );\r\n\r\n const selectedLines = this.code.lines.slice( cursor.selection.fromY, cursor.selection.toY + 1 );\r\n const minIdx = Math.min( ...selectedLines.map( ( v: string ) => {\r\n var idx = firstNonspaceIndex( v );\r\n return idx < 0 ? 1e10 : idx;\r\n } ) );\r\n\r\n if ( useCommentBlock )\r\n {\r\n const tokens = lang.blockCommentsTokens ?? this.defaultBlockCommentTokens;\r\n\r\n const fromString = this.code.lines[cursor.selection.fromY];\r\n let fromIdx = firstNonspaceIndex( fromString );\r\n if ( fromIdx == -1 )\r\n {\r\n fromIdx = 0;\r\n }\r\n\r\n this.code.lines[cursor.selection.fromY] = [\r\n fromString.substring( 0, fromIdx ),\r\n tokens[0] + ' ',\r\n fromString.substring( fromIdx )\r\n ].join( '' );\r\n\r\n this.code.lines[cursor.selection.toY] += ' ' + tokens[1];\r\n\r\n cursor.selection.fromX += tokens[0].length + 1;\r\n this._processSelection( cursor );\r\n }\r\n else\r\n {\r\n for ( let i = cursor.selection.fromY; i <= cursor.selection.toY; ++i )\r\n {\r\n this._commentLine( cursor, i, minIdx, false );\r\n }\r\n\r\n const token = ( lang.singleLineCommentToken ?? this.defaultSingleLineCommentToken ) + ' ';\r\n this.cursorToString( cursor, token );\r\n\r\n cursor.selection.fromX += token.length;\r\n cursor.selection.toX += token.length;\r\n this._processSelection( cursor );\r\n }\r\n }\r\n else\r\n {\r\n if ( !( lang.singleLineComments ?? true ) )\r\n {\r\n return;\r\n }\r\n\r\n for ( const cr of this.cursors )\r\n {\r\n this._addUndoStep( cr, true );\r\n this._commentLine( cr, cr.line );\r\n }\r\n }\r\n\r\n this.processLines();\r\n this._hideActiveLine();\r\n }\r\n\r\n _commentLine( cursor: Cursor, line: number, minNonspaceIdx?: number, updateCursor = true )\r\n {\r\n const lang = CodeEditor.languages[this.highlight];\r\n if ( !( lang.singleLineComments ?? true ) )\r\n {\r\n return;\r\n }\r\n\r\n const token = ( lang.singleLineCommentToken ?? this.defaultSingleLineCommentToken ) + ' ';\r\n const string = this.code.lines[line];\r\n\r\n let idx = firstNonspaceIndex( string );\r\n if ( idx == -1 )\r\n {\r\n return;\r\n }\r\n\r\n // Update idx using min of the selected lines (if necessary..)\r\n idx = minNonspaceIdx ?? idx;\r\n\r\n this.code.lines[line] = [\r\n string.substring( 0, idx ),\r\n token,\r\n string.substring( idx )\r\n ].join( '' );\r\n\r\n if ( updateCursor )\r\n {\r\n this.cursorToString( cursor, token );\r\n }\r\n }\r\n\r\n _uncommentLines( cursor: Cursor )\r\n {\r\n this.state.keyChain = null;\r\n\r\n const currCursor = this.getCurrentCursor();\r\n\r\n if ( currCursor.selection !== null )\r\n {\r\n this._addUndoStep( cursor, true );\r\n\r\n for ( var i = currCursor.selection.fromY; i <= currCursor.selection.toY; ++i )\r\n {\r\n this._uncommentLine( cursor, i );\r\n }\r\n }\r\n else\r\n {\r\n for ( let cursor of this.cursors )\r\n {\r\n this._addUndoStep( cursor, true );\r\n this._uncommentLine( cursor, cursor.line );\r\n }\r\n }\r\n\r\n this.processLines();\r\n this._hideActiveLine();\r\n }\r\n\r\n _uncommentLine( cursor: Cursor, line: number )\r\n {\r\n const lang = CodeEditor.languages[this.highlight];\r\n\r\n if ( !( lang.singleLineComments ?? true ) )\r\n {\r\n return;\r\n }\r\n\r\n const token = lang.singleLineCommentToken ?? this.defaultSingleLineCommentToken;\r\n const string = this.code.lines[line];\r\n\r\n if ( string.includes( token ) )\r\n {\r\n this.code.lines[line] = string.replace( token + ' ', '' );\r\n\r\n // try deleting token + space, and then if not, delete only the token\r\n if ( string.length == this.code.lines[line].length )\r\n {\r\n this.code.lines[line] = string.replace( token, '' );\r\n }\r\n\r\n this.cursorToString( cursor, 'X'.repeat( Math.abs( string.length - this.code.lines[line].length ) ), true );\r\n }\r\n }\r\n\r\n action( key: string, deleteSelection: boolean = false, fn?: ( l: number, cursor: Cursor, e: any ) => void, eventSkipDeleteFn?: any )\r\n {\r\n this.actions[key] = {\r\n 'key': key,\r\n 'callback': fn,\r\n 'deleteSelection': deleteSelection,\r\n 'eventSkipDeleteFn': eventSkipDeleteFn\r\n };\r\n }\r\n\r\n _actionMustDelete( cursor: Cursor, action: any, e: any )\r\n {\r\n return cursor.selection && action.deleteSelection\r\n && !( action.eventSkipDeleteFn ? action.eventSkipDeleteFn( cursor, e ) : false );\r\n }\r\n\r\n scanWordSuggestions()\r\n {\r\n this.code.tokens = {};\r\n\r\n for ( let i = 0; i < this.code.lines.length; ++i )\r\n {\r\n const lineString = this.code.lines[i];\r\n const tokens = this._getTokensFromLine( lineString, true );\r\n tokens.forEach( ( t: string ) => this.code.tokens[t] = 1 );\r\n }\r\n }\r\n\r\n toLocalLine( line: number )\r\n {\r\n const d = Math.max( this.firstLineInViewport - this.lineScrollMargin.x, 0 );\r\n return Math.min( Math.max( line - d, 0 ), this.code.lines.length - 1 );\r\n }\r\n\r\n getMaxLineLength()\r\n {\r\n return Math.max( ...this.code.lines.map( ( v: string ) => v.length ) );\r\n }\r\n\r\n _processLinesIfNecessary()\r\n {\r\n if ( this.mustProcessLines )\r\n {\r\n this.mustProcessLines = false;\r\n this.processLines();\r\n }\r\n }\r\n\r\n processLines( mode?: number )\r\n {\r\n if ( !this.code )\r\n {\r\n return;\r\n }\r\n\r\n var htmlCode = '';\r\n this._blockCommentCache.length = 0;\r\n this.mustProcessLines = false;\r\n\r\n // Reset all lines content\r\n this.code.innerHTML = '';\r\n\r\n // Get info about lines in viewport\r\n const lastScrollTop = this.getScrollTop();\r\n this.firstLineInViewport = ( mode ?? CodeEditor.KEEP_VISIBLE_LINES ) & CodeEditor.UPDATE_VISIBLE_LINES\r\n ? ( ( lastScrollTop / this.lineHeight ) | 0 )\r\n : this.firstLineInViewport;\r\n const totalLinesInViewport = ( ( this.codeScroller.offsetHeight ) / this.lineHeight ) | 0;\r\n this.visibleLinesViewport = new LX.vec2(\r\n Math.max( this.firstLineInViewport - this.lineScrollMargin.x, 0 ),\r\n Math.min( this.firstLineInViewport + totalLinesInViewport + this.lineScrollMargin.y, this.code.lines.length )\r\n );\r\n\r\n // Add remaining lines if we are near the end of the scroll\r\n {\r\n const diff = Math.max( this.code.lines.length - this.visibleLinesViewport.y, 0 );\r\n if ( diff <= this.lineScrollMargin.y )\r\n {\r\n this.visibleLinesViewport.y += diff;\r\n }\r\n }\r\n\r\n this._scopeStack = [ { name: '', type: 'global' } ];\r\n\r\n // Process visible lines\r\n for ( let i = this.visibleLinesViewport.x; i < this.visibleLinesViewport.y; ++i )\r\n {\r\n htmlCode += this.processLine( i, true );\r\n }\r\n\r\n this.code.innerHTML = htmlCode;\r\n\r\n // Update scroll data\r\n this.codeScroller.scrollTop = lastScrollTop;\r\n this.code.style.top = ( this.visibleLinesViewport.x * this.lineHeight ) + 'px';\r\n\r\n // Update selections\r\n this.updateSelections( null, true );\r\n\r\n this._clearTmpVariables();\r\n this._setActiveLine();\r\n this.resize();\r\n }\r\n\r\n processLine( lineNumber: number, force: boolean = false, skipPropagation: boolean = false )\r\n {\r\n if ( this._scopeStack )\r\n {\r\n this.code.lineScopes[lineNumber] = [ ...this._scopeStack ];\r\n }\r\n else\r\n {\r\n this.code.lineScopes[lineNumber] = this.code.lineScopes[lineNumber] ?? [];\r\n this._scopeStack = [ ...this.code.lineScopes[lineNumber] ];\r\n }\r\n\r\n const lang = CodeEditor.languages[this.highlight];\r\n const localLineNum = this.toLocalLine( lineNumber );\r\n const lineString = this.code.lines[lineNumber];\r\n if ( lineString === undefined )\r\n {\r\n return;\r\n }\r\n\r\n this._lastProcessedLine = lineNumber;\r\n\r\n // multi-line strings not supported by now\r\n delete this._buildingString;\r\n delete this._pendingString;\r\n delete this._markdownHeader;\r\n\r\n // Single line\r\n if ( !force )\r\n {\r\n LX.deleteElement( this.code.childNodes[localLineNum] );\r\n LX.insertChildAtIndex( this.code, document.createElement( 'pre' ), localLineNum );\r\n }\r\n\r\n // Early out check for no highlighting languages\r\n if ( this.highlight == 'Plain Text' )\r\n {\r\n const plainTextHtml = lineString.replaceAll( '<', '<' ).replaceAll( '>', '>' );\r\n return this._updateLine( force, lineNumber, plainTextHtml, skipPropagation );\r\n }\r\n\r\n this._currentLineNumber = lineNumber;\r\n this._currentLineString = lineString;\r\n\r\n const tokensToEvaluate = this._getTokensFromLine( lineString );\r\n if ( !tokensToEvaluate.length )\r\n {\r\n return this._updateLine( force, lineNumber, '', skipPropagation );\r\n }\r\n\r\n let lineInnerHtml = '';\r\n let pushedScope = false;\r\n\r\n const newSignature = this._getLineSignatureFromTokens( tokensToEvaluate );\r\n const cachedSignature = this.code.lineSignatures[lineNumber];\r\n const mustUpdateScopes = ( cachedSignature !== newSignature ) && !force;\r\n const blockComments = lang.blockComments ?? true;\r\n const blockCommentsTokens = lang.blockCommentsTokens ?? this.defaultBlockCommentTokens;\r\n\r\n // Reset scope stack if structural changes in current line\r\n if ( mustUpdateScopes )\r\n {\r\n this._scopeStack = [ { name: '', type: 'global' } ];\r\n }\r\n\r\n // Process all tokens\r\n for ( let i = 0; i < tokensToEvaluate.length; ++i )\r\n {\r\n let it = i - 1;\r\n let prev = tokensToEvaluate[it];\r\n while ( prev == ' ' )\r\n {\r\n it--;\r\n prev = tokensToEvaluate[it];\r\n }\r\n\r\n it = i + 1;\r\n let next = tokensToEvaluate[it];\r\n while ( next == ' ' || next == '\"' )\r\n {\r\n it++;\r\n next = tokensToEvaluate[it];\r\n }\r\n\r\n const token = tokensToEvaluate[i];\r\n const tokenIndex = i;\r\n const tokenStartIndex = this._currentTokenPositions[tokenIndex];\r\n\r\n if ( blockComments )\r\n {\r\n if ( token.substr( 0, blockCommentsTokens[0].length ) == blockCommentsTokens[0] )\r\n {\r\n this._buildingBlockComment = [ lineNumber, tokenStartIndex ];\r\n }\r\n }\r\n\r\n // Compare line signature for structural changes\r\n // to pop current scope if necessary\r\n if ( token === '}' && this._scopeStack.length > 1 )\r\n {\r\n this._scopeStack.pop();\r\n }\r\n\r\n lineInnerHtml += this._evaluateToken( {\r\n token,\r\n prev,\r\n prevWithSpaces: tokensToEvaluate[i - 1],\r\n next,\r\n nextWithSpaces: tokensToEvaluate[i + 1],\r\n tokenIndex,\r\n isFirstToken: ( tokenIndex == 0 ),\r\n isLastToken: ( tokenIndex == tokensToEvaluate.length - 1 ),\r\n tokens: tokensToEvaluate\r\n } );\r\n\r\n if ( blockComments && this._buildingBlockComment != undefined\r\n && token.substr( 0, blockCommentsTokens[1].length ) == blockCommentsTokens[1] )\r\n {\r\n const [ commentLineNumber, tokenPos ] = this._buildingBlockComment;\r\n this._blockCommentCache.push( [ new LX.vec2( commentLineNumber, lineNumber ), new LX.vec2( tokenPos, tokenStartIndex ) ] );\r\n delete this._buildingBlockComment;\r\n }\r\n\r\n if ( token !== '{' )\r\n {\r\n continue;\r\n }\r\n\r\n // Store current scopes\r\n\r\n let contextTokens = [\r\n ...this._getTokensFromLine( this.code.lines[lineNumber].substring( 0, tokenStartIndex ) )\r\n ];\r\n\r\n // Add token context from above lines in case we don't have information\r\n // in the same line to get the scope data\r\n if ( !prev )\r\n {\r\n for ( let k = 1; k < 50; k++ )\r\n {\r\n let kLineString = this.code.lines[lineNumber - k];\r\n if ( !kLineString )\r\n {\r\n break;\r\n }\r\n\r\n const openIdx = kLineString.lastIndexOf( '{' );\r\n const closeIdx = kLineString.lastIndexOf( '}' );\r\n if ( openIdx > -1 )\r\n {\r\n kLineString = kLineString.substr( openIdx );\r\n }\r\n else if ( closeIdx > -1 )\r\n {\r\n kLineString = kLineString.substr( closeIdx );\r\n }\r\n\r\n contextTokens = [ ...this._getTokensFromLine( kLineString ), ...contextTokens ];\r\n\r\n if ( kLineString.length !== this.code.lines[lineNumber - k] )\r\n {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n contextTokens = contextTokens.reverse().filter( ( v ) => v.length && v != ' ' );\r\n\r\n // Keywords that can open a *named* scope\r\n // TODO: Do this per language\r\n const scopeKeywords = [ 'class', 'enum', 'function', 'interface', 'type', 'struct', 'namespace' ];\r\n\r\n let scopeType = null; // This is the type of scope (function, class, enum, etc)\r\n let scopeName = null;\r\n\r\n for ( let i = 0; i < contextTokens.length; i++ )\r\n {\r\n const t = contextTokens[i];\r\n\r\n if ( scopeKeywords.includes( t ) )\r\n {\r\n scopeType = t;\r\n scopeName = contextTokens[i - 1]; // usually right before the keyword in reversed array\r\n break;\r\n }\r\n }\r\n\r\n // Special case: enum type specification `enum Foo : int {`\r\n if ( scopeType === 'enum' && contextTokens.includes( ':' ) )\r\n {\r\n const colonIndex = contextTokens.indexOf( ':' );\r\n scopeName = contextTokens[colonIndex + 1] || scopeName;\r\n }\r\n\r\n if ( !scopeType )\r\n {\r\n const parOpenIndex = contextTokens.indexOf( '(' );\r\n scopeName = contextTokens[parOpenIndex + 1] || scopeName;\r\n\r\n if ( scopeName )\r\n {\r\n scopeType = 'method';\r\n }\r\n }\r\n\r\n // Only push if it's not already reflected in the cached scopes\r\n const lastScope = this._scopeStack.at( -1 );\r\n if ( lastScope?.lineNumber !== lineNumber )\r\n {\r\n this._scopeStack.push( { name: scopeName ?? '', type: scopeType ?? 'anonymous', lineNumber } );\r\n }\r\n\r\n pushedScope = true;\r\n }\r\n\r\n // Update scopes cache\r\n this.code.lineScopes[lineNumber] = [ ...this._scopeStack ];\r\n\r\n const symbols = this._parseLineForSymbols( lineNumber, lineString, tokensToEvaluate, pushedScope );\r\n\r\n return this._updateLine( force, lineNumber, lineInnerHtml, skipPropagation, symbols, tokensToEvaluate );\r\n }\r\n\r\n _getLineSignatureFromTokens( tokens: string[] )\r\n {\r\n const structuralChars = new Set( [ '{', '}' ] );\r\n const sign = tokens.filter( ( t ) => structuralChars.has( t ) );\r\n return sign.join( '_' );\r\n }\r\n\r\n _updateBlockComments( section: any, lineNumber: number, tokens: string[] )\r\n {\r\n const lang = CodeEditor.languages[this.highlight];\r\n const blockCommentsTokens = lang.blockCommentsTokens ?? this.defaultBlockCommentTokens;\r\n const lineOpensBlock = section[0].x === lineNumber;\r\n const lineClosesBlock = section[0].y === lineNumber;\r\n const lineInsideBlock = ( section[0].x !== lineNumber ) && ( section[0].y !== lineNumber );\r\n\r\n delete this._buildingBlockComment;\r\n\r\n /*\r\n Check if delimiters have been removed and process lines backwards/forward\r\n until reaching new delimiters\r\n */\r\n\r\n if ( lineOpensBlock )\r\n {\r\n const r = tokens.filter( ( t ) => t.substr( 0, blockCommentsTokens[0].length ) == blockCommentsTokens[0] );\r\n if ( !r.length )\r\n {\r\n this._buildingBlockComment = [ lineNumber - 1, 0 ];\r\n\r\n this.mustProcessPreviousLine = ( tokens ) => {\r\n const idx = tokens.indexOf( blockCommentsTokens[0] );\r\n return ( idx === -1 );\r\n };\r\n\r\n this.processLine( lineNumber - 1, false, true );\r\n\r\n section[0].x = this._lastProcessedLine;\r\n\r\n const lastProcessedString = this.code.lines[this._lastProcessedLine];\r\n const idx = lastProcessedString.indexOf( blockCommentsTokens[0] );\r\n section[1].x = idx > 0 ? idx : 0;\r\n }\r\n else\r\n {\r\n const tokenIndex = tokens.indexOf( blockCommentsTokens[0] );\r\n const tokenStartIndex = this._currentTokenPositions[tokenIndex];\r\n section[1].x = tokenStartIndex;\r\n // Process current line to update new sections\r\n this.processLine( lineNumber, false, true );\r\n }\r\n }\r\n else if ( lineClosesBlock )\r\n {\r\n const r = tokens.filter( ( t ) => t.substr( 0, blockCommentsTokens[1].length ) == blockCommentsTokens[1] );\r\n if ( !r.length )\r\n {\r\n this._buildingBlockComment = [ section[0].x, section[1].x ];\r\n\r\n this.mustProcessNextLine = ( tokens ) => {\r\n const idx = tokens.indexOf( blockCommentsTokens[1] );\r\n return ( idx === -1 );\r\n };\r\n\r\n this.processLine( lineNumber + 1, false, true );\r\n\r\n section[0].y = this._lastProcessedLine;\r\n\r\n const lastProcessedString = this.code.lines[this._lastProcessedLine];\r\n const idx = lastProcessedString.indexOf( blockCommentsTokens[1] );\r\n section[1].y = idx > 0 ? idx : ( lastProcessedString.length - 1 );\r\n }\r\n else\r\n {\r\n const tokenIndex = tokens.indexOf( blockCommentsTokens[1] );\r\n const tokenStartIndex = this._currentTokenPositions[tokenIndex];\r\n section[1].y = tokenStartIndex;\r\n // Process current line to update new sections\r\n this.processLine( lineNumber, false, true );\r\n }\r\n }\r\n else if ( lineInsideBlock )\r\n {\r\n // Here it can't modify delimiters..\r\n }\r\n }\r\n\r\n _processExtraLineIfNecessary( lineNumber: number, tokens: string[], oldSymbols: any[], skipPropagation: boolean = false )\r\n {\r\n if ( !this._scopeStack )\r\n {\r\n console.warn( 'CodeEditor: No scope available' );\r\n return;\r\n }\r\n\r\n // Update block comments if necessary\r\n {\r\n const commentBlockSection = this._inBlockCommentSection( lineNumber, 1e10, -1e10 );\r\n if ( tokens && commentBlockSection !== undefined )\r\n {\r\n this._updateBlockComments( commentBlockSection, lineNumber, tokens );\r\n\r\n // Get again correct scope\r\n this._scopeStack = [ ...this.code.lineScopes[lineNumber] ];\r\n }\r\n }\r\n\r\n if ( ( ( lineNumber + 1 ) === this.code.lines.length ) || !this.code.lineScopes[lineNumber + 1] )\r\n {\r\n return;\r\n }\r\n\r\n const newSignature = this._getLineSignatureFromTokens( tokens );\r\n const cachedSignature = this.code.lineSignatures[lineNumber];\r\n const mustUpdateScopes = cachedSignature !== newSignature;\r\n const sameScopes = codeScopesEqual( this._scopeStack, this.code.lineScopes[lineNumber + 1] );\r\n\r\n // Only update scope stack if something changed when editing a single line\r\n // Compare line signature for structural changes\r\n if ( ( mustUpdateScopes || this._scopesUpdated ) && ( !sameScopes && !skipPropagation ) )\r\n {\r\n if ( mustUpdateScopes )\r\n {\r\n this._scopesUpdated = true;\r\n }\r\n\r\n this.code.lineScopes[lineNumber + 1] = [ ...this._scopeStack ];\r\n this.processLine( lineNumber + 1 );\r\n\r\n delete this._scopesUpdated;\r\n }\r\n else if ( sameScopes )\r\n {\r\n // In case of same scope, check for occurrencies of the old symbols, to reprocess that lines\r\n for ( const sym of oldSymbols )\r\n {\r\n const tableSymbol = this.code.symbolsTable.get( sym.name );\r\n if ( tableSymbol === undefined )\r\n {\r\n return;\r\n }\r\n\r\n for ( const occ of tableSymbol )\r\n {\r\n if ( occ.line === lineNumber )\r\n {\r\n continue;\r\n }\r\n\r\n this.processLine( occ.line, false, true );\r\n }\r\n }\r\n }\r\n }\r\n\r\n _updateLine( force: boolean = false, lineNumber: number, html: string, skipPropagation: boolean = false, symbols: any[] = [], tokens: any[] = [] )\r\n {\r\n const gutterLineHtml = `<span class='line-gutter'>${lineNumber + 1}</span>`;\r\n const oldSymbols = this._updateLineSymbols( lineNumber, symbols );\r\n const lineScope = CodeEditor.debugScopes && this.code.lineScopes[lineNumber]\r\n ? this.code.lineScopes[lineNumber].map( ( s: any ) => `${s.type}` ).join( ', ' )\r\n : '';\r\n const lineSymbols = CodeEditor.debugSymbols && this.code.lineSymbols[lineNumber]\r\n ? this.code.lineSymbols[lineNumber].map( ( s: any ) => `${s.name}(${s.kind})` ).join( ', ' )\r\n : '';\r\n const debugString = lineScope + ( lineScope.length ? ' - ' : '' ) + lineSymbols;\r\n\r\n if ( !force )\r\n { // Single line update\r\n this.code.childNodes[this.toLocalLine( lineNumber )].innerHTML = gutterLineHtml + html + debugString;\r\n\r\n if ( !skipPropagation )\r\n {\r\n this._processExtraLineIfNecessary( lineNumber, tokens, oldSymbols, skipPropagation );\r\n }\r\n\r\n if ( this.mustProcessNextLine )\r\n {\r\n if ( this.mustProcessNextLine( tokens ) && ( ( lineNumber + 1 ) < this.code.lines.length ) )\r\n {\r\n this.processLine( lineNumber + 1, false, true );\r\n }\r\n else\r\n {\r\n delete this.mustProcessNextLine;\r\n }\r\n }\r\n\r\n if ( this.mustProcessPreviousLine )\r\n {\r\n if ( this.mustProcessPreviousLine( tokens ) && ( ( lineNumber - 1 ) >= 0 ) )\r\n {\r\n this.processLine( lineNumber - 1, false, true );\r\n }\r\n else\r\n {\r\n delete this.mustProcessPreviousLine;\r\n }\r\n }\r\n\r\n if ( CodeEditor.debugProcessedLines )\r\n {\r\n this.code.childNodes[lineNumber]?.classList.add( 'debug' );\r\n }\r\n\r\n this._setActiveLine( lineNumber );\r\n this._clearTmpVariables();\r\n }\r\n\r\n this.code.lineSignatures[lineNumber] = this._getLineSignatureFromTokens( tokens );\r\n\r\n // Update all lines at once\r\n return force ? `<pre>${( gutterLineHtml + html + debugString )}</pre>` : undefined;\r\n }\r\n\r\n /**\r\n * Parses a single line of code and extract declared symbols\r\n */\r\n _parseLineForSymbols( lineNumber: number, lineString: string, tokens: string[], pushedScope: boolean = false )\r\n {\r\n const scope = this._scopeStack.at( pushedScope ? -2 : -1 );\r\n\r\n if ( !scope || this._inBlockCommentSection( lineNumber ) )\r\n {\r\n return [];\r\n }\r\n\r\n const scopeName = scope.name;\r\n const scopeType = scope.type;\r\n const symbols: any[] = [];\r\n const symbolsMap = new Map();\r\n const text = lineString.trim();\r\n const previousLineScope = this.code.lineScopes[lineNumber - 1];\r\n\r\n const _pushSymbol = ( s: any ) => {\r\n const signature = `${s.name}_${s.kind}_${s.scope}_${s.line}`;\r\n if ( symbolsMap.has( signature ) )\r\n {\r\n return;\r\n }\r\n symbolsMap.set( signature, s );\r\n symbols.push( s );\r\n };\r\n\r\n // Don't make symbols from preprocessor lines\r\n if ( text.startsWith( '#' ) )\r\n {\r\n return [];\r\n }\r\n\r\n const nativeTypes = CodeEditor.nativeTypes[this.highlight];\r\n\r\n const topLevelRegexes: any = [\r\n [ /^class\\s+([A-Za-z0-9_]+)/, 'class' ],\r\n [ /^struct\\s+([A-Za-z0-9_]+)/, 'struct' ],\r\n [ /^enum\\s+([A-Za-z0-9_]+)/, 'enum' ],\r\n [ /^interface\\s+([A-Za-z0-9_]+)/, 'interface' ],\r\n [ /^type\\s+([A-Za-z0-9_]+)/, 'type' ],\r\n [ /^function\\s+([A-Za-z0-9_]+)/, 'method' ],\r\n [ /^fn\\s+([A-Za-z0-9_]+)/, 'method' ],\r\n [ /^def\\s+([A-Za-z0-9_]+)/, 'method' ],\r\n [ /^([A-Za-z0-9_]+)\\s*=\\s*\\(?.*\\)?\\s*=>/, 'method' ] // arrow functions\r\n ];\r\n\r\n // Add regexes to detect methods, variables ( including \"id : nativeType\" )\r\n {\r\n if ( nativeTypes )\r\n {\r\n topLevelRegexes.push( [ new RegExp( `^(?:${nativeTypes.join( '|' )})\\\\s+([A-Za-z0-9_]+)\\s*[\\(]+` ), 'method' ] );\r\n\r\n if ( this.highlight === 'WGSL' )\r\n {\r\n topLevelRegexes.push( [ new RegExp( `[A-Za-z0-9]+(\\\\s*)+:(\\\\s*)+(${nativeTypes.join( '|' )})` ), 'variable', ( m: string[] ) =>\r\n m[0].split( ':' )[0].trim() ] );\r\n }\r\n }\r\n\r\n const declarationKeywords = CodeEditor.declarationKeywords[this.highlight] ?? [ 'const', 'let', 'var' ];\r\n topLevelRegexes.push( [ new RegExp( `^(?:${declarationKeywords.join( '|' )})\\\\s+([A-Za-z0-9_]+)` ), 'variable' ] );\r\n }\r\n\r\n for ( let [ regex, kind, fn ] of topLevelRegexes )\r\n {\r\n const m = text.match( regex );\r\n if ( m )\r\n {\r\n _pushSymbol( { name: fn ? fn( m ) : m[1], kind, scope: scopeName, line: lineNumber } );\r\n }\r\n }\r\n\r\n const usageRegexes: any = [\r\n [ /new\\s+([A-Za-z0-9_]+)\\s*\\(/, 'constructor-call' ],\r\n [ /this.([A-Za-z_][A-Za-z0-9_]*)\\s*\\=/, 'class-property' ]\r\n ];\r\n\r\n for ( let [ regex, kind, fn ] of usageRegexes )\r\n {\r\n const m = text.match( regex );\r\n if ( m )\r\n {\r\n _pushSymbol( { name: fn ? fn( m ) : m[1], kind, scope: scopeName, line: lineNumber } );\r\n }\r\n }\r\n\r\n // Detect method calls\r\n const regex = /([A-Za-z0-9_]+)\\s*\\(/g;\r\n let match;\r\n while ( match = regex.exec( text ) )\r\n {\r\n const name = match[1];\r\n const before = text.slice( 0, match.index );\r\n if ( /(new|function|fn|def)\\s+$/.test( before ) ) continue; // skip constructor calls\r\n if ( [ 'constructor', 'location', ...( nativeTypes ?? [] ) ].indexOf( name ) > -1 ) continue; // skip hardcoded non method symbol\r\n if ( previousLineScope && previousLineScope.at( -1 )?.type === 'class' ) continue; // skip class methods\r\n _pushSymbol( { name, kind: 'method-call', scope: scopeName, line: lineNumber } );\r\n }\r\n\r\n // Stop after matches for top-level declarations and usage symbols\r\n if ( symbols.length )\r\n {\r\n return symbols;\r\n }\r\n\r\n const nonWhiteSpaceTokens = tokens.filter( ( t ) => t.trim().length );\r\n\r\n for ( let i = 0; i < nonWhiteSpaceTokens.length; i++ )\r\n {\r\n const prev = nonWhiteSpaceTokens[i - 1];\r\n const token = nonWhiteSpaceTokens[i];\r\n const next = nonWhiteSpaceTokens[i + 1];\r\n\r\n if ( scopeType.startsWith( 'class' ) )\r\n {\r\n if ( next === '(' && /^[a-zA-Z_]\\w*$/.test( token ) && prev === undefined )\r\n {\r\n if ( token === 'constructor' ) continue; // skip constructor symbol\r\n _pushSymbol( { name: token, kind: 'method', scope: scopeName, line: lineNumber } );\r\n }\r\n }\r\n else if ( scopeType.startsWith( 'enum' ) )\r\n {\r\n if ( !isSymbol( token ) && !this._isNumber( token )\r\n && !this._mustHightlightWord( token, CodeEditor.statements ) )\r\n {\r\n _pushSymbol( { name: token, kind: 'enum_value', scope: scopeName, line: lineNumber } );\r\n }\r\n }\r\n }\r\n\r\n return symbols;\r\n }\r\n\r\n /**\r\n * Updates the symbol table for a single line\r\n * - Removes old symbols from that line\r\n * - Inserts the new symbols\r\n */\r\n _updateLineSymbols( lineNumber: number, newSymbols: any[] )\r\n {\r\n this.code.lineSymbols[lineNumber] = this.code.lineSymbols[lineNumber] ?? [];\r\n const oldSymbols = LX.deepCopy( this.code.lineSymbols[lineNumber] );\r\n\r\n // Clean old symbols from current line\r\n for ( let sym of this.code.lineSymbols[lineNumber] )\r\n {\r\n let array = this.code.symbolsTable.get( sym.name );\r\n if ( !array )\r\n {\r\n continue;\r\n }\r\n\r\n array = array.filter( ( s: any ) => s.line !== lineNumber );\r\n\r\n if ( array.length )\r\n {\r\n this.code.symbolsTable.set( sym.name, array );\r\n }\r\n else\r\n {\r\n this.code.symbolsTable.delete( sym.name );\r\n }\r\n }\r\n\r\n // Add new symbols to table\r\n for ( let sym of newSymbols )\r\n {\r\n let arr = this.code.symbolsTable.get( sym.name ) ?? [];\r\n arr.push( sym );\r\n this.code.symbolsTable.set( sym.name, arr );\r\n }\r\n\r\n // Keep lineSymbols in sync\r\n this.code.lineSymbols[lineNumber] = newSymbols;\r\n\r\n return oldSymbols;\r\n }\r\n\r\n _lineHasComment( lineString: string )\r\n {\r\n const lang = CodeEditor.languages[this.highlight];\r\n\r\n if ( !( lang.singleLineComments ?? true ) )\r\n {\r\n return;\r\n }\r\n\r\n const singleLineCommentToken = lang.singleLineCommentToken ?? this.defaultSingleLineCommentToken;\r\n const idx = lineString.indexOf( singleLineCommentToken );\r\n\r\n if ( idx > -1 )\r\n {\r\n const stringKeys = Object.values( this.stringKeys );\r\n // Count times we started a string BEFORE the comment\r\n var err = false;\r\n err = err || ( stringKeys.some( function( v )\r\n {\r\n var re = new RegExp( v, 'g' );\r\n var matches = lineString.substring( 0, idx ).match( re ) || [];\r\n return ( matches.length % 2 ) !== 0;\r\n } ) );\r\n return err ? undefined : idx;\r\n }\r\n }\r\n\r\n _getTokensFromLine( lineString: string, skipNonWords: boolean = false )\r\n {\r\n if ( !lineString || !lineString.length )\r\n {\r\n return [];\r\n }\r\n\r\n // Check if line comment\r\n const ogLine = lineString;\r\n const hasCommentIdx = this._lineHasComment( lineString );\r\n\r\n if ( hasCommentIdx != undefined )\r\n {\r\n lineString = ogLine.substring( 0, hasCommentIdx );\r\n }\r\n\r\n let tokensToEvaluate: string[] = []; // store in a temp array so we know prev and next tokens...\r\n let charCounterList: number[] = [];\r\n let charCounter = 0;\r\n\r\n const pushToken = function( t: string )\r\n {\r\n if ( ( skipNonWords && ( t.includes( '\"' ) || t.length < 3 ) ) )\r\n {\r\n return;\r\n }\r\n tokensToEvaluate.push( t );\r\n charCounterList.push( charCounter );\r\n // Update positions\r\n charCounter += t.length;\r\n };\r\n\r\n let iter = lineString.matchAll( /(<!--|-->|\\*\\/|\\/\\*|::|[\\[\\](){}<>.,;:*\"'`%@$!/= ])/g );\r\n let subtokens = iter.next();\r\n if ( subtokens.value )\r\n {\r\n let idx = 0;\r\n while ( subtokens.value != undefined )\r\n {\r\n const _pt = lineString.substring( idx, subtokens.value.index );\r\n if ( _pt.length ) pushToken( _pt );\r\n pushToken( subtokens.value[0] );\r\n idx = subtokens.value.index + subtokens.value[0].length;\r\n subtokens = iter.next();\r\n if ( !subtokens.value )\r\n {\r\n const _at = lineString.substring( idx );\r\n if ( _at.length ) pushToken( _at );\r\n }\r\n }\r\n }\r\n else pushToken( lineString );\r\n\r\n if ( hasCommentIdx != undefined )\r\n {\r\n pushToken( ogLine.substring( hasCommentIdx ) );\r\n }\r\n\r\n this._currentTokenPositions = charCounterList;\r\n\r\n return this._processTokens( tokensToEvaluate );\r\n }\r\n\r\n _processTokens( tokens: string[], offset: number = 0 ): string[]\r\n {\r\n if ( this.highlight == 'C++' || this.highlight == 'CSS' )\r\n {\r\n var idx = tokens.slice( offset ).findIndex( ( value, index ) => this._isNumber( value ) );\r\n if ( idx > -1 )\r\n {\r\n idx += offset; // Add offset to compute within the whole array of tokens\r\n let data = tokens[idx] + tokens[++idx];\r\n while ( this._isNumber( data ) )\r\n {\r\n tokens[idx - 1] += tokens[idx];\r\n tokens.splice( idx, 1 );\r\n data += tokens[idx];\r\n }\r\n // Scan for numbers again\r\n return this._processTokens( tokens, idx );\r\n }\r\n\r\n const importantIdx = tokens.indexOf( 'important' );\r\n if ( this.highlight == 'CSS' && importantIdx > -1 && tokens[importantIdx - 1] === '!' )\r\n {\r\n tokens[importantIdx - 1] = '!important';\r\n tokens.splice( importantIdx, 1 );\r\n }\r\n }\r\n else if ( this.highlight == 'PHP' )\r\n {\r\n let offset = 0;\r\n let dollarIdx = tokens.indexOf( '$' );\r\n\r\n while ( dollarIdx > -1 )\r\n {\r\n const offsetIdx = dollarIdx + offset;\r\n\r\n if ( tokens[offsetIdx + 1] === 'this-' )\r\n {\r\n tokens[offsetIdx] = '$this';\r\n tokens[offsetIdx + 1] = '-';\r\n }\r\n else\r\n {\r\n tokens[offsetIdx] += tokens[offsetIdx + 1] ?? '';\r\n tokens.splice( offsetIdx + 1, 1 );\r\n }\r\n\r\n dollarIdx = tokens.slice( offsetIdx ).indexOf( '$' );\r\n offset = offsetIdx;\r\n }\r\n }\r\n else if ( this.highlight == 'WGSL' )\r\n {\r\n let offset = 0;\r\n let atIdx = tokens.indexOf( '@' );\r\n\r\n while ( atIdx > -1 )\r\n {\r\n const offsetIdx = atIdx + offset;\r\n\r\n tokens[offsetIdx] += tokens[offsetIdx + 1] ?? '';\r\n tokens.splice( offsetIdx + 1, 1 );\r\n\r\n atIdx = tokens.slice( offsetIdx ).indexOf( '$' );\r\n offset = offsetIdx;\r\n }\r\n }\r\n\r\n return tokens;\r\n }\r\n\r\n _mustHightlightWord( token: string, wordCategory: any, lang?: any ): boolean\r\n {\r\n if ( !lang )\r\n {\r\n lang = CodeEditor.languages[this.highlight];\r\n }\r\n\r\n let t = token;\r\n\r\n if ( lang.ignoreCase )\r\n {\r\n t = t.toLowerCase();\r\n }\r\n\r\n return wordCategory[this.highlight] && wordCategory[this.highlight].has( t );\r\n }\r\n\r\n _getTokenHighlighting( ctx: any, highlight: string )\r\n {\r\n const rules = [ ...HighlightRules.common, ...( HighlightRules[highlight] || [] ), ...HighlightRules.post_common ];\r\n\r\n for ( const rule of rules )\r\n {\r\n if ( !rule.test( ctx, this ) )\r\n {\r\n continue;\r\n }\r\n\r\n const r = rule.action ? rule.action( ctx, this ) : undefined;\r\n if ( rule.discard ) ctx.discardToken = r;\r\n return rule.className;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n _evaluateToken( ctxData: any )\r\n {\r\n let { token, prev, next, tokenIndex, isFirstToken, isLastToken } = ctxData;\r\n\r\n const lang = CodeEditor.languages[this.highlight];\r\n const highlight = this.highlight.replace( /\\s/g, '' ).replaceAll( '+', 'p' ).toLowerCase();\r\n const customStringKeys = Object.assign( {}, this.stringKeys );\r\n const lineNumber = this._currentLineNumber;\r\n const tokenStartIndex = this._currentTokenPositions[tokenIndex];\r\n const inBlockComment = ( this._buildingBlockComment ?? this._inBlockCommentSection( lineNumber!, tokenStartIndex, token.length ) )\r\n !== undefined;\r\n\r\n var usePreviousTokenToCheckString = false;\r\n\r\n if ( [ 'cpp', 'c' ].indexOf( highlight ) > -1 && prev && prev.includes( '#' ) )\r\n { // preprocessor code..\r\n customStringKeys['@<'] = '>';\r\n }\r\n else if ( highlight == 'markdown' && ( ctxData.prevWithSpaces == '[' || ctxData.nextWithSpaces == ']' ) )\r\n {\r\n // console.warn(prev, token, next)\r\n usePreviousTokenToCheckString = true;\r\n customStringKeys['@['] = ']';\r\n }\r\n else if ( highlight == 'javascript' || highlight == 'typescript' )\r\n {\r\n customStringKeys['@`'] = '`';\r\n }\r\n\r\n // Manage strings\r\n this._stringEnded = false;\r\n\r\n if ( usePreviousTokenToCheckString\r\n || ( !inBlockComment\r\n && ( lang.tags ?? false ? ( this._enclosedByTokens( token, tokenIndex, '<', '>' ) ) : true ) ) )\r\n {\r\n const _checkIfStringEnded = ( t: string ) => {\r\n if ( this._stringInterpolation )\r\n {\r\n if ( token == '$' && next == '{' )\r\n {\r\n delete this._stringInterpolation;\r\n this._stringInterpolationOpened = true;\r\n this._stringEnded = true;\r\n return;\r\n }\r\n }\r\n\r\n const idx = Object.values( customStringKeys ).indexOf( t );\r\n this._stringEnded = ( idx > -1 )\r\n && ( idx\r\n == Object.values( customStringKeys ).indexOf( customStringKeys['@' + this._buildingString] ) );\r\n };\r\n\r\n if ( this._buildingString != undefined )\r\n {\r\n _checkIfStringEnded( usePreviousTokenToCheckString ? ctxData.nextWithSpaces : token );\r\n }\r\n else if ( customStringKeys['@' + ( usePreviousTokenToCheckString ? ctxData.prevWithSpaces : token )] )\r\n {\r\n // Start new string\r\n this._buildingString = usePreviousTokenToCheckString ? ctxData.prevWithSpaces : token;\r\n\r\n if ( ( highlight == 'javascript' || highlight == 'typescript' ) && token == '`' )\r\n {\r\n this._stringInterpolation = true;\r\n }\r\n\r\n // Check if string ended in same token using next...\r\n if ( usePreviousTokenToCheckString )\r\n {\r\n _checkIfStringEnded( ctxData.nextWithSpaces );\r\n }\r\n }\r\n else if ( this._stringInterpolationOpened && prev == '}' )\r\n {\r\n delete this._stringInterpolationOpened;\r\n this._stringInterpolation = true;\r\n this._buildingString = '`';\r\n }\r\n }\r\n\r\n // Update context data for next tests\r\n ctxData.discardToken = false;\r\n ctxData.inBlockComment = inBlockComment;\r\n ctxData.markdownHeader = this._markdownHeader;\r\n ctxData.inString = this._buildingString !== undefined;\r\n ctxData.singleLineCommentToken = lang.singleLineCommentToken ?? this.defaultSingleLineCommentToken;\r\n ctxData.lang = lang;\r\n ctxData.scope = this._scopeStack.at( -1 );\r\n\r\n // Add utils functions for the rules\r\n ctxData.isVariableSymbol = ( token: string ) =>\r\n this.code.symbolsTable.has( token ) && this.code.symbolsTable.get( token )[0].kind === 'variable';\r\n ctxData.isEnumValueSymbol = ( token: string ) =>\r\n this.code.symbolsTable.has( token ) && this.code.symbolsTable.get( token )[0].kind === 'enum_value';\r\n ctxData.isClassSymbol = ( token: string ) => this.code.symbolsTable.has( token ) && this.code.symbolsTable.get( token )[0].kind === 'class';\r\n ctxData.isStructSymbol = ( token: string ) => this.code.symbolsTable.has( token ) && this.code.symbolsTable.get( token )[0].kind === 'struct';\r\n ctxData.isEnumSymbol = ( token: string ) => this.code.symbolsTable.has( token ) && this.code.symbolsTable.get( token )[0].kind === 'enum';\r\n\r\n // Get highlighting class based on language common and specific rules\r\n let tokenClass = this._getTokenHighlighting( ctxData, highlight );\r\n\r\n if ( this._stringInterpolationOpened && this._pendingString )\r\n {\r\n this._pendingString = this._pendingString.substring( 0, this._pendingString.indexOf( '$' ) );\r\n\r\n if ( ctxData.tokens[tokenIndex + 1] == '{' )\r\n {\r\n ctxData.tokens[tokenIndex + 1] = '${';\r\n }\r\n }\r\n\r\n // We finished constructing a string\r\n if ( this._buildingString && ( this._stringEnded || isLastToken ) && !inBlockComment )\r\n {\r\n token = this._getCurrentString();\r\n tokenClass = 'cm-str';\r\n ctxData.discardToken = false;\r\n }\r\n\r\n // Update state\r\n this._buildingString = this._stringEnded ? undefined : this._buildingString;\r\n\r\n if ( ctxData.discardToken )\r\n {\r\n return '';\r\n }\r\n\r\n // Replace html chars\r\n token = token.replace( '<', '<' ).replace( '>', '>' );\r\n\r\n // No highlighting, no need to put it inside another span..\r\n if ( !tokenClass )\r\n {\r\n return token;\r\n }\r\n\r\n return `<span class=\"${highlight} ${tokenClass}\">${token}</span>`;\r\n }\r\n\r\n _appendStringToken( token: string ): boolean\r\n {\r\n if ( !this._pendingString )\r\n {\r\n this._pendingString = '';\r\n }\r\n\r\n this._pendingString += token;\r\n\r\n return true;\r\n }\r\n\r\n _getCurrentString()\r\n {\r\n const chars = this._pendingString;\r\n delete this._pendingString;\r\n return chars;\r\n }\r\n\r\n _enclosedByTokens( token: string, tokenIndex: number, tagStart: string, tagEnd: string ): number[] | undefined\r\n {\r\n const tokenStartIndex = this._currentTokenPositions[tokenIndex];\r\n const tagStartIndex = indexOfFrom( this._currentLineString!, tagStart, tokenStartIndex, true );\r\n if ( tagStartIndex < 0 )\r\n { // Not found..\r\n return;\r\n }\r\n const tagStartIndexOpposite = indexOfFrom( this._currentLineString!, tagEnd, tokenStartIndex, true );\r\n if ( tagStartIndexOpposite >= 0 && tagStartIndexOpposite > tagStartIndex )\r\n { // Found the opposite first while reversing..\r\n return;\r\n }\r\n const tagEndIndex = indexOfFrom( this._currentLineString!, tagEnd, tokenStartIndex );\r\n if ( tagEndIndex < 0 )\r\n { // Not found..\r\n return;\r\n }\r\n\r\n if ( ( tagStartIndex < tokenStartIndex ) && ( tagEndIndex >= ( tokenStartIndex + token.length ) )\r\n && !this._mustHightlightWord( token, CodeEditor.symbols ) )\r\n {\r\n return [ tagStartIndex, tagEndIndex ];\r\n }\r\n }\r\n\r\n _inBlockCommentSection( lineNumber: number, tokenPosition: number = -1, tokenLength: number = -1 )\r\n {\r\n const lang = CodeEditor.languages[this.highlight];\r\n const blockCommentsTokens = lang.blockCommentsTokens ?? this.defaultBlockCommentTokens;\r\n\r\n for ( let section of this._blockCommentCache )\r\n {\r\n const lineRange = section[0];\r\n const posRange = section[1];\r\n\r\n // Outside the lines range\r\n const meetsLineRange = lineNumber >= lineRange.x && lineNumber <= lineRange.y;\r\n if ( !meetsLineRange )\r\n {\r\n continue;\r\n }\r\n\r\n if ( ( lineNumber != lineRange.x && lineNumber != lineRange.y ) // Inside the block, not first nor last line\r\n || ( lineNumber == lineRange.x && tokenPosition >= posRange.x\r\n && ( ( lineNumber == lineRange.y\r\n && ( tokenPosition + tokenLength ) <= ( posRange.y + blockCommentsTokens[1].length ) )\r\n || lineNumber !== lineRange.y ) )\r\n || ( lineNumber == lineRange.y\r\n && ( ( tokenPosition + tokenLength ) <= ( posRange.y + blockCommentsTokens[1].length ) ) )\r\n && ( ( lineNumber == lineRange.x && tokenPosition >= posRange.x ) || lineNumber !== lineRange.x ) )\r\n {\r\n return section;\r\n }\r\n }\r\n }\r\n\r\n _isKeyword( ctxData: any ): boolean\r\n {\r\n const { token, tokenIndex, tokens, lang } = ctxData;\r\n\r\n let isKwd = this._mustHightlightWord( token, CodeEditor.keywords ) || this.highlight == 'XML';\r\n\r\n if ( this.highlight == 'CMake' )\r\n {\r\n // Highlight $ symbol\r\n if ( token == '$' && this._enclosedByTokens( tokens[tokenIndex + 2], tokenIndex + 2, '{', '}' ) )\r\n {\r\n isKwd = true;\r\n }\r\n // Highlight what is between the { }\r\n else if ( this._enclosedByTokens( token, tokenIndex, '{', '}' ) )\r\n {\r\n isKwd = isKwd || ( ctxData.tokens[tokenIndex - 2] == '$' );\r\n }\r\n }\r\n if ( this.highlight == 'Markdown' )\r\n {\r\n isKwd = this._markdownHeader !== undefined;\r\n }\r\n else if ( lang.tags )\r\n {\r\n isKwd = isKwd && ( this._enclosedByTokens( token, tokenIndex, '<', '>' ) != undefined );\r\n }\r\n\r\n return isKwd;\r\n }\r\n\r\n _isNumber( token: string ): boolean\r\n {\r\n const lang = CodeEditor.languages[this.highlight];\r\n if ( !( lang.numbers ?? true ) )\r\n {\r\n return false;\r\n }\r\n\r\n const subToken = token.substring( 0, token.length - 1 );\r\n\r\n if ( this.highlight == 'C++' )\r\n {\r\n if ( LX.lastChar( token ) == 'f' )\r\n {\r\n return this._isNumber( subToken );\r\n }\r\n else if ( LX.lastChar( token ) == 'u' )\r\n {\r\n return !( token.includes( '.' ) ) && this._isNumber( subToken );\r\n }\r\n }\r\n else if ( this.highlight == 'WGSL' )\r\n {\r\n if ( LX.lastChar( token ) == 'u' )\r\n {\r\n return !( token.includes( '.' ) ) && this._isNumber( subToken );\r\n }\r\n }\r\n else if ( this.highlight == 'CSS' )\r\n {\r\n if ( LX.lastChar( token ) == '%' )\r\n {\r\n return this._isNumber( subToken );\r\n }\r\n }\r\n\r\n return ( token.length > 0 ) && token != ' ' && !Number.isNaN( +token );\r\n }\r\n\r\n _encloseSelectedWordWithKey( key: string, lidx: number, cursor: Cursor ): boolean\r\n {\r\n if ( !cursor.selection || ( cursor.selection.fromY != cursor.selection.toY ) )\r\n {\r\n return false;\r\n }\r\n\r\n cursor.selection.invertIfNecessary();\r\n\r\n // Insert first..\r\n this.code.lines[lidx] = [\r\n this.code.lines[lidx].slice( 0, cursor.selection.fromX ),\r\n key,\r\n this.code.lines[lidx].slice( cursor.selection.fromX )\r\n ].join( '' );\r\n\r\n // Go to the end of the word\r\n this.cursorToPosition( cursor, cursor.selection.toX + 1 );\r\n\r\n // Change next key?\r\n switch ( key )\r\n {\r\n case \"'\":\r\n case '\"':\r\n break;\r\n case '(':\r\n key = ')';\r\n break;\r\n case '{':\r\n key = '}';\r\n break;\r\n }\r\n\r\n // Insert the other\r\n this.code.lines[lidx] = [\r\n this.code.lines[lidx].slice( 0, cursor.position ),\r\n key,\r\n this.code.lines[lidx].slice( cursor.position )\r\n ].join( '' );\r\n\r\n // Recompute and reposition current selection\r\n\r\n cursor.selection.fromX++;\r\n cursor.selection.toX++;\r\n\r\n this._processSelection( cursor );\r\n this.processLine( lidx );\r\n\r\n // Stop propagation\r\n return true;\r\n }\r\n\r\n _detectLanguage( text: string ): string | undefined\r\n {\r\n const tokenSet = new Set( this._getTokensFromLine( text, true ) );\r\n const scores: any = {};\r\n\r\n // Check strong indicators first\r\n const strongIndicators = {\r\n 'JavaScript': [ 'import ', 'export default', 'console.', '=>', 'document.', 'window.' ],\r\n 'TypeScript': [ 'import ', 'export default', 'console.', '=>', 'document.', 'window.' ],\r\n 'C++': [ '#include', '::', 'std::', 'template <', 'using namespace' ],\r\n 'Python': [ 'def ', 'import ', 'print(', 'self', 'None', 'True', 'False' ],\r\n 'HTML': [ '<html', '<div', '<body', '<script', '<style' ],\r\n 'CSS': [ '@media' ],\r\n 'Markdown': [ '#', '##', '###', '](', '![', '**' ]\r\n };\r\n\r\n for ( const [ lang, indicators ] of Object.entries( strongIndicators ) )\r\n {\r\n scores[lang] = scores[lang] ?? 0;\r\n for ( const key of indicators )\r\n {\r\n if ( text.includes( key ) ) scores[lang] += 20;\r\n }\r\n }\r\n\r\n // Check groups' words now with less importance score\r\n const groups = [\r\n CodeEditor.keywords,\r\n CodeEditor.statements,\r\n CodeEditor.utils,\r\n CodeEditor.types,\r\n CodeEditor.builtIn\r\n ];\r\n\r\n for ( const group of groups )\r\n {\r\n for ( let [ lang, wordList ] of Object.entries( group ) )\r\n {\r\n scores[lang] = scores[lang] ?? 0;\r\n for ( let kw of ( wordList as any ) )\r\n {\r\n if ( tokenSet.has( kw ) ) scores[lang]++;\r\n }\r\n }\r\n }\r\n\r\n const sorted = ( Object.entries( scores ) as any ).sort( ( a: any[], b: any[] ) => b[1] - a[1] );\r\n return sorted[0][1] > 0 ? sorted[0][0] : undefined;\r\n }\r\n\r\n lineUp( cursor: Cursor, resetLeft: boolean = false )\r\n {\r\n if ( this.code.lines[cursor.line - 1] == undefined )\r\n {\r\n return false;\r\n }\r\n\r\n cursor.line--;\r\n cursor.line = Math.max( 0, cursor.line );\r\n this.cursorToTop( cursor, resetLeft );\r\n\r\n return true;\r\n }\r\n\r\n lineDown( cursor: Cursor, resetLeft: boolean = false )\r\n {\r\n if ( this.code.lines[cursor.line + 1] == undefined )\r\n {\r\n return false;\r\n }\r\n\r\n cursor.line++;\r\n\r\n this.cursorToBottom( cursor, resetLeft );\r\n\r\n return true;\r\n }\r\n\r\n swapLines( lidx: number, offset: number, cursor: Cursor )\r\n {\r\n if ( this.code.lines[lidx + offset] == undefined )\r\n {\r\n return;\r\n }\r\n\r\n this._addUndoStep( cursor, true );\r\n\r\n swapArrayElements( this.code.lines, lidx + offset, lidx );\r\n\r\n // Process both lines\r\n this.processLine( lidx + offset );\r\n this.processLine( lidx );\r\n\r\n if ( offset > 0 )\r\n {\r\n this.lineDown( cursor );\r\n }\r\n else\r\n {\r\n this.lineUp( cursor );\r\n }\r\n\r\n this.hideAutoCompleteBox();\r\n }\r\n\r\n restartBlink()\r\n {\r\n if ( !this.code ) return;\r\n\r\n clearInterval( this.blinker );\r\n LX.addClass( this.cursorsDOM, 'show' );\r\n\r\n if ( this.cursorBlinkRate > 0 )\r\n {\r\n this.blinker = setInterval( () => {\r\n LX.toggleClass( this.cursorsDOM, 'show' );\r\n }, this.cursorBlinkRate );\r\n }\r\n else if ( this.cursorBlinkRate < 0 )\r\n {\r\n LX.removeClass( this.cursorsDOM, 'show' );\r\n }\r\n }\r\n\r\n startSelection( cursor: Cursor )\r\n {\r\n // Show elements\r\n let selectionContainer = document.createElement( 'div' );\r\n selectionContainer.className = 'selections';\r\n selectionContainer.classList.add( 'show' );\r\n\r\n LX.insertChildAtIndex( this.codeSizer, selectionContainer, 2 );\r\n this.selections[cursor.name] = selectionContainer;\r\n\r\n // Create new selection instance\r\n cursor.selection = new CodeSelection( this, cursor );\r\n }\r\n\r\n deleteSelection( cursor: Cursor )\r\n {\r\n // I think it's not necessary but...\r\n if ( this.disableEdition || !cursor.selection )\r\n {\r\n return;\r\n }\r\n\r\n // Some selections don't depend on mouse up..\r\n cursor.selection.invertIfNecessary();\r\n\r\n const selection = cursor.selection;\r\n const separator = '_NEWLINE_';\r\n let code = this.code.lines.join( separator );\r\n\r\n // Get linear start index\r\n let index = 0;\r\n for ( let i = 0; i <= selection.fromY; i++ )\r\n {\r\n index += i == selection.fromY ? selection.fromX : this.code.lines[i].length;\r\n }\r\n\r\n index += selection.fromY * separator.length;\r\n\r\n const num_chars = selection.chars + ( selection.toY - selection.fromY ) * separator.length;\r\n const pre = code.slice( 0, index );\r\n const post = code.slice( index + num_chars );\r\n\r\n this.code.lines = ( pre + post ).split( separator );\r\n\r\n this.cursorToLine( cursor, selection.fromY, true );\r\n this.cursorToPosition( cursor, selection.fromX );\r\n\r\n this.endSelection( cursor );\r\n this.processLines();\r\n }\r\n\r\n endSelection( cursor?: Cursor )\r\n {\r\n delete this._tripleClickSelection;\r\n delete this._lastSelectionKeyDir;\r\n delete this._currentOcurrences;\r\n delete this._lastResult;\r\n\r\n if ( cursor )\r\n {\r\n LX.deleteElement( this.selections[cursor.name] );\r\n delete this.selections[cursor.name];\r\n cursor.selection = null;\r\n cursor.line = cursor.line; // Update current line\r\n }\r\n else\r\n {\r\n for ( let cursor of this.cursors )\r\n {\r\n cursor.line = cursor.line; // Update current line\r\n LX.deleteElement( this.selections[cursor.name] );\r\n delete this.selections[cursor.name];\r\n cursor.selection = null;\r\n }\r\n }\r\n }\r\n\r\n selectAll()\r\n {\r\n this.endSelection();\r\n\r\n // Use main cursor\r\n this._removeSecondaryCursors();\r\n\r\n var cursor = this.getCurrentCursor();\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT_TOP, cursor, true );\r\n\r\n this.startSelection( cursor );\r\n\r\n const selection = cursor.selection!;\r\n const nlines = this.code.lines.length - 1;\r\n selection.toX = this.code.lines[nlines].length;\r\n selection.toY = nlines;\r\n\r\n this.cursorToPosition( cursor, selection.toX );\r\n this.cursorToLine( cursor, selection.toY );\r\n\r\n this._processSelection( cursor, null, true );\r\n\r\n this.hideAutoCompleteBox();\r\n }\r\n\r\n cursorToRight( text: string, cursor: Cursor )\r\n {\r\n if ( !text || !text.length ) return;\r\n\r\n const chars = text.length;\r\n const offset = chars * this.charWidth;\r\n\r\n cursor.left += offset;\r\n cursor.root.style.left = `calc( ${cursor.left}px + ${this.xPadding} )`;\r\n cursor.position += chars;\r\n\r\n this.restartBlink();\r\n\r\n this.updateScrollLeft( cursor );\r\n }\r\n\r\n cursorToLeft( text: string, cursor: Cursor )\r\n {\r\n if ( !text || !text.length ) return;\r\n\r\n const chars = text.length;\r\n const offset = chars * this.charWidth;\r\n\r\n cursor.left -= offset;\r\n cursor.left = Math.max( cursor.left, 0 );\r\n cursor.root.style.left = `calc( ${cursor.left}px + ${this.xPadding} )`;\r\n cursor.position -= chars;\r\n cursor.position = Math.max( cursor.position, 0 );\r\n\r\n this.restartBlink();\r\n\r\n // Check if we need to add scroll; if not then we might have to reduce it\r\n if ( !this.updateScrollLeft( cursor ) )\r\n {\r\n const leftMargin = this.charWidth;\r\n const cursorX = cursor.position * this.charWidth;\r\n const currentScrollLeft = this.getScrollLeft();\r\n if ( cursorX < ( currentScrollLeft + leftMargin ) )\r\n {\r\n const scroll = Math.max( cursorX - leftMargin, 0 );\r\n this.setScrollLeft( scroll );\r\n }\r\n }\r\n }\r\n\r\n cursorToTop( cursor: Cursor, resetLeft = false )\r\n {\r\n cursor.top -= this.lineHeight;\r\n cursor.top = Math.max( cursor.top, 0 );\r\n cursor.root.style.top = `calc(${cursor.top}px)`;\r\n this.restartBlink();\r\n\r\n if ( resetLeft )\r\n {\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor, true );\r\n }\r\n\r\n const currentScrollTop = this.getScrollTop();\r\n var firstLine = ( currentScrollTop / this.lineHeight ) | 0;\r\n if ( ( cursor.line - 1 ) < firstLine )\r\n {\r\n this.setScrollTop( currentScrollTop - this.lineHeight );\r\n }\r\n }\r\n\r\n cursorToBottom( cursor: Cursor, resetLeft = false )\r\n {\r\n cursor.top += this.lineHeight;\r\n cursor.root.style.top = `calc(${cursor.top}px)`;\r\n\r\n this.restartBlink();\r\n\r\n if ( resetLeft )\r\n {\r\n this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor, true );\r\n }\r\n\r\n const currentScrollTop = this.getScrollTop();\r\n const scrollerHeight = this.codeScroller.offsetHeight - this._fullVerticalOffset;\r\n const lastLine = ( ( scrollerHeight + currentScrollTop ) / this.lineHeight ) | 0;\r\n if ( cursor.line >= lastLine )\r\n {\r\n this.setScrollTop( currentScrollTop + this.lineHeight );\r\n }\r\n }\r\n\r\n cursorToString( cursor: Cursor, text: string, reverse: boolean = false )\r\n {\r\n if ( !text.length )\r\n {\r\n return;\r\n }\r\n\r\n if ( reverse )\r\n {\r\n this.cursorToLeft( text, cursor );\r\n }\r\n else\r\n {\r\n this.cursorToRight( text, cursor );\r\n }\r\n }\r\n\r\n cursorToPosition( cursor: Cursor, position: number, updateScroll = false )\r\n {\r\n cursor.position = position;\r\n cursor.left = position * this.charWidth;\r\n cursor.root.style.left = `calc( ${cursor.left}px + ${this.xPadding} )`;\r\n\r\n if ( updateScroll )\r\n {\r\n this.updateScrollLeft( cursor );\r\n }\r\n }\r\n\r\n cursorToLine( cursor: Cursor, line: number, resetLeft: boolean = false )\r\n {\r\n cursor.line = line;\r\n cursor.top = this.lineHeight * line;\r\n cursor.root.style.top = cursor.top + 'px';\r\n if ( resetLeft ) this.resetCursorPos( CodeEditor.CURSOR_LEFT, cursor );\r\n }\r\n\r\n saveCursor( cursor: Cursor, state: any = {} )\r\n {\r\n state.position = cursor.position;\r\n state.line = cursor.line;\r\n state.selection = cursor.selection ? cursor.selection.save() : undefined;\r\n return state;\r\n }\r\n\r\n saveCursors()\r\n {\r\n var cursors = [];\r\n\r\n for ( let cursor of this.cursors )\r\n {\r\n cursors.push( this.saveCursor( cursor ) );\r\n }\r\n\r\n return cursors;\r\n }\r\n\r\n getCurrentCursor( removeOthers: boolean = false ): Cursor\r\n {\r\n if ( removeOthers )\r\n {\r\n this._removeSecondaryCursors();\r\n }\r\n\r\n return this.cursors[0];\r\n }\r\n\r\n relocateCursors()\r\n {\r\n for ( let cursor of this.cursors )\r\n {\r\n cursor.set( cursor.position, cursor.line, false );\r\n }\r\n }\r\n\r\n mergeCursors( line: number )\r\n {\r\n console.assert( line >= 0 );\r\n const cursorsInLine = this.cursors.filter( ( v: any ) => v.line == line );\r\n\r\n while ( cursorsInLine.length > 1 )\r\n {\r\n this.removeCursor( cursorsInLine.pop() );\r\n }\r\n }\r\n\r\n restoreCursor( cursor: Cursor, state: any )\r\n {\r\n cursor.set( state.position, state.line );\r\n\r\n if ( state.selection )\r\n {\r\n this.endSelection();\r\n\r\n this.startSelection( cursor );\r\n\r\n cursor.selection?.load( state.selection );\r\n\r\n this._processSelection( cursor, null, true );\r\n }\r\n }\r\n\r\n removeCursor( cursor: Cursor | undefined )\r\n {\r\n if ( !cursor )\r\n {\r\n return;\r\n }\r\n\r\n LX.deleteElement( this.selections[cursor.name] );\r\n delete this.selections[cursor.name];\r\n cursor.destroy();\r\n }\r\n\r\n resetCursorPos( flag: number, cursor?: Cursor, resetScroll = false )\r\n {\r\n cursor = cursor ?? this.getCurrentCursor();\r\n\r\n if ( flag & CodeEditor.CURSOR_LEFT )\r\n {\r\n cursor.left = 0;\r\n cursor.root.style.left = 'calc(' + this.xPadding + ')';\r\n cursor.position = 0;\r\n\r\n if ( resetScroll )\r\n {\r\n this.setScrollLeft( 0 );\r\n }\r\n }\r\n\r\n if ( flag & CodeEditor.CURSOR_TOP )\r\n {\r\n cursor.top = 0;\r\n cursor.root.style.top = '0px';\r\n cursor.line = 0;\r\n\r\n if ( resetScroll )\r\n {\r\n this.setScrollTop( 0 );\r\n }\r\n }\r\n }\r\n\r\n _addCursor( line: number = 0, position: number = 0, force: boolean = false, isMain: boolean = false )\r\n {\r\n // If cursor in that position exists, remove it instead..\r\n const exists: any = this.cursors.find( ( v: any ) => v.position == position && v.line == line );\r\n if ( exists && !force )\r\n {\r\n if ( !exists.isMain )\r\n {\r\n exists.remove();\r\n }\r\n\r\n return null;\r\n }\r\n\r\n let cursor: Cursor = new Cursor(\r\n 'cursor' + this.cursors.length,\r\n position,\r\n line,\r\n isMain,\r\n this\r\n );\r\n\r\n this.cursors.push( cursor );\r\n this.cursorsDOM.appendChild( cursor.root );\r\n\r\n return cursor;\r\n }\r\n\r\n _removeSecondaryCursors()\r\n {\r\n while ( this.cursors.length > 1 )\r\n {\r\n const r = this.cursors.pop();\r\n r?.root.remove();\r\n }\r\n }\r\n\r\n _getLastCursor()\r\n {\r\n return this.cursors.at( -1 );\r\n }\r\n\r\n _isLastCursor( cursor: Cursor )\r\n {\r\n return cursor === this._getLastCursor();\r\n }\r\n\r\n _logCursors()\r\n {\r\n for ( let cursor of this.cursors )\r\n {\r\n cursor.print();\r\n }\r\n }\r\n\r\n _addSpaceTabs( cursor: Cursor, n: number )\r\n {\r\n for ( var i = 0; i < n; ++i )\r\n {\r\n this.actions['Tab'].callback( cursor.line, cursor, null );\r\n }\r\n }\r\n\r\n _addSpaces( cursor: Cursor, n: number )\r\n {\r\n if ( cursor.selection && !cursor.selection.sameLine() )\r\n {\r\n cursor.selection.invertIfNecessary();\r\n\r\n for ( let lidx = cursor.selection.fromY; lidx <= cursor.selection.toY; ++lidx )\r\n {\r\n const lineString: string = this.code.lines[lidx];\r\n if ( !lineString.length )\r\n {\r\n continue;\r\n }\r\n\r\n // Remove indentation\r\n let lineStart = firstNonspaceIndex( lineString );\r\n\r\n // Only tabs/spaces in the line...\r\n if ( lineStart == -1 )\r\n {\r\n lineStart = lineString.length;\r\n }\r\n\r\n let indentSpaces = lineStart % this.tabSpaces;\r\n indentSpaces = indentSpaces == 0 ? this.tabSpaces : this.tabSpaces - indentSpaces;\r\n\r\n const spacesString = ' '.repeat( indentSpaces );\r\n\r\n this.code.lines[lidx] = [\r\n lineString.slice( 0, lineStart ),\r\n spacesString,\r\n lineString.slice( lineStart )\r\n ].join( '' );\r\n\r\n this.processLine( lidx );\r\n\r\n if ( cursor.line === lidx )\r\n {\r\n this.cursorToString( cursor, spacesString );\r\n }\r\n\r\n if ( cursor.selection.fromY === lidx )\r\n {\r\n cursor.selection.fromX = Math.max( cursor.selection.fromX + indentSpaces, 0 );\r\n }\r\n if ( cursor.selection.toY === lidx )\r\n {\r\n cursor.selection.toX = Math.max( cursor.selection.toX + indentSpaces, 0 );\r\n }\r\n\r\n this._processSelection( cursor, undefined, true );\r\n }\r\n\r\n return;\r\n }\r\n\r\n for ( var i = 0; i < n; ++i )\r\n {\r\n this.root.dispatchEvent( new CustomEvent( 'keydown', { 'detail': {\r\n skipUndo: true,\r\n key: ' ',\r\n targetCursor: this._lastProcessedCursorIndex\r\n } } ) );\r\n }\r\n }\r\n\r\n _removeSpaces( cursor: Cursor )\r\n {\r\n if ( cursor.selection )\r\n {\r\n cursor.selection.invertIfNecessary();\r\n }\r\n\r\n const lCount = cursor.selection ? 1 + ( cursor.selection.toY - cursor.selection.fromY ) : 1;\r\n\r\n for ( let i = 0; i < lCount; ++i )\r\n {\r\n const lidx = ( cursor.selection ? cursor.selection.fromY : cursor.line ) + i;\r\n const lineString: string = this.code.lines[lidx];\r\n\r\n // Remove indentation\r\n let lineStart = firstNonspaceIndex( lineString );\r\n\r\n // Nothing to remove... we are at the start of the line\r\n if ( lineStart == 0 )\r\n {\r\n continue;\r\n }\r\n\r\n // Only tabs/spaces in the line...\r\n if ( lineStart == -1 )\r\n {\r\n lineStart = lineString.length;\r\n }\r\n\r\n let indentSpaces = lineStart % this.tabSpaces;\r\n indentSpaces = indentSpaces == 0 ? this.tabSpaces : indentSpaces;\r\n const newStart = Math.max( lineStart - indentSpaces, 0 );\r\n\r\n this.code.lines[lidx] = [\r\n lineString.slice( 0, newStart ),\r\n lineString.slice( lineStart )\r\n ].join( '' );\r\n\r\n this.processLine( lidx );\r\n\r\n if ( cursor.line === lidx )\r\n {\r\n this.cursorToString( cursor, ' '.repeat( indentSpaces ), true );\r\n }\r\n\r\n if ( cursor.selection )\r\n {\r\n if ( cursor.selection.fromY === lidx )\r\n {\r\n cursor.selection.fromX = Math.max( cursor.selection.fromX - indentSpaces, 0 );\r\n }\r\n if ( cursor.selection.toY === lidx )\r\n {\r\n cursor.selection.toX = Math.max( cursor.selection.toX - indentSpaces, 0 );\r\n }\r\n\r\n this._processSelection( cursor, undefined, true );\r\n }\r\n }\r\n }\r\n\r\n updateScrollLeft( cursor: Cursor )\r\n {\r\n cursor = cursor ?? this.getCurrentCursor();\r\n\r\n const rightMargin = this.charWidth;\r\n const cursorX = cursor.position * this.charWidth;\r\n const currentScrollLeft = this.getScrollLeft();\r\n const viewportSizeX = this.codeScroller.clientWidth - CodeEditor.LINE_GUTTER_WIDTH; // Gutter offset\r\n const viewportX = viewportSizeX + currentScrollLeft;\r\n\r\n if ( cursorX >= ( viewportX - rightMargin ) )\r\n {\r\n const scroll = Math.max( cursorX - ( viewportSizeX - rightMargin ), 0 );\r\n this.setScrollLeft( scroll );\r\n return true;\r\n }\r\n }\r\n\r\n getScrollLeft()\r\n {\r\n if ( !this.codeScroller ) return 0;\r\n return this.codeScroller.scrollLeft;\r\n }\r\n\r\n getScrollTop()\r\n {\r\n if ( !this.codeScroller ) return 0;\r\n return this.codeScroller.scrollTop;\r\n }\r\n\r\n setScrollLeft( value: number )\r\n {\r\n if ( !this.codeScroller ) return;\r\n LX.doAsync( () => {\r\n this.codeScroller.scrollLeft = value;\r\n this.setScrollBarValue( 'horizontal', 0 );\r\n }, 10 );\r\n }\r\n\r\n setScrollTop( value: number )\r\n {\r\n if ( !this.codeScroller ) return;\r\n LX.doAsync( () => {\r\n this.codeScroller.scrollTop = value;\r\n this.setScrollBarValue( 'vertical' );\r\n }, 10 );\r\n }\r\n\r\n resize( flag: number = CodeEditor.RESIZE_SCROLLBAR_H_V, pMaxLength?: number, onResize?: any )\r\n {\r\n setTimeout( () => {\r\n let scrollWidth, scrollHeight;\r\n\r\n if ( flag & CodeEditor.RESIZE_SCROLLBAR_H )\r\n {\r\n // Update max viewport\r\n const maxLineLength = pMaxLength ?? this.getMaxLineLength();\r\n this._lastMaxLineLength = maxLineLength;\r\n scrollWidth = maxLineLength * this.charWidth + CodeEditor.LINE_GUTTER_WIDTH;\r\n this.codeSizer.style.minWidth = scrollWidth + 'px';\r\n }\r\n\r\n if ( flag & CodeEditor.RESIZE_SCROLLBAR_V )\r\n {\r\n scrollHeight = this.code.lines.length * this.lineHeight;\r\n this.codeSizer.style.minHeight = scrollHeight + 'px';\r\n }\r\n\r\n this.resizeScrollBars( flag );\r\n\r\n if ( onResize )\r\n {\r\n onResize( scrollWidth, scrollHeight );\r\n }\r\n }, 10 );\r\n }\r\n\r\n resizeIfNecessary( cursor: Cursor, force: boolean = false )\r\n {\r\n const maxLineLength = this.getMaxLineLength();\r\n const numViewportChars = Math.floor(\r\n ( this.codeScroller.clientWidth - CodeEditor.LINE_GUTTER_WIDTH ) / this.charWidth\r\n );\r\n if ( force || ( maxLineLength >= numViewportChars && maxLineLength != this._lastMaxLineLength ) )\r\n {\r\n this.resize( CodeEditor.RESIZE_SCROLLBAR_H, maxLineLength, () => {\r\n if ( cursor.position > numViewportChars )\r\n {\r\n this.setScrollLeft( cursor.position * this.charWidth );\r\n }\r\n } );\r\n }\r\n }\r\n\r\n resizeScrollBars( flag = CodeEditor.RESIZE_SCROLLBAR_H_V )\r\n {\r\n if ( flag & CodeEditor.RESIZE_SCROLLBAR_V )\r\n {\r\n const totalLinesInViewport = ( ( this.codeScroller.offsetHeight ) / this.lineHeight ) | 0;\r\n const needsVerticalScrollbar = this.code.lines.length >= totalLinesInViewport;\r\n if ( needsVerticalScrollbar )\r\n {\r\n this.vScrollbar.thumb.size = totalLinesInViewport / this.code.lines.length;\r\n this.vScrollbar.thumb.style.height = ( this.vScrollbar.thumb.size * 100.0 ) + '%';\r\n }\r\n\r\n this.vScrollbar.root.classList.toggle( 'hidden', !needsVerticalScrollbar );\r\n this.hScrollbar.root.style.width = `calc(100% - ${48 + ( needsVerticalScrollbar ? ScrollBar.SCROLLBAR_VERTICAL_WIDTH : 0 )}px)`; // 48 is the line gutter\r\n this.codeArea.root.style.width = `calc(100% - ${needsVerticalScrollbar ? ScrollBar.SCROLLBAR_VERTICAL_WIDTH : 0}px)`;\r\n }\r\n\r\n if ( flag & CodeEditor.RESIZE_SCROLLBAR_H )\r\n {\r\n const numViewportChars = Math.floor(\r\n ( this.codeScroller.clientWidth - CodeEditor.LINE_GUTTER_WIDTH ) / this.charWidth\r\n );\r\n const maxLineLength = this._lastMaxLineLength!;\r\n const needsHorizontalScrollbar = maxLineLength >= numViewportChars;\r\n\r\n if ( needsHorizontalScrollbar )\r\n {\r\n this.hScrollbar.thumb.size = numViewportChars / maxLineLength;\r\n this.hScrollbar.thumb.style.width = ( this.hScrollbar.thumb.size * 100.0 ) + '%';\r\n }\r\n\r\n this.hScrollbar.root.classList.toggle( 'hidden', !needsHorizontalScrollbar );\r\n this.codeArea.root.style.height = `calc(100% - ${\r\n this._fullVerticalOffset + ( needsHorizontalScrollbar ? ScrollBar.SCROLLBAR_HORIZONTAL_HEIGHT : 0 )\r\n }px)`;\r\n }\r\n }\r\n\r\n setScrollBarValue( type: string = 'vertical', value?: number )\r\n {\r\n if ( type == 'vertical' )\r\n {\r\n const scrollHeight = this.codeScroller.scrollHeight - this.codeScroller.clientHeight;\r\n\r\n if ( scrollHeight > 0 )\r\n {\r\n const scrollBarHeight = this.vScrollbar.thumb.parentElement.offsetHeight;\r\n const scrollThumbHeight = this.vScrollbar.thumb.offsetHeight;\r\n const currentScroll = this.codeScroller.scrollTop;\r\n this.vScrollbar.thumb._top = ( currentScroll / scrollHeight ) * ( scrollBarHeight - scrollThumbHeight );\r\n this.vScrollbar.thumb.style.top = this.vScrollbar.thumb._top + 'px';\r\n }\r\n }\r\n else\r\n {\r\n if ( value !== undefined )\r\n {\r\n this.codeScroller.scrollLeft += value;\r\n }\r\n\r\n // Only when scroll is needed\r\n const scrollWidth = this.codeScroller.scrollWidth - this.codeScroller.clientWidth;\r\n if ( scrollWidth > 0 )\r\n {\r\n const scrollBarWidth = this.hScrollbar.thumb.parentElement.offsetWidth;\r\n const scrollThumbWidth = this.hScrollbar.thumb.offsetWidth;\r\n const currentScroll = this.codeScroller.scrollLeft;\r\n this.hScrollbar.thumb._left = ( currentScroll / scrollWidth ) * ( scrollBarWidth - scrollThumbWidth );\r\n this.hScrollbar.thumb.style.left = this.hScrollbar.thumb._left + 'px';\r\n }\r\n }\r\n }\r\n\r\n updateHorizontalScrollFromScrollBar( value: number )\r\n {\r\n value = this.hScrollbar.thumb._left - value;\r\n\r\n // Move scrollbar thumb\r\n\r\n const scrollBarWidth = this.hScrollbar.thumb.parentElement.offsetWidth;\r\n const scrollThumbWidth = this.hScrollbar.thumb.offsetWidth;\r\n\r\n this.hScrollbar.thumb._left = LX.clamp( value, 0, scrollBarWidth - scrollThumbWidth );\r\n this.hScrollbar.thumb.style.left = this.hScrollbar.thumb._left + 'px';\r\n\r\n // Scroll code\r\n\r\n const scrollWidth = this.codeScroller.scrollWidth - this.codeScroller.clientWidth;\r\n const currentScroll = ( this.hScrollbar.thumb._left * scrollWidth ) / ( scrollBarWidth - scrollThumbWidth );\r\n this.codeScroller.scrollLeft = currentScroll;\r\n\r\n this._discardScroll = true;\r\n }\r\n\r\n updateVerticalScrollFromScrollBar( value: number ): void\r\n {\r\n value = this.vScrollbar.thumb._top - value;\r\n\r\n // Move scrollbar thumb\r\n\r\n const scrollBarHeight = this.vScrollbar.thumb.parentElement.offsetHeight;\r\n const scrollThumbHeight = this.vScrollbar.thumb.offsetHeight;\r\n\r\n this.vScrollbar.thumb._top = LX.clamp( value, 0, scrollBarHeight - scrollThumbHeight );\r\n this.vScrollbar.thumb.style.top = this.vScrollbar.thumb._top + 'px';\r\n\r\n // Scroll code\r\n\r\n const scrollHeight = this.codeScroller.scrollHeight - this.codeScroller.clientHeight;\r\n const currentScroll = ( this.vScrollbar.thumb._top * scrollHeight ) / ( scrollBarHeight - scrollThumbHeight );\r\n this.codeScroller.scrollTop = currentScroll;\r\n }\r\n\r\n getCharAtPos( cursor: Cursor, offset: number = 0 )\r\n {\r\n return this.code.lines[cursor.line][cursor.position + offset];\r\n }\r\n\r\n getWordAtPos( cursor: Cursor, offset: number = 0 )\r\n {\r\n const col = cursor.line;\r\n const words = this.code.lines[col];\r\n\r\n const isChar = ( char: string ) => {\r\n const exceptions = [ '_', '#', '!' ];\r\n const code = char.charCodeAt( 0 );\r\n return ( exceptions.indexOf( char ) > -1 ) || ( code > 47 && code < 58 ) || ( code > 64 && code < 91 )\r\n || ( code > 96 && code < 123 );\r\n };\r\n\r\n let from = cursor.position + offset;\r\n let to = cursor.position + offset;\r\n\r\n // Check left ...\r\n\r\n while ( words[from] && isChar( words[from] ) )\r\n {\r\n from--;\r\n }\r\n\r\n from++;\r\n\r\n // Check right ...\r\n\r\n while ( words[to] && isChar( words[to] ) )\r\n {\r\n to++;\r\n }\r\n\r\n // Skip spaces ...\r\n\r\n let word = words.substring( from, to );\r\n if ( word == ' ' )\r\n {\r\n if ( offset < 0 )\r\n {\r\n while ( words[from - 1] != undefined && words[from - 1] == ' ' )\r\n {\r\n from--;\r\n }\r\n to++;\r\n word = words.substring( from, to + 1 );\r\n }\r\n else\r\n {\r\n while ( words[to] != undefined && words[to] == ' ' )\r\n {\r\n to++;\r\n }\r\n from--;\r\n word = words.substring( from, to );\r\n }\r\n }\r\n\r\n return [ word, from, to ];\r\n }\r\n\r\n _measureChar( char: string = 'M', useFloating: boolean = true, getBB: boolean = false )\r\n {\r\n const parentContainer = LX.makeContainer( null, 'lexcodeeditor', '', document.body );\r\n const container = LX.makeContainer( null, 'code', '', parentContainer );\r\n const line = document.createElement( 'pre' );\r\n container.appendChild( line );\r\n const text = document.createElement( 'span' );\r\n line.appendChild( text );\r\n text.innerText = char;\r\n var rect = text.getBoundingClientRect();\r\n LX.deleteElement( parentContainer );\r\n const bb = [ useFloating ? rect.width : Math.floor( rect.width ), useFloating ? rect.height : Math.floor( rect.height ) ];\r\n return getBB ? bb : bb[0];\r\n }\r\n\r\n measureString( str: string )\r\n {\r\n return str.length * this.charWidth;\r\n }\r\n\r\n runScript( code: string )\r\n {\r\n const script = document.createElement( 'script' );\r\n script.type = 'module';\r\n script.innerHTML = code;\r\n // script.src = url[ i ] + ( version ? \"?version=\" + version : \"\" );\r\n script.async = false;\r\n // script.onload = function(e) { };\r\n document.getElementsByTagName( 'head' )[0].appendChild( script );\r\n }\r\n\r\n toJSONFormat( text: string )\r\n {\r\n let params = text.split( ':' );\r\n\r\n for ( let i = 0; i < params.length; i++ )\r\n {\r\n let key: any = params[i].split( ',' );\r\n if ( key.length > 1 )\r\n {\r\n if ( key[key.length - 1].includes( ']' ) )\r\n {\r\n continue;\r\n }\r\n key = key[key.length - 1];\r\n }\r\n else if ( key[0].includes( '}' ) )\r\n {\r\n continue;\r\n }\r\n else\r\n {\r\n key = key[0];\r\n }\r\n key = key.replaceAll( /[{}\\n\\r]/g, '' ).replaceAll( ' ', '' );\r\n if ( key[0] != '\"' && key[key.length - 1] != '\"' )\r\n {\r\n params[i] = params[i].replace( key, '\"' + key + '\"' );\r\n }\r\n }\r\n\r\n text = params.join( ':' );\r\n\r\n try\r\n {\r\n let json = JSON.parse( text );\r\n return JSON.stringify( json, undefined, 4 );\r\n }\r\n catch ( e )\r\n {\r\n alert( 'Invalid JSON format' );\r\n return;\r\n }\r\n }\r\n\r\n showAutoCompleteBox( key: string, cursor: Cursor )\r\n {\r\n if ( !cursor.isMain )\r\n {\r\n return;\r\n }\r\n\r\n const [ word, start, end ] = this.getWordAtPos( cursor, -1 );\r\n if ( key == ' ' || !word.length )\r\n {\r\n this.hideAutoCompleteBox();\r\n return;\r\n }\r\n\r\n this.autocomplete.innerHTML = ''; // Clear all suggestions\r\n\r\n // Add language special keys...\r\n let suggestions = [\r\n ...Array.from( CodeEditor.keywords[this.highlight] ?? [] ),\r\n ...Array.from( CodeEditor.builtIn[this.highlight] ?? [] ),\r\n ...Array.from( CodeEditor.statements[this.highlight] ?? [] ),\r\n ...Array.from( CodeEditor.types[this.highlight] ?? [] ),\r\n ...Array.from( CodeEditor.utils[this.highlight] ?? [] )\r\n ];\r\n\r\n const scopeStack = [ ...this.code.lineScopes[cursor.line] ];\r\n const scope = scopeStack.at( -1 );\r\n if ( scope.type.startsWith( 'enum' ) )\r\n {\r\n const enumValues = Array.from( this.code.symbolsTable ).filter( ( s: any ) =>\r\n s[1][0].kind === 'enum_value' && s[1][0].scope === scope.name\r\n ).map( ( s: any ) => s[0] );\r\n suggestions = suggestions.concat( enumValues.slice( 0, -1 ) );\r\n }\r\n else\r\n {\r\n const otherValues = Array.from( this.code.symbolsTable ).map( ( s: any ) => s[0] );\r\n suggestions = suggestions.concat( otherValues.slice( 0, -1 ) );\r\n }\r\n\r\n // Add custom suggestions...\r\n suggestions = suggestions.concat( this.customSuggestions );\r\n\r\n // Remove 1/2 char words and duplicates...\r\n suggestions = ( Array.from( new Set( suggestions ) ) as string[] ).filter( ( s: string ) =>\r\n s.length > 2 && s.toLowerCase().includes( word.toLowerCase() )\r\n );\r\n\r\n // Order...\r\n\r\n function scoreSuggestion( s: string, prefix: string )\r\n {\r\n if ( s.startsWith( prefix ) ) return 0; // best option\r\n if ( s.includes( prefix ) ) return 1;\r\n return 2; // worst\r\n }\r\n\r\n suggestions = ( suggestions as string[] ).sort( ( a, b ) =>\r\n ( scoreSuggestion( a, word ) - scoreSuggestion( b, word ) ) || a.localeCompare( b )\r\n );\r\n\r\n for ( let s of suggestions )\r\n {\r\n const currSuggestion = s as string;\r\n const pre = document.createElement( 'pre' );\r\n this.autocomplete.appendChild( pre );\r\n\r\n const symbol = this.code.symbolsTable.get( s );\r\n\r\n let iconName = 'CaseLower';\r\n let iconClass = 'foo';\r\n\r\n if ( symbol )\r\n {\r\n switch ( symbol[0].kind )\r\n // Get first occurrence\r\n {\r\n case 'variable':\r\n iconName = 'Cuboid';\r\n iconClass = 'text-blue-400';\r\n break;\r\n case 'method':\r\n iconName = 'Box';\r\n iconClass = 'text-fuchsia-500';\r\n break;\r\n case 'class':\r\n iconName = 'CircleNodes';\r\n iconClass = 'text-orange-500';\r\n break;\r\n }\r\n }\r\n else\r\n {\r\n if ( this._mustHightlightWord( currSuggestion, CodeEditor.utils ) )\r\n {\r\n iconName = 'ToolCase';\r\n }\r\n else if ( this._mustHightlightWord( currSuggestion, CodeEditor.types ) )\r\n {\r\n iconName = 'Type';\r\n iconClass = 'text-blue-400';\r\n }\r\n }\r\n\r\n pre.appendChild( LX.makeIcon( iconName, { iconClass: 'mr-1', svgClass: 'sm ' + iconClass } ) );\r\n pre.addEventListener( 'click', () => {\r\n this.autoCompleteWord( currSuggestion );\r\n } );\r\n\r\n // Highlight the written part\r\n const index = currSuggestion.toLowerCase().indexOf( word.toLowerCase() );\r\n\r\n var preWord = document.createElement( 'span' );\r\n preWord.innerHTML = currSuggestion.substring( 0, index );\r\n pre.appendChild( preWord );\r\n\r\n var actualWord = document.createElement( 'span' );\r\n actualWord.innerHTML = currSuggestion.substr( index, word.length );\r\n actualWord.classList.add( 'word-highlight' );\r\n pre.appendChild( actualWord );\r\n\r\n var postWord = document.createElement( 'span' );\r\n postWord.innerHTML = currSuggestion.substring( index + word.length );\r\n pre.appendChild( postWord );\r\n }\r\n\r\n if ( !this.autocomplete.childElementCount )\r\n {\r\n this.hideAutoCompleteBox();\r\n return;\r\n }\r\n\r\n const maxX = this.codeScroller.clientWidth - 256; // Viewport - box width\r\n\r\n // Select always first option\r\n ( this.autocomplete.firstChild as any ).classList.add( 'selected' );\r\n\r\n // Show box\r\n this.autocomplete.classList.toggle( 'show', true );\r\n this.autocomplete.classList.toggle( 'no-scrollbar', !( this.autocomplete.scrollHeight > this.autocomplete.offsetHeight ) );\r\n this.autocomplete.style.left = `${Math.min( cursor.left + CodeEditor.LINE_GUTTER_WIDTH - this.getScrollLeft(), maxX )}px`;\r\n this.autocomplete.style.top = `${( cursor.top + this._verticalTopOffset + this.lineHeight - this.getScrollTop() )}px`;\r\n\r\n this.isAutoCompleteActive = true;\r\n }\r\n\r\n hideAutoCompleteBox()\r\n {\r\n if ( !this.autocomplete )\r\n {\r\n return;\r\n }\r\n\r\n const isActive = this.isAutoCompleteActive;\r\n this.isAutoCompleteActive = false;\r\n this.autocomplete.classList.remove( 'show' );\r\n this.autocomplete.innerHTML = ''; // Clear all suggestions\r\n\r\n return isActive != this.isAutoCompleteActive;\r\n }\r\n\r\n autoCompleteWord( suggestion?: string )\r\n {\r\n if ( !this.isAutoCompleteActive )\r\n {\r\n return;\r\n }\r\n\r\n let [ suggestedWord, idx ] = this._getSelectedAutoComplete();\r\n suggestedWord = suggestion ?? suggestedWord;\r\n\r\n for ( let cursor of this.cursors )\r\n {\r\n const [ word, start, end ] = this.getWordAtPos( cursor, -1 );\r\n\r\n const lineString = this.code.lines[cursor.line];\r\n this.code.lines[cursor.line] = lineString.slice( 0, start ) + suggestedWord + lineString.slice( end );\r\n\r\n // Process lines and remove suggestion box\r\n this.cursorToPosition( cursor, start + suggestedWord.length );\r\n this.processLine( cursor.line );\r\n }\r\n\r\n // Only the main cursor autocompletes, skip the \"Tab\" event for the rest\r\n this._skipTabs = this.cursors.length - 1;\r\n\r\n this.hideAutoCompleteBox();\r\n }\r\n\r\n _getSelectedAutoComplete(): any[]\r\n {\r\n for ( let i = 0; i < this.autocomplete.childElementCount; ++i )\r\n {\r\n const child: any = this.autocomplete.childNodes[i];\r\n if ( child.classList.contains( 'selected' ) )\r\n {\r\n var word = '';\r\n for ( let childSpan of child.childNodes )\r\n {\r\n if ( childSpan.constructor != HTMLSpanElement )\r\n {\r\n continue;\r\n }\r\n word += childSpan.innerHTML;\r\n }\r\n\r\n return [ word, i ]; // Get text of the span inside the 'pre' element\r\n }\r\n }\r\n\r\n return [ null, -1 ];\r\n }\r\n\r\n _moveArrowSelectedAutoComplete( dir: string )\r\n {\r\n if ( !this.isAutoCompleteActive )\r\n {\r\n return;\r\n }\r\n\r\n const [ word, idx ] = this._getSelectedAutoComplete();\r\n const offset = dir == 'down' ? 1 : -1;\r\n const fIdx = idx + offset;\r\n\r\n const autocompleteRowHeight = 22;\r\n const autocompleteHeight = 132;\r\n\r\n if ( dir == 'down' )\r\n {\r\n if ( fIdx >= this.autocomplete.childElementCount ) return;\r\n\r\n if ( ( ( idx + offset * 2 ) * autocompleteRowHeight ) - this.autocomplete.scrollTop > autocompleteHeight )\r\n {\r\n this.autocomplete.scrollTop += autocompleteRowHeight;\r\n }\r\n }\r\n else if ( dir == 'up' )\r\n {\r\n if ( fIdx < 0 ) return;\r\n\r\n if ( ( fIdx * autocompleteRowHeight ) < this.autocomplete.scrollTop )\r\n {\r\n this.autocomplete.scrollTop -= autocompleteRowHeight;\r\n }\r\n }\r\n\r\n // Remove selected from the current word and add it to the next one\r\n LX.removeClass( this.autocomplete.childNodes[idx], 'selected' );\r\n LX.addClass( this.autocomplete.childNodes[idx + offset], 'selected' );\r\n }\r\n\r\n showSearchBox( clear: boolean = false )\r\n {\r\n this.hideSearchLineBox();\r\n\r\n LX.addClass( this.searchbox, 'opened' );\r\n this.isSearchboxActive = true;\r\n\r\n const input: any = this.searchbox.querySelector( 'input' );\r\n\r\n if ( clear )\r\n {\r\n input.value = '';\r\n }\r\n else\r\n {\r\n const cursor = this.getCurrentCursor();\r\n\r\n if ( cursor.selection )\r\n {\r\n input.value = cursor.selection.getText() ?? input.value;\r\n }\r\n }\r\n\r\n input.selectionStart = 0;\r\n input.selectionEnd = input.value.length;\r\n\r\n input.focus();\r\n }\r\n\r\n hideSearchBox()\r\n {\r\n const active = this.isSearchboxActive;\r\n\r\n if ( this.isSearchboxActive )\r\n {\r\n this.searchbox.classList.remove( 'opened' );\r\n this.isSearchboxActive = false;\r\n }\r\n else if ( this._lastResult )\r\n {\r\n LX.deleteElement( this._lastResult.dom );\r\n delete this._lastResult;\r\n }\r\n\r\n this.searchResultSelections.classList.remove( 'show' );\r\n\r\n return ( active != this.isSearchboxActive );\r\n }\r\n\r\n search( text?: string | null, reverse: boolean = false, callback?: any, skipAlert: boolean = false, forceFocus: boolean = true )\r\n {\r\n text = text ?? this._lastTextFound;\r\n\r\n if ( !text )\r\n {\r\n return;\r\n }\r\n\r\n let cursor = this.getCurrentCursor();\r\n let cursorData = new LX.vec2( cursor.position, cursor.line );\r\n let line = null;\r\n let char = -1;\r\n\r\n if ( this._lastResult )\r\n {\r\n LX.deleteElement( this._lastResult.dom );\r\n cursorData = this._lastResult.pos;\r\n cursorData.x += text.length * ( reverse ? -1 : 1 );\r\n delete this._lastResult;\r\n }\r\n\r\n const getIndex = ( l: number ) => {\r\n var string = this.code.lines[l];\r\n\r\n if ( reverse )\r\n {\r\n string = string.substr( 0, l == cursorData.y ? cursorData.x : string.length );\r\n var reversed = strReverse( string );\r\n var reversedIdx = reversed.indexOf( strReverse( text ) );\r\n return reversedIdx == -1 ? -1 : string.length - reversedIdx - text.length;\r\n }\r\n else\r\n {\r\n return string.substr( l == cursorData.y ? cursorData.x : 0 ).indexOf( text );\r\n }\r\n };\r\n\r\n if ( reverse )\r\n {\r\n for ( var j = cursorData.y; j >= 0; --j )\r\n {\r\n char = getIndex( j );\r\n if ( char > -1 )\r\n {\r\n line = j;\r\n break;\r\n }\r\n }\r\n }\r\n else\r\n {\r\n for ( var j = cursorData.y; j < this.code.lines.length; ++j )\r\n {\r\n char = getIndex( j );\r\n if ( char > -1 )\r\n {\r\n line = j;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if ( line == null )\r\n {\r\n if ( !skipAlert )\r\n {\r\n alert( 'No results!' );\r\n }\r\n\r\n const lastLine = this.code.lines.length - 1;\r\n\r\n this._lastResult = {\r\n 'dom': this.searchResultSelections.lastChild,\r\n 'pos': reverse ? new LX.vec2( this.code.lines[lastLine].length, lastLine ) : new LX.vec2( 0, 0 )\r\n };\r\n\r\n return;\r\n }\r\n\r\n /*\r\n Position idx is computed from last pos, which could be in same line,\r\n so we search in the substring (first_ocurrence, end). That's why we\r\n have to add the length of the substring (0, first_ocurrence)\r\n */\r\n\r\n if ( !reverse )\r\n {\r\n char += line == cursorData.y ? cursorData.x : 0;\r\n }\r\n\r\n // Text found..\r\n\r\n this._lastTextFound = text;\r\n\r\n this.codeScroller.scrollTo(\r\n Math.max( char * this.charWidth - this.codeScroller.clientWidth, 0 ),\r\n Math.max( line - 10, 0 ) * this.lineHeight\r\n );\r\n\r\n if ( callback )\r\n {\r\n callback( char, line );\r\n }\r\n else\r\n {\r\n // Show elements\r\n this.searchResultSelections.classList.add( 'show' );\r\n\r\n // Create new selection instance\r\n cursor.selection = new CodeSelection( this, cursor, 'lexcodesearchresult' );\r\n cursor.selection.selectInline( cursor, char, line, this.measureString( text ), true );\r\n }\r\n\r\n this._lastResult = {\r\n 'dom': this.searchResultSelections.lastChild,\r\n 'pos': new LX.vec2( char, line ),\r\n reverse\r\n };\r\n\r\n // Force focus back to search box\r\n if ( forceFocus )\r\n {\r\n const input: any = this.searchbox.querySelector( 'input' );\r\n input.focus();\r\n }\r\n }\r\n\r\n showSearchLineBox()\r\n {\r\n this.hideSearchBox();\r\n\r\n this.searchlinebox.classList.add( 'opened' );\r\n this.isSearchlineboxActive = true;\r\n\r\n const input: any = this.searchlinebox.querySelector( 'input' );\r\n input.value = ':';\r\n input.focus();\r\n }\r\n\r\n hideSearchLineBox()\r\n {\r\n if ( this.isSearchlineboxActive )\r\n {\r\n this.searchlinebox.classList.remove( 'opened' );\r\n this.isSearchlineboxActive = false;\r\n }\r\n }\r\n\r\n goToLine( line: any )\r\n {\r\n if ( !this._isNumber( line ) )\r\n {\r\n return;\r\n }\r\n\r\n this.codeScroller.scrollTo( 0, Math.max( line - 15 ) * this.lineHeight );\r\n\r\n // Select line ?\r\n var cursor = this.getCurrentCursor( true );\r\n this.cursorToLine( cursor, line - 1, true );\r\n }\r\n\r\n selectNextOcurrence( cursor: Cursor )\r\n {\r\n if ( !cursor.selection )\r\n {\r\n return;\r\n }\r\n\r\n const text = cursor.selection.getText();\r\n if ( !text )\r\n {\r\n return;\r\n }\r\n\r\n if ( !this._currentOcurrences )\r\n {\r\n const currentKey = [ cursor.position - text.length, cursor.line ].join( '_' );\r\n this._currentOcurrences = {};\r\n this._currentOcurrences[currentKey] = true;\r\n }\r\n\r\n this.search( text, false, ( col: number, ln: number ) => {\r\n const key = [ col, ln ].join( '_' );\r\n\r\n if ( this._currentOcurrences[key] )\r\n {\r\n return;\r\n }\r\n\r\n var newCursor = this._addCursor( ln, col, true );\r\n if ( newCursor )\r\n {\r\n this.startSelection( newCursor );\r\n if ( newCursor.selection )\r\n {\r\n newCursor.selection.selectInline( newCursor, col, ln, this.measureString( text ) );\r\n this.cursorToString( newCursor, text );\r\n }\r\n }\r\n\r\n this._currentOcurrences[key] = true;\r\n }, true, false );\r\n }\r\n\r\n _updateDataInfoPanel( signal: string, value: any )\r\n {\r\n if ( !this.skipInfo )\r\n {\r\n if ( this.cursors.length > 1 )\r\n {\r\n value = '';\r\n }\r\n\r\n LX.emitSignal( signal, value );\r\n }\r\n }\r\n\r\n _setActiveLine( n?: number )\r\n {\r\n n = n ?? this.state.activeLine;\r\n if ( n === undefined )\r\n {\r\n return;\r\n }\r\n\r\n const cursor = this.getCurrentCursor();\r\n this._updateDataInfoPanel( '@cursor-data', `Ln ${n + 1}, Col ${cursor.position + 1}` );\r\n\r\n const oldLocal = this.toLocalLine( this.state.activeLine );\r\n let line = this.code.childNodes[oldLocal];\r\n\r\n if ( !line )\r\n {\r\n return;\r\n }\r\n\r\n line.classList.remove( 'active-line' );\r\n\r\n // Set new active\r\n {\r\n this.state.activeLine = n;\r\n\r\n const newLocal = this.toLocalLine( n );\r\n line = this.code.childNodes[newLocal];\r\n if ( line ) line.classList.add( 'active-line' );\r\n }\r\n }\r\n\r\n _hideActiveLine()\r\n {\r\n this.code.querySelectorAll( '.active-line' ).forEach( ( e: HTMLElement ) => e.classList.remove( 'active-line' ) );\r\n }\r\n\r\n _setFontSize( size: number )\r\n {\r\n // Change font size\r\n this.fontSize = size;\r\n const r: any = document.querySelector( ':root' );\r\n r.style.setProperty( '--code-editor-font-size', `${this.fontSize}px` );\r\n this.charWidth = this._measureChar() as number;\r\n\r\n window.localStorage.setItem( 'lexcodeeditor-font-size', `${this.fontSize}` );\r\n\r\n // Change row size\r\n const rowPixels = this.fontSize + 6;\r\n r.style.setProperty( '--code-editor-row-height', `${rowPixels}px` );\r\n this.lineHeight = rowPixels;\r\n\r\n // Relocate cursors\r\n this.relocateCursors();\r\n\r\n // Resize the code area\r\n this.processLines();\r\n\r\n // Emit event\r\n LX.emitSignal( '@font-size', this.fontSize );\r\n }\r\n\r\n _applyFontSizeOffset( offset = 0 )\r\n {\r\n const newFontSize = LX.clamp( this.fontSize + offset, CodeEditor.CODE_MIN_FONT_SIZE, CodeEditor.CODE_MAX_FONT_SIZE );\r\n this._setFontSize( newFontSize );\r\n }\r\n\r\n _increaseFontSize()\r\n {\r\n this._applyFontSizeOffset( 1 );\r\n }\r\n\r\n _decreaseFontSize()\r\n {\r\n this._applyFontSizeOffset( -1 );\r\n }\r\n\r\n _clearTmpVariables()\r\n {\r\n delete this._currentLineString;\r\n delete this._currentLineNumber;\r\n delete this._buildingString;\r\n delete this._pendingString;\r\n delete this._buildingBlockComment;\r\n delete this._markdownHeader;\r\n delete this._lastResult;\r\n delete this._scopeStack;\r\n }\r\n\r\n async _requestFileAsync( url: string, dataType?: string, nocache: boolean = false )\r\n {\r\n return new Promise( ( resolve, reject ) => {\r\n dataType = dataType ?? 'arraybuffer';\r\n const mimeType = dataType === 'arraybuffer' ? 'application/octet-stream' : undefined;\r\n var xhr: any = new XMLHttpRequest();\r\n xhr.open( 'GET', url, true );\r\n xhr.responseType = dataType;\r\n if ( mimeType )\r\n {\r\n xhr.overrideMimeType( mimeType );\r\n }\r\n if ( nocache )\r\n {\r\n xhr.setRequestHeader( 'Cache-Control', 'no-cache' );\r\n }\r\n xhr.onload = function()\r\n {\r\n var response = this.response;\r\n if ( this.status != 200 )\r\n {\r\n var err = 'Error ' + this.status;\r\n reject( err );\r\n return;\r\n }\r\n resolve( response );\r\n };\r\n xhr.onerror = function( err: any )\r\n {\r\n reject( err );\r\n };\r\n xhr.send();\r\n return xhr;\r\n } );\r\n }\r\n}\r\n\r\nconst CE = CodeEditor as any;\r\n\r\nCE.languages = {\r\n 'Plain Text': { ext: 'txt', blockComments: false, singleLineComments: false, numbers: false, icon: 'AlignLeft text-neutral-500' },\r\n 'JavaScript': { ext: 'js', icon: 'Js text-yellow-500' },\r\n 'TypeScript': { ext: 'ts', icon: 'Ts text-blue-600' },\r\n 'C': { ext: [ 'c', 'h' ], usePreprocessor: true, icon: { 'c': 'C text-sky-400', 'h': 'C text-fuchsia-500' } },\r\n 'C++': { ext: [ 'cpp', 'hpp' ], usePreprocessor: true, icon: { 'cpp': 'CPlusPlus text-sky-400', 'hpp': 'CPlusPlus text-fuchsia-500' } },\r\n 'CSS': { ext: 'css', icon: 'Hash text-blue-700' },\r\n 'CMake': { ext: 'cmake', singleLineCommentToken: '#', blockComments: false, ignoreCase: true },\r\n 'GLSL': { ext: 'glsl', usePreprocessor: true },\r\n 'WGSL': { ext: 'wgsl', usePreprocessor: true },\r\n 'JSON': { ext: 'json', blockComments: false, singleLineComments: false, icon: 'Json text-yellow-400' },\r\n 'XML': { ext: 'xml', tags: true, icon: 'Rss text-orange-500' },\r\n 'Rust': { ext: 'rs', icon: 'Rust text-foreground' },\r\n 'Python': { ext: 'py', singleLineCommentToken: '#', icon: 'Python text-cyan-600' },\r\n 'HTML': { ext: 'html', tags: true, singleLineComments: false, blockCommentsTokens: [ '<!--', '-->' ], numbers: false,\r\n icon: 'Code text-orange-500' },\r\n 'Batch': { ext: 'bat', blockComments: false, singleLineCommentToken: '::', ignoreCase: true, icon: 'Windows text-blue-400' },\r\n 'Markdown': { ext: 'md', blockComments: false, singleLineCommentToken: '::', tags: true, numbers: false, icon: 'Markdown text-foreground' },\r\n 'PHP': { ext: 'php', icon: 'Php text-purple-700' }\r\n};\r\n\r\nCE.nativeTypes = {\r\n 'C++': [ 'int', 'float', 'double', 'bool', 'long', 'short', 'char', 'wchar_t', 'void' ],\r\n 'WGSL': [ 'bool', 'u32', 'i32', 'f16', 'f32', 'vec2', 'vec3', 'vec4', 'vec2f', 'vec3f', 'vec4f', 'mat2x2f', 'mat3x3f', 'mat4x4f', 'array',\r\n 'vec2u', 'vec3u', 'vec4u', 'ptr', 'sampler' ]\r\n};\r\n\r\nCE.declarationKeywords = {\r\n 'JavaScript': [ 'var', 'let', 'const', 'this', 'static', 'class' ],\r\n 'C++': [ ...CE.nativeTypes['C++'], 'const', 'auto', 'class', 'struct', 'namespace', 'enum', 'extern' ]\r\n};\r\n\r\nCE.keywords = {\r\n 'JavaScript': [ 'var', 'let', 'const', 'this', 'in', 'of', 'true', 'false', 'new', 'function', 'NaN', 'static', 'class', 'constructor', 'null',\r\n 'typeof', 'debugger', 'abstract', 'arguments', 'extends', 'instanceof', 'Infinity', 'get' ],\r\n 'TypeScript': [ 'var', 'let', 'const', 'this', 'in', 'of', 'true', 'false', 'new', 'function', 'class', 'extends', 'instanceof', 'Infinity',\r\n 'private', 'public', 'protected', 'interface', 'enum', 'type', 'get' ],\r\n 'C': [ 'int', 'float', 'double', 'long', 'short', 'char', 'const', 'void', 'true', 'false', 'auto', 'struct', 'typedef', 'signed', 'volatile',\r\n 'unsigned', 'static', 'extern', 'enum', 'register', 'union' ],\r\n 'C++': [ ...CE.nativeTypes['C++'], 'const', 'static_cast', 'dynamic_cast', 'new', 'delete', 'true', 'false', 'auto', 'class', 'struct', 'typedef',\r\n 'nullptr', 'NULL', 'signed', 'unsigned', 'namespace', 'enum', 'extern', 'union', 'sizeof', 'static', 'private', 'public' ],\r\n 'CMake': [ 'cmake_minimum_required', 'set', 'not', 'if', 'endif', 'exists', 'string', 'strequal', 'add_definitions', 'macro', 'endmacro', 'file',\r\n 'list', 'source_group', 'add_executable', 'target_include_directories', 'set_target_properties', 'set_property', 'add_compile_options',\r\n 'add_link_options', 'include_directories', 'add_library', 'target_link_libraries', 'target_link_options', 'add_subdirectory',\r\n 'add_compile_definitions', 'project', 'cache' ],\r\n 'JSON': [ 'true', 'false' ],\r\n 'GLSL': [ 'true', 'false', 'function', 'int', 'float', 'vec2', 'vec3', 'vec4', 'mat2x2', 'mat3x3', 'mat4x4', 'struct' ],\r\n 'CSS': [ 'body', 'html', 'canvas', 'div', 'input', 'span', '.', 'table', 'tr', 'td', 'th', 'label', 'video', 'img', 'code', 'button', 'select',\r\n 'option', 'svg', 'media', 'all', 'i', 'a', 'li', 'h1', 'h2', 'h3', 'h4', 'h5', 'last-child', 'tbody', 'pre', 'monospace', 'font-face' ],\r\n 'WGSL': [ ...CE.nativeTypes['WGSL'], 'var', 'let', 'true', 'false', 'fn', 'atomic', 'struct', 'sampler_comparison', 'texture_depth_2d',\r\n 'texture_depth_2d_array', 'texture_depth_cube', 'texture_depth_cube_array', 'texture_depth_multisampled_2d', 'texture_external', 'texture_1d',\r\n 'texture_2d', 'texture_2d_array', 'texture_3d', 'texture_cube', 'texture_cube_array', 'texture_storage_1d', 'texture_storage_2d',\r\n 'texture_storage_2d_array', 'texture_storage_3d' ],\r\n 'Rust': [ 'as', 'const', 'crate', 'enum', 'extern', 'false', 'fn', 'impl', 'in', 'let', 'mod', 'move', 'mut', 'pub', 'ref', 'self', 'Self',\r\n 'static', 'struct', 'super', 'trait', 'true', 'type', 'unsafe', 'use', 'where', 'abstract', 'become', 'box', 'final', 'macro', 'override',\r\n 'priv', 'typeof', 'unsized', 'virtual' ],\r\n 'Python': [ 'False', 'def', 'None', 'True', 'in', 'is', 'and', 'lambda', 'nonlocal', 'not', 'or' ],\r\n 'Batch': [ 'set', 'echo', 'off', 'del', 'defined', 'setlocal', 'enabledelayedexpansion', 'driverquery', 'print' ],\r\n 'HTML': [ 'html', 'meta', 'title', 'link', 'script', 'body', 'DOCTYPE', 'head', 'br', 'i', 'a', 'li', 'img', 'tr', 'td', 'h1', 'h2', 'h3', 'h4',\r\n 'h5' ],\r\n 'Markdown': [ 'br', 'i', 'a', 'li', 'img', 'table', 'title', 'tr', 'td', 'h1', 'h2', 'h3', 'h4', 'h5' ],\r\n 'PHP': [ 'const', 'function', 'array', 'new', 'int', 'string', '$this', 'public', 'null', 'private', 'protected', 'implements', 'class', 'use',\r\n 'namespace', 'abstract', 'clone', 'final', 'enum' ]\r\n};\r\n\r\n// These ones don't have hightlight, used as suggestions to autocomplete only...\r\nCE.utils = {\r\n 'JavaScript': [ 'querySelector', 'body', 'addEventListener', 'removeEventListener', 'remove', 'sort', 'keys', 'filter', 'isNaN', 'parseFloat',\r\n 'parseInt', 'EPSILON', 'isFinite', 'bind', 'prototype', 'length', 'assign', 'entries', 'values', 'concat', 'substring', 'substr', 'splice',\r\n 'slice', 'buffer', 'appendChild', 'createElement', 'prompt', 'alert' ],\r\n 'WGSL': [ 'textureSample' ],\r\n 'Python': [ 'abs', 'all', 'any', 'ascii', 'bin', 'bool', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod', 'compile', 'complex', 'delattr',\r\n 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'exec', 'filter', 'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash',\r\n 'help', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next',\r\n 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property', 'range', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 'sorted',\r\n 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars', 'zip' ],\r\n 'CSS': [ ...Object.keys( document.body.style ).map( LX.toKebabCase ), 'block', 'inline', 'inline-block', 'flex', 'grid', 'none', 'inherit',\r\n 'initial', 'unset', 'revert', 'sticky', 'relative', 'absolute', 'fixed', 'static', 'auto', 'visible', 'hidden', 'scroll', 'clip', 'ellipsis',\r\n 'nowrap', 'wrap', 'break-word', 'solid', 'dashed', 'dotted', 'double', 'groove', 'ridge', 'inset', 'outset', 'left', 'right', 'center', 'top',\r\n 'bottom', 'start', 'end', 'justify', 'stretch', 'space-between', 'space-around', 'space-evenly', 'baseline', 'middle', 'normal', 'bold',\r\n 'lighter', 'bolder', 'italic', 'blur', 'uppercase', 'lowercase', 'capitalize', 'transparent', 'currentColor', 'pointer', 'default', 'move',\r\n 'grab', 'grabbing', 'not-allowed', 'none', 'cover', 'contain', 'repeat', 'no-repeat', 'repeat-x', 'repeat-y', 'round', 'space',\r\n 'linear-gradient', 'radial-gradient', 'conic-gradient', 'url', 'calc', 'min', 'max', 'clamp', 'red', 'blue', 'green', 'black', 'white',\r\n 'gray', 'silver', 'yellow', 'orange', 'purple', 'pink', 'cyan', 'magenta', 'lime', 'teal', 'navy', 'transparent', 'currentcolor', 'inherit',\r\n 'initial', 'unset', 'revert', 'none', 'auto', 'fit-content', 'min-content', 'max-content' ]\r\n};\r\n\r\nCE.types = {\r\n 'JavaScript': [ 'Object', 'String', 'Function', 'Boolean', 'Symbol', 'Error', 'Number', 'TextEncoder', 'TextDecoder', 'Array', 'ArrayBuffer',\r\n 'InputEvent', 'MouseEvent', 'Int8Array', 'Int16Array', 'Int32Array', 'Float32Array', 'Float64Array', 'Element' ],\r\n 'TypeScript': [ 'arguments', 'constructor', 'null', 'typeof', 'debugger', 'abstract', 'Object', 'string', 'String', 'Function', 'Boolean',\r\n 'boolean', 'Error', 'Number', 'number', 'TextEncoder', 'TextDecoder', 'Array', 'ArrayBuffer', 'InputEvent', 'MouseEvent', 'Int8Array',\r\n 'Int16Array', 'Int32Array', 'Float32Array', 'Float64Array', 'Element', 'bigint', 'unknown', 'any', 'Record' ],\r\n 'Rust': [ 'u128' ],\r\n 'Python': [ 'int', 'type', 'float', 'map', 'list', 'ArithmeticError', 'AssertionError', 'AttributeError', 'Exception', 'EOFError',\r\n 'FloatingPointError', 'GeneratorExit', 'ImportError', 'IndentationError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'LookupError',\r\n 'MemoryError', 'NameError', 'NotImplementedError', 'OSError', 'OverflowError', 'ReferenceError', 'RuntimeError', 'StopIteration',\r\n 'SyntaxError', 'TabError', 'SystemError', 'SystemExit', 'TypeError', 'UnboundLocalError', 'UnicodeError', 'UnicodeEncodeError',\r\n 'UnicodeDecodeError', 'UnicodeTranslateError', 'ValueError', 'ZeroDivisionError' ],\r\n 'C++': [ 'uint8_t', 'uint16_t', 'uint32_t' ],\r\n 'PHP': [ 'Exception', 'DateTime', 'JsonSerializable' ]\r\n};\r\n\r\nCE.builtIn = {\r\n 'JavaScript': [ 'document', 'console', 'window', 'navigator', 'performance' ],\r\n 'CSS': [ '*', '!important' ],\r\n 'C++': [ 'vector', 'list', 'map' ],\r\n 'WGSL': [ '@vertex', '@fragment' ],\r\n 'HTML': [ 'type', 'xmlns', 'PUBLIC', 'http-equiv', 'src', 'style', 'lang', 'href', 'rel', 'content', 'xml', 'alt' ], // attributes\r\n 'Markdown': [ 'type', 'src', 'style', 'lang', 'href', 'rel', 'content', 'valign', 'alt' ], // attributes\r\n 'PHP': [ 'echo', 'print' ]\r\n};\r\n\r\nCE.statements = {\r\n 'JavaScript': [ 'for', 'if', 'else', 'case', 'switch', 'return', 'while', 'continue', 'break', 'do', 'import', 'default', 'export', 'from',\r\n 'throw', 'async', 'try', 'catch', 'await', 'as' ],\r\n 'TypeScript': [ 'for', 'if', 'else', 'case', 'switch', 'return', 'while', 'continue', 'break', 'do', 'import', 'default', 'export', 'from',\r\n 'throw', 'async', 'try', 'catch', 'await', 'as' ],\r\n 'CSS': [ '@', 'import' ],\r\n 'C': [ 'for', 'if', 'else', 'return', 'continue', 'break', 'case', 'switch', 'while', 'using', 'default', 'goto', 'do' ],\r\n 'C++': [ 'std', 'for', 'if', 'else', 'return', 'continue', 'break', 'case', 'switch', 'while', 'using', 'glm', 'spdlog', 'default' ],\r\n 'GLSL': [ 'for', 'if', 'else', 'return', 'continue', 'break' ],\r\n 'WGSL': [ 'const', 'for', 'if', 'else', 'return', 'continue', 'break', 'storage', 'read', 'read_write', 'uniform', 'function', 'workgroup',\r\n 'bitcast' ],\r\n 'Rust': [ 'break', 'else', 'continue', 'for', 'if', 'loop', 'match', 'return', 'while', 'do', 'yield' ],\r\n 'Python': [ 'if', 'raise', 'del', 'import', 'return', 'elif', 'try', 'else', 'while', 'as', 'except', 'with', 'assert', 'finally', 'yield',\r\n 'break', 'for', 'class', 'continue', 'global', 'pass', 'from' ],\r\n 'Batch': [ 'if', 'IF', 'for', 'FOR', 'in', 'IN', 'do', 'DO', 'call', 'CALL', 'goto', 'GOTO', 'exit', 'EXIT' ],\r\n 'PHP': [ 'declare', 'enddeclare', 'foreach', 'endforeach', 'if', 'else', 'elseif', 'endif', 'for', 'endfor', 'while', 'endwhile', 'switch',\r\n 'case', 'default', 'endswitch', 'return', 'break', 'continue', 'try', 'catch', 'die', 'do', 'exit', 'finally' ]\r\n};\r\n\r\nCE.symbols = {\r\n 'JavaScript': [ '<', '>', '[', ']', '{', '}', '(', ')', ';', '=', '|', '||', '&', '&&', '?', '??' ],\r\n 'TypeScript': [ '<', '>', '[', ']', '{', '}', '(', ')', ';', '=', '|', '||', '&', '&&', '?', '??' ],\r\n 'C': [ '<', '>', '[', ']', '{', '}', '(', ')', ';', '=', '|', '||', '&', '&&', '?', '*', '-', '+' ],\r\n 'C++': [ '<', '>', '[', ']', '{', '}', '(', ')', ';', '=', '|', '||', '&', '&&', '?', '::', '*', '-', '+' ],\r\n 'CMake': [ '{', '}' ],\r\n 'JSON': [ '[', ']', '{', '}', '(', ')' ],\r\n 'GLSL': [ '[', ']', '{', '}', '(', ')' ],\r\n 'WGSL': [ '[', ']', '{', '}', '(', ')', '->' ],\r\n 'CSS': [ '{', '}', '(', ')', '*' ],\r\n 'Rust': [ '<', '>', '[', ']', '(', ')', '=' ],\r\n 'Python': [ '<', '>', '[', ']', '(', ')', '=' ],\r\n 'Batch': [ '[', ']', '(', ')', '%' ],\r\n 'HTML': [ '<', '>', '/' ],\r\n 'XML': [ '<', '>', '/' ],\r\n 'PHP': [ '[', ']', '{', '}', '(', ')' ]\r\n};\r\n\r\nCE.REGISTER_LANGUAGE = function( name: string, options: any = {}, def: any, rules?: any[] )\r\n{\r\n CE.languages[name] = options;\r\n\r\n if ( def?.keywords ) CE.keywords[name] = new Set( def.keywords );\r\n if ( def?.utils ) CE.utils[name] = new Set( def.utils );\r\n if ( def?.types ) CE.types[name] = new Set( def.types );\r\n if ( def?.builtIn ) CE.builtIn[name] = new Set( def.builtIn );\r\n if ( def?.statements ) CE.statements[name] = new Set( def.statements );\r\n if ( def?.symbols ) CE.symbols[name] = new Set( def.symbols );\r\n\r\n if ( rules ) HighlightRules[name] = rules;\r\n};\r\n\r\nLX.CodeEditor = CodeEditor;\r\n"],"names":[],"mappings":";;;AAAA;AAIA,IAAK,CAAC,EAAE,EACR;IACI,OAAQ,uBAAuB;AACnC;AAEA,EAAE,CAAC,UAAU,CAAC,IAAI,CAAE,YAAY,CAAE;AAElC,MAAM,CAAC,GAAG,UAAiB;AACd,EAAE,CAAC;AACH,EAAE,CAAC;AACF,EAAE,CAAC;AACJ,EAAE,CAAC;AACH,EAAE,CAAC;AACI,EAAE,CAAC;AAEvB,SAAS,YAAY,CAAE,GAAQ,EAAE,CAAS,EAAE,CAAS,EAAA;IAEjD,CAAE,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAE,GAAG,CAAE,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAE;AAC3C;AACA,SAAS,iBAAiB,CAAE,KAAe,EAAE,GAAW,EAAE,GAAW,EAAA;IAEjE,CAAE,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAE,GAAG,CAAE,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAE;AAC3D;AACA,SAAS,UAAU,CAAE,GAAW,EAAE,GAA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