lexgui 8.2.4 → 8.3.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.
Files changed (38) hide show
  1. package/build/components/NodeTree.d.ts +1 -1
  2. package/build/components/Tabs.d.ts +1 -0
  3. package/build/core/Namespace.js +1 -1
  4. package/build/core/Namespace.js.map +1 -1
  5. package/build/extensions/AssetView.d.ts +3 -2
  6. package/build/extensions/AssetView.js +1433 -1404
  7. package/build/extensions/AssetView.js.map +1 -1
  8. package/build/extensions/CodeEditor.d.ts +428 -325
  9. package/build/extensions/CodeEditor.js +3768 -4637
  10. package/build/extensions/CodeEditor.js.map +1 -1
  11. package/build/extensions/DocMaker.d.ts +1 -1
  12. package/build/extensions/DocMaker.js +363 -354
  13. package/build/extensions/DocMaker.js.map +1 -1
  14. package/build/extensions/Timeline.d.ts +2 -2
  15. package/build/extensions/Timeline.js +28 -15
  16. package/build/extensions/Timeline.js.map +1 -1
  17. package/build/extensions/VideoEditor.d.ts +1 -1
  18. package/build/extensions/VideoEditor.js +15 -7
  19. package/build/extensions/VideoEditor.js.map +1 -1
  20. package/build/extensions/index.js +1 -1
  21. package/build/lexgui.all.js +6202 -6929
  22. package/build/lexgui.all.js.map +1 -1
  23. package/build/lexgui.all.min.js +1 -1
  24. package/build/lexgui.all.module.js +6202 -6930
  25. package/build/lexgui.all.module.js.map +1 -1
  26. package/build/lexgui.all.module.min.js +1 -1
  27. package/build/lexgui.css +160 -85
  28. package/build/lexgui.js +4536 -241
  29. package/build/lexgui.js.map +1 -1
  30. package/build/lexgui.min.css +1 -1
  31. package/build/lexgui.min.js +1 -1
  32. package/build/lexgui.module.js +4536 -241
  33. package/build/lexgui.module.js.map +1 -1
  34. package/build/lexgui.module.min.js +1 -1
  35. package/changelog.md +44 -1
  36. package/examples/asset-view.html +29 -2
  37. package/examples/code-editor.html +88 -16
  38. package/package.json +2 -1
@@ -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\ntype Token = {\r\n text: string;\r\n pos: number;\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 = '&nbsp;';\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\r\n this._preparedAt = performance.now();\r\n\r\n if ( this.onReady )\r\n {\r\n this.onReady( this );\r\n }\r\n\r\n console.log( `[LX.CodeEditor] Ready! (font size: ${this.fontSize}px)` );\r\n }, 50 );\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( '<', '&lt;' ).replaceAll( '>', '&gt;' );\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.substring( 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: Token[] = []; // store in a temp array so we know prev and next tokens...\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( {\r\n text: t,\r\n pos: charCounter\r\n } );\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 // Apply step to merge numeric tokens, since they might be separated by '.'\r\n const mergedTokens = this._mergeNumericTokens( tokensToEvaluate );\r\n\r\n this._currentTokenPositions = mergedTokens.map( ( t ) => t.pos );\r\n\r\n return this._processTokens( mergedTokens.map( ( t ) => t.text ) );\r\n }\r\n\r\n _mergeNumericTokens( tokens: Token[] )\r\n {\r\n const result: Token[] = [];\r\n\r\n for ( let i = 0; i < tokens.length; i++ )\r\n {\r\n const t = tokens[i];\r\n const prev = result[result.length - 1];\r\n const next = tokens[i + 1];\r\n\r\n // number . number\r\n if ( prev && t.text === '.' && /^\\d+$/.test( prev.text ) && next && /^\\d+$/.test( next.text ) )\r\n {\r\n prev.text += '.' + next.text;\r\n i++;\r\n continue;\r\n }\r\n\r\n // . number\r\n if ( t.text === '.' && next && /^\\d+$/.test( next.text ) )\r\n {\r\n result.push( {\r\n text: '.' + next.text,\r\n pos: t.pos\r\n } );\r\n i++;\r\n continue;\r\n }\r\n\r\n // number .\r\n if ( prev && t.text === '.' && /^\\d+$/.test( prev.text ) )\r\n {\r\n prev.text += '.';\r\n continue;\r\n }\r\n\r\n result.push( { ...t } );\r\n }\r\n\r\n return result;\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( '<', '&lt;' ).replace( '>', '&gt;' );\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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AAE,GAAG,CAAC,KAAK,CAAE;IACvD,IAAK,GAAG,EAAE,KAAK;AAAG,QAAA,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAE,GAAG,CAAC,KAAK,CAAE;IACvD,IAAK,GAAG,EAAE,OAAO;AAAG,QAAA,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAE,GAAG,CAAC,OAAO,CAAE;IAC7D,IAAK,GAAG,EAAE,UAAU;AAAG,QAAA,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAE,GAAG,CAAC,UAAU,CAAE;IACtE,IAAK,GAAG,EAAE,OAAO;AAAG,QAAA,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAE,GAAG,CAAC,OAAO,CAAE;AAE7D,IAAA,IAAK,KAAK;AAAG,QAAA,cAAc,CAAC,IAAI,CAAC,GAAG,KAAK;AAC7C,CAAC;AAED,EAAE,CAAC,UAAU,GAAG,UAAU;;;;"}
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\n// _____ \r\n// |_ _|_ _ ___ ___ ___ \r\n// | | | | | . | -_|_ -|\r\n// |_| |_ | _|___|___|\r\n// |___|_|\r\n\r\ninterface Token\r\n{\r\n type: string; // 'keyword', 'string', 'comment', 'number', 'method', 'type', 'symbol', 'builtin', 'statement', 'preprocessor', 'text'\r\n value: string;\r\n}\r\n\r\ninterface TokenRule\r\n{\r\n match: RegExp;\r\n type: string;\r\n next?: string; // push this state\r\n pop?: boolean | number; // pop back to previous state (true = 1, or specify number of pops)\r\n}\r\n\r\ninterface LanguageDef\r\n{\r\n name: string;\r\n extensions: string[];\r\n states: Record<string, TokenRule[]>;\r\n lineComment?: string;\r\n icon?: string | Record<string, string>;\r\n reservedWords: string[];\r\n}\r\n\r\ninterface TokenizerState\r\n{\r\n stack: string[]; // state stack, e.g. ['root'] or ['root', 'blockComment']\r\n}\r\n\r\ninterface TokenizeResult\r\n{\r\n tokens: Token[];\r\n state: TokenizerState;\r\n}\r\n\r\n// _____ _ _ _ _ _ _ \r\n// | | | |_|_| |_| |_|_|___ ___ \r\n// | | | _| | | | _| | -_|_ -|\r\n// |_____|_| |_|_|_|_| |_|___|___|\r\n\r\nfunction firstNonspaceIndex( str: string ): number\r\n{\r\n const index = str.search( /\\S|$/ );\r\n return index < str.length ? index : -1;\r\n}\r\n\r\nfunction isSymbol( str: string ): boolean\r\n{\r\n return /[^\\w\\s]/.test( str );\r\n}\r\n\r\nfunction isWord( str: string ): boolean\r\n{\r\n return /\\w/.test( str );\r\n}\r\n\r\nfunction getLanguageIcon( langDef: LanguageDef | undefined, extension?: string ): string\r\n{\r\n if ( !langDef?.icon )\r\n {\r\n return 'FileCode text-neutral-500'; // default icon\r\n }\r\n\r\n if ( typeof langDef.icon === 'string' )\r\n {\r\n return langDef.icon;\r\n }\r\n\r\n if ( extension && langDef.icon[ extension ] )\r\n {\r\n return langDef.icon[ extension ];\r\n }\r\n\r\n const firstIcon = Object.values( langDef.icon )[0];\r\n return firstIcon || 'FileCode text-neutral-500';\r\n}\r\n\r\n// _____ _ _ \r\n// |_ _|___| |_ ___ ___|_|___ ___ ___ \r\n// | | | . | '_| -_| | |- _| -_| _|\r\n// |_| |___|_,_|___|_|_|_|___|___|_|\r\n\r\nexport class Tokenizer\r\n{\r\n private static languages: Map<string, LanguageDef> = new Map();\r\n private static extensionMap: Map<string, string> = new Map(); // ext -> language name\r\n\r\n static registerLanguage( def: LanguageDef ): void\r\n {\r\n Tokenizer.languages.set( def.name, def );\r\n for ( const ext of def.extensions )\r\n {\r\n Tokenizer.extensionMap.set( ext, def.name );\r\n }\r\n }\r\n\r\n static getLanguage( name: string ): LanguageDef | undefined\r\n {\r\n return Tokenizer.languages.get( name );\r\n }\r\n\r\n static getLanguageByExtension( ext: string ): LanguageDef | undefined\r\n {\r\n const name = Tokenizer.extensionMap.get( ext );\r\n return name ? Tokenizer.languages.get( name ) : undefined;\r\n }\r\n\r\n static getRegisteredLanguages(): string[]\r\n {\r\n return Array.from( Tokenizer.languages.keys() );\r\n }\r\n\r\n static initialState(): TokenizerState\r\n {\r\n return { stack: [ 'root' ] };\r\n }\r\n\r\n /**\r\n * Tokenize a single line given a language and the state from the previous line.\r\n * Returns the tokens and the updated state for the next line.\r\n */\r\n static tokenizeLine( line: string, language: LanguageDef, state: TokenizerState ): TokenizeResult\r\n {\r\n const tokens: Token[] = [];\r\n const stack = [ ...state.stack ]; // clone\r\n\r\n let pos = 0;\r\n\r\n while ( pos < line.length )\r\n {\r\n const currentState = stack[ stack.length - 1 ];\r\n const rules = language.states[ currentState ];\r\n\r\n if ( !rules )\r\n {\r\n // No rules for this state, so emit rest as text\r\n tokens.push( { type: 'text', value: line.slice( pos ) } );\r\n pos = line.length;\r\n break;\r\n }\r\n\r\n let matched = false;\r\n\r\n for ( const rule of rules )\r\n {\r\n // Anchor regex at current position\r\n const regex = new RegExp( rule.match.source, 'y' + ( rule.match.flags.replace( /[gy]/g, '' ) ) );\r\n regex.lastIndex = pos;\r\n const m = regex.exec( line );\r\n\r\n if ( m )\r\n {\r\n if ( m[0].length === 0 )\r\n {\r\n // Zero-length match, skipping to avoid infinite loop...\r\n continue;\r\n }\r\n\r\n tokens.push( { type: rule.type, value: m[0] } );\r\n pos += m[0].length;\r\n\r\n // State transitions\r\n if ( rule.next )\r\n {\r\n stack.push( rule.next );\r\n }\r\n else if ( rule.pop )\r\n {\r\n const popCount = typeof rule.pop === 'number' ? rule.pop : 1;\r\n for ( let i = 0; i < popCount && stack.length > 1; i++ )\r\n {\r\n stack.pop();\r\n }\r\n }\r\n\r\n matched = true;\r\n break;\r\n }\r\n }\r\n\r\n if ( !matched )\r\n {\r\n // No rule matched, consume one character as text either merged or as a new token\r\n const lastToken = tokens[ tokens.length - 1 ];\r\n if ( lastToken && lastToken.type === 'text' )\r\n {\r\n lastToken.value += line[ pos ];\r\n }\r\n else\r\n {\r\n tokens.push( { type: 'text', value: line[ pos ] } );\r\n }\r\n pos++;\r\n }\r\n }\r\n\r\n const merged = Tokenizer._mergeTokens( tokens );\r\n\r\n return { tokens: merged, state: { stack } };\r\n }\r\n\r\n /**\r\n * Merge consecutive tokens with the same type into one.\r\n */\r\n private static _mergeTokens( tokens: Token[] ): Token[]\r\n {\r\n if ( tokens.length === 0 ) return tokens;\r\n\r\n const result: Token[] = [ tokens[0] ];\r\n\r\n for ( let i = 1; i < tokens.length; i++ )\r\n {\r\n const prev = result[ result.length - 1 ];\r\n if ( tokens[i].type === prev.type )\r\n {\r\n prev.value += tokens[i].value;\r\n }\r\n else\r\n {\r\n result.push( tokens[i] );\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n\r\nLX.Tokenizer = Tokenizer;\r\n\r\n// __ _____ _ \r\n// | | ___ ___ ___ _ _ ___ ___ ___ | | |___| |___ ___ ___ ___ \r\n// | |__| .'| | . | | | .'| . | -_| | | -_| | . | -_| _|_ -|\r\n// |_____|__,|_|_|_ |___|__,|_ |___| |__|__|___|_| _|___|_| |___|\r\n// |___| |___| |_|\r\n\r\n/**\r\n * Build a word-boundary regex from a list of words to use as a language rule \"match\".\r\n * e.g. words(['const', 'let', 'var']) → /\\b(?:const|let|var)\\b/\r\n */\r\nfunction words( list: string[] ): RegExp\r\n{\r\n return new RegExp( '\\\\b(?:' + list.join( '|' ) + ')\\\\b' );\r\n}\r\n\r\n/**\r\n * Common state rules reusable across C-like languages.\r\n */\r\nconst CommonStates: Record<string, TokenRule[]> = {\r\n blockComment: [\r\n { match: /\\*\\//, type: 'comment', pop: true },\r\n { match: /[^*]+/, type: 'comment' },\r\n { match: /\\*/, type: 'comment' },\r\n ],\r\n doubleString: [\r\n { match: /\\\\./, type: 'string' },\r\n { match: /\"/, type: 'string', pop: true },\r\n { match: /[^\"\\\\]+/, type: 'string' },\r\n ],\r\n singleString: [\r\n { match: /\\\\./, type: 'string' },\r\n { match: /'/, type: 'string', pop: true },\r\n { match: /[^'\\\\]+/, type: 'string' },\r\n ],\r\n};\r\n\r\n/** Common number rules for C-like languages. */\r\nconst NumberRules: TokenRule[] = [\r\n // Binary: 0b1010, 0B1010\r\n { match: /0[bB][01]+(?:[uU][lL]{0,2}|[lL]{1,2}[uU]?)?\\b/, type: 'number' },\r\n // Hex: 0xFF, 0xDEADBEEF, 0xFFu, 0xFFul, 0xFFull\r\n { match: /0[xX][0-9a-fA-F]+(?:[uU][lL]{0,2}|[lL]{1,2}[uU]?)?\\b/, type: 'number' },\r\n // Octal: 0o77, 0O77\r\n { match: /0[oO][0-7]+(?:[uU][lL]{0,2}|[lL]{1,2}[uU]?)?\\b/, type: 'number' },\r\n // Decimal with optional suffix: 123, 123.456, 1.23e10, 0.5f, 16u, 100L, 42ul, 3.14d, 100m\r\n { match: /\\d+\\.?\\d*(?:[eE][+-]?\\d+)?(?:[fFdDmMlLuUiI]|[uU][lL]{0,2}|[lL]{1,2}[uU]?)?\\b/, type: 'number' },\r\n // Decimal starting with dot: .123, .5f\r\n { match: /\\.\\d+(?:[eE][+-]?\\d+)?(?:[fFdDmM])?\\b/, type: 'number' },\r\n];\r\n\r\n/** Common tail rules: method detection, identifiers, symbols, whitespace. */\r\nconst TailRules: TokenRule[] = [\r\n { match: /[a-zA-Z_$]\\w*(?=\\s*[<(])/, type: 'method' }, // function/method names (followed by < or ()\r\n { match: /[a-zA-Z_$]\\w*/, type: 'text' },\r\n { match: /[{}()\\[\\];,.:?!&|<>=+\\-*/%^~@#]/, type: 'symbol' },\r\n { match: /\\s+/, type: 'text' },\r\n];\r\n\r\n/** Template string states for JS/TS. */\r\nfunction templateStringStates( exprKeywords: string[] ): Record<string, TokenRule[]>\r\n{\r\n return {\r\n templateString: [\r\n { match: /\\\\./, type: 'string' },\r\n { match: /`/, type: 'string', pop: true },\r\n { match: /\\$\\{/, type: 'symbol', next: 'templateExpr' },\r\n { match: /[^`\\\\$]+/, type: 'string' },\r\n { match: /\\$/, type: 'string' },\r\n ],\r\n templateExpr: [\r\n { match: /\\}/, type: 'symbol', pop: true },\r\n { match: /\\/\\*/, type: 'comment', next: 'blockComment' },\r\n { match: /\\/\\/.*/, type: 'comment' },\r\n { match: /\"/, type: 'string', next: 'doubleString' },\r\n { match: /'/, type: 'string', next: 'singleString' },\r\n { match: /`/, type: 'string', next: 'templateString' },\r\n ...NumberRules,\r\n { match: words( exprKeywords ), type: 'keyword' },\r\n ...TailRules,\r\n ],\r\n };\r\n}\r\n\r\n// __ ____ ___ _ _ _ _ \r\n// | | ___ ___ ___ _ _ ___ ___ ___ | \\ ___| _|_|___|_| |_|_|___ ___ ___ \r\n// | |__| .'| | . | | | .'| . | -_| | | | -_| _| | | | _| | . | |_ -|\r\n// |_____|__,|_|_|_ |___|__,|_ |___| |____/|___|_| |_|_|_|_|_| |_|___|_|_|___|\r\n// |___| |___|\r\n\r\nTokenizer.registerLanguage( {\r\n name: 'Plain Text',\r\n extensions: [ 'txt' ],\r\n states: {\r\n root: [\r\n { match: /.+/, type: 'text' }\r\n ]\r\n },\r\n reservedWords: [],\r\n icon: 'FileText text-neutral-500'\r\n} );\r\n\r\n// JavaScript\r\n\r\nconst jsKeywords = [\r\n 'var', 'let', 'const', 'this', 'in', 'of', 'true', 'false', 'null', 'undefined',\r\n 'new', 'function', 'class', 'extends', 'super', 'import', 'export', 'from',\r\n 'default', 'async', 'typeof', 'instanceof', 'void', 'delete', 'debugger', 'NaN',\r\n 'static', 'constructor', 'Infinity', 'abstract'\r\n];\r\n\r\nconst jsStatements = [\r\n 'for', 'if', 'else', 'switch', 'case', 'return', 'while', 'do', 'continue', 'break',\r\n 'await', 'yield', 'throw', 'try', 'catch', 'finally', 'with'\r\n];\r\n\r\nconst jsBuiltins = [\r\n 'document', 'console', 'window', 'navigator', 'performance',\r\n 'Math', 'JSON', 'Promise', 'Array', 'Object', 'String', 'Number', 'Boolean',\r\n 'RegExp', 'Error', 'Map', 'Set', 'WeakMap', 'WeakSet', 'Symbol', 'Proxy', 'Reflect'\r\n];\r\n\r\nTokenizer.registerLanguage( {\r\n name: 'JavaScript',\r\n extensions: [ 'js', 'mjs', 'cjs' ],\r\n lineComment: '//',\r\n states: {\r\n root: [\r\n { match: /\\/\\*/, type: 'comment', next: 'blockComment' },\r\n { match: /\\/\\/.*/, type: 'comment' },\r\n { match: /`/, type: 'string', next: 'templateString' },\r\n { match: /\"/, type: 'string', next: 'doubleString' },\r\n { match: /'/, type: 'string', next: 'singleString' },\r\n ...NumberRules,\r\n { match: words( jsKeywords ), type: 'keyword' },\r\n { match: words( jsBuiltins ), type: 'builtin' },\r\n { match: words( jsStatements ), type: 'statement' },\r\n { match: /(?<=\\b(?:class|enum)\\s+)[A-Z][a-zA-Z0-9_]*/, type: 'type' }, // class/enum names\r\n ...TailRules,\r\n ],\r\n ...CommonStates,\r\n ...templateStringStates( [ 'var', 'let', 'const', 'this', 'true', 'false', 'null', 'undefined', 'new', 'typeof', 'instanceof', 'void' ] ),\r\n },\r\n reservedWords: [ ...jsKeywords, ...jsStatements, ...jsBuiltins ],\r\n icon: 'Js text-yellow-500'\r\n} );\r\n\r\n// TypeScript\r\n\r\nconst tsKeywords = [\r\n ...jsKeywords,\r\n 'as', 'interface', 'type', 'enum', 'namespace', 'declare', 'private', 'protected',\r\n 'implements', 'readonly', 'keyof', 'infer', 'is', 'asserts', 'override', 'satisfies'\r\n];\r\n\r\nconst tsTypes = [\r\n 'string', 'number', 'boolean', 'any', 'unknown', 'never', 'void', 'null',\r\n 'undefined', 'object', 'symbol', 'bigint', 'Promise',\r\n 'Record', 'Partial', 'Required', 'Readonly', 'Pick', 'Omit', 'Exclude',\r\n 'Extract', 'NonNullable', 'ReturnType', 'Parameters', 'ConstructorParameters',\r\n 'InstanceType', 'Awaited'\r\n];\r\n\r\nTokenizer.registerLanguage( {\r\n name: 'TypeScript',\r\n extensions: [ 'ts', 'tsx' ],\r\n lineComment: '//',\r\n states: {\r\n root: [\r\n { match: /\\/\\*/, type: 'comment', next: 'blockComment' },\r\n { match: /\\/\\/.*/, type: 'comment' },\r\n { match: /`/, type: 'string', next: 'templateString' },\r\n { match: /\"/, type: 'string', next: 'doubleString' },\r\n { match: /'/, type: 'string', next: 'singleString' },\r\n ...NumberRules,\r\n { match: words( tsKeywords ), type: 'keyword' },\r\n { match: words( tsTypes ), type: 'type' },\r\n { match: words( jsBuiltins ), type: 'builtin' },\r\n { match: words( jsStatements ), type: 'statement' },\r\n { match: /(?<=\\b(?:class|enum|interface|type|extends|implements)\\s+)[A-Z][a-zA-Z0-9_]*/, type: 'type' }, // class/enum/interface/type names\r\n { match: /(?<=<\\s*)[A-Z][a-zA-Z0-9_]*(?=\\s*(?:[,>]|extends|=))/, type: 'type' }, // type parameters in generics <T>\r\n { match: /(?<=,\\s*)[A-Z][a-zA-Z0-9_]*(?=\\s*(?:[,>]|extends|=))/, type: 'type' }, // type parameters after comma <T, K>\r\n { match: /(?<=:\\s*)[A-Z][a-zA-Z0-9_]*/, type: 'type' }, // type annotations after colon\r\n ...TailRules,\r\n ],\r\n ...CommonStates,\r\n ...templateStringStates( [ 'var', 'let', 'const', 'this', 'true', 'false', 'null', 'undefined', 'new', 'typeof', 'instanceof', 'void' ] ),\r\n },\r\n reservedWords: [ ...tsKeywords, ...tsTypes, ...jsBuiltins, ...jsStatements ],\r\n icon: 'Ts text-blue-600'\r\n} );\r\n\r\n// WGSL (WebGPU Shading Language)\r\n\r\nconst wgslKeywords = [\r\n 'bool', 'i32', 'u32', 'f16', 'f32', 'vec2', 'vec3', 'vec4', 'vec2i', 'vec3i', 'vec4i',\r\n 'vec2u', 'vec3u', 'vec4u', 'vec2f', 'vec3f', 'vec4f', 'mat2x2f', 'mat2x3f', 'mat2x4f', 'mat3x2f', 'mat3x3f',\r\n 'mat3x4f', 'mat4x2f', 'mat4x3f', 'mat4x4f', 'array', 'struct', 'ptr', 'atomic', 'sampler', 'sampler_comparison',\r\n 'texture_1d', 'texture_2d', 'texture_2d_array', 'texture_3d', 'texture_cube', 'texture_cube_array', 'texture_multisampled_2d',\r\n 'texture_depth_2d', 'texture_depth_2d_array', 'texture_depth_cube', 'texture_depth_cube_array',\r\n 'texture_depth_multisampled_2d', 'texture_storage_1d', 'texture_storage_2d', 'texture_storage_2d_array',\r\n 'texture_storage_3d', 'texture_external', 'var', 'let', 'const', 'override', 'fn', 'type', 'alias',\r\n 'true', 'false'\r\n];\r\n\r\nconst wgslStatements = [\r\n 'if', 'else', 'switch', 'case', 'default', 'for', 'loop', 'while', 'break', 'continue', 'discard',\r\n 'return', 'function', 'private', 'workgroup', 'uniform', 'storage', 'read', 'write', 'read_write', 'bitcast'\r\n];\r\n\r\nconst wgslBuiltins = [\r\n 'position', 'vertex_index', 'instance_index', 'front_facing', 'frag_depth',\r\n 'local_invocation_id', 'local_invocation_index', 'global_invocation_id', 'workgroup_id', 'num_workgroups',\r\n 'abs', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atanh', 'atan2', 'ceil', 'clamp', 'cos', 'cosh',\r\n 'cross', 'degrees', 'determinant', 'distance', 'dot', 'exp', 'exp2', 'floor', 'fma', 'fract', 'inverseSqrt',\r\n 'length', 'log', 'log2', 'max', 'min', 'mix', 'normalize', 'pow', 'radians', 'reflect', 'refract', 'round',\r\n 'saturate', 'sign', 'sin', 'sinh', 'smoothstep', 'sqrt', 'step', 'tan', 'tanh', 'transpose', 'trunc',\r\n 'textureSample', 'textureSampleBias', 'textureSampleLevel', 'textureSampleGrad',\r\n 'textureSampleCompare', 'textureSampleCompareLevel', 'textureSampleBaseClampToEdge',\r\n 'textureLoad', 'textureStore', 'textureGather', 'textureGatherCompare',\r\n 'textureDimensions', 'textureNumLayers', 'textureNumLevels', 'textureNumSamples',\r\n 'pack4x8snorm', 'pack4x8unorm', 'pack2x16snorm', 'pack2x16unorm', 'pack2x16float',\r\n 'unpack4x8snorm', 'unpack4x8unorm', 'unpack2x16snorm', 'unpack2x16unorm', 'unpack2x16float',\r\n 'atomicLoad', 'atomicStore', 'atomicAdd', 'atomicSub', 'atomicMax', 'atomicMin',\r\n 'atomicAnd', 'atomicOr', 'atomicXor', 'atomicExchange', 'atomicCompareExchangeWeak',\r\n 'dpdx', 'dpdxCoarse', 'dpdxFine', 'dpdy', 'dpdyCoarse', 'dpdyFine', 'fwidth', 'fwidthCoarse', 'fwidthFine',\r\n 'select', 'arrayLength', 'countLeadingZeros', 'countOneBits', 'countTrailingZeros',\r\n 'extractBits', 'firstLeadingBit', 'firstTrailingBit', 'insertBits', 'reverseBits',\r\n 'storageBarrier', 'workgroupBarrier', 'workgroupUniformLoad'\r\n];\r\n\r\nTokenizer.registerLanguage( {\r\n name: 'WGSL',\r\n extensions: [ 'wgsl' ],\r\n lineComment: '//',\r\n states: {\r\n root: [\r\n { match: /\\/\\*/, type: 'comment', next: 'blockComment' },\r\n { match: /\\/\\/.*/, type: 'comment' },\r\n { match: /#\\w+/, type: 'preprocessor' },\r\n ...NumberRules,\r\n { match: words( wgslKeywords ), type: 'keyword' },\r\n { match: words( wgslBuiltins ), type: 'builtin' },\r\n { match: words( wgslStatements ), type: 'statement' },\r\n { match: /@\\w+/, type: 'text' },\r\n ...TailRules,\r\n ],\r\n ...CommonStates\r\n },\r\n reservedWords: [ ...wgslKeywords, ...wgslBuiltins, ...wgslStatements ],\r\n icon: 'AlignLeft text-orange-500'\r\n} );\r\n\r\n// GLSL (OpenGL/WebGL Shading Language)\r\n\r\nconst glslKeywords = [\r\n 'true', 'false', 'int', 'float', 'double', 'bool', 'void', 'uint', 'struct', 'mat2', 'mat3',\r\n 'mat4', 'mat2x2', 'mat2x3', 'mat2x4', 'mat3x2', 'mat3x3', 'mat3x4', 'mat4x2', 'mat4x3', 'mat4x4',\r\n 'vec2', 'vec3', 'vec4', 'ivec2', 'ivec3', 'ivec4', 'uvec2', 'uvec3', 'uvec4', 'dvec2', 'dvec3',\r\n 'dvec4', 'bvec2', 'bvec3', 'bvec4', 'sampler1D', 'sampler2D', 'sampler3D', 'samplerCube',\r\n 'sampler2DShadow', 'samplerCubeShadow', 'sampler2DArray', 'sampler2DArrayShadow',\r\n 'samplerCubeArray', 'samplerCubeArrayShadow', 'isampler2D', 'usampler2D', 'isampler3D',\r\n 'usampler3D', 'lowp', 'mediump', 'highp', 'precision', 'in', 'out', 'inout', 'uniform',\r\n 'varying', 'attribute', 'const', 'layout', 'centroid', 'flat', 'smooth', 'noperspective',\r\n 'patch', 'sample', 'buffer', 'shared', 'coherent', 'volatile', 'restrict', 'readonly', 'writeonly'\r\n];\r\n\r\nconst glslStatements = [\r\n 'if', 'else', 'switch', 'case', 'default', 'for', 'while', 'do', 'break', 'continue',\r\n 'return', 'discard'\r\n];\r\n\r\nconst glslBuiltins = [\r\n 'radians', 'degrees', 'sin', 'cos', 'tan', 'asin', 'acos', 'atan', 'pow', 'exp', 'log',\r\n 'exp2', 'log2', 'sqrt', 'inversesqrt', 'abs', 'sign', 'floor', 'ceil', 'fract',\r\n 'mod', 'min', 'max', 'clamp', 'mix', 'step', 'smoothstep', 'length', 'distance',\r\n 'dot', 'cross', 'normalize', 'reflect', 'refract', 'matrixCompMult',\r\n 'lessThan', 'lessThanEqual', 'greaterThan', 'greaterThanEqual',\r\n 'equal', 'notEqual', 'any', 'all', 'not', 'texture', 'textureProj',\r\n 'textureLod', 'textureGrad', 'texelFetch'\r\n];\r\n\r\nTokenizer.registerLanguage( {\r\n name: 'GLSL',\r\n extensions: [ 'glsl' ],\r\n lineComment: '//',\r\n states: {\r\n root: [\r\n { match: /\\/\\*/, type: 'comment', next: 'blockComment' },\r\n { match: /\\/\\/.*/, type: 'comment' },\r\n { match: /#\\w+/, type: 'preprocessor' },\r\n ...NumberRules,\r\n { match: words( glslKeywords ), type: 'keyword' },\r\n { match: words( glslBuiltins ), type: 'builtin' },\r\n { match: words( glslStatements ), type: 'statement' },\r\n ...TailRules,\r\n ],\r\n ...CommonStates\r\n },\r\n reservedWords: [ ...glslKeywords, ...glslBuiltins, ...glslStatements ],\r\n icon: 'AlignLeft text-neutral-500'\r\n} );\r\n\r\n// HLSL (DirectX Shader Language)\r\n\r\nconst hlslKeywords = [\r\n 'bool', 'int', 'uint', 'dword', 'half', 'float', 'double', 'min16float', 'min10float', 'min16int', 'min12int', 'min16uint',\r\n 'float1', 'float2', 'float3', 'float4', 'int1', 'int2', 'int3', 'int4', 'uint1', 'uint2', 'uint3', 'uint4',\r\n 'bool1', 'bool2', 'bool3', 'bool4', 'half1', 'half2', 'half3', 'half4',\r\n 'float1x1', 'float1x2', 'float1x3', 'float1x4', 'float2x1', 'float2x2', 'float2x3', 'float2x4',\r\n 'float3x1', 'float3x2', 'float3x3', 'float3x4', 'float4x1', 'float4x2', 'float4x3', 'float4x4',\r\n 'vector', 'matrix', 'string', 'void', 'struct', 'class', 'interface', 'true', 'false',\r\n 'sampler', 'sampler1D', 'sampler2D', 'sampler3D', 'samplerCUBE', 'sampler_state',\r\n 'Texture1D', 'Texture2D', 'Texture3D', 'TextureCube', 'Texture1DArray', 'Texture2DArray', 'TextureCubeArray',\r\n 'Buffer', 'AppendStructuredBuffer', 'ConsumeStructuredBuffer', 'StructuredBuffer', 'RWStructuredBuffer',\r\n 'ByteAddressBuffer', 'RWByteAddressBuffer', 'RWTexture1D', 'RWTexture2D', 'RWTexture3D', 'RWTexture1DArray', 'RWTexture2DArray',\r\n 'cbuffer', 'tbuffer', 'in', 'out', 'inout', 'uniform', 'extern', 'static', 'volatile', 'precise', 'shared', 'groupshared',\r\n 'linear', 'centroid', 'nointerpolation', 'noperspective', 'sample', 'const', 'row_major', 'column_major'\r\n];\r\n\r\nconst hlslStatements = [\r\n 'if', 'else', 'for', 'while', 'do', 'switch', 'case', 'default', 'break', 'continue', 'discard', 'return',\r\n 'typedef', 'register', 'packoffset'\r\n];\r\n\r\nconst hlslBuiltins = [\r\n 'SV_Position', 'SV_Target', 'SV_Depth', 'SV_VertexID', 'SV_InstanceID', 'SV_PrimitiveID', 'SV_DispatchThreadID',\r\n 'SV_GroupID', 'SV_GroupThreadID', 'SV_GroupIndex', 'SV_Coverage', 'SV_IsFrontFace', 'SV_RenderTargetArrayIndex',\r\n 'POSITION', 'NORMAL', 'TEXCOORD', 'COLOR', 'TANGENT', 'BINORMAL'\r\n];\r\n\r\nTokenizer.registerLanguage( {\r\n name: 'HLSL',\r\n extensions: [ 'hlsl', 'fx', 'fxh', 'vsh', 'psh' ],\r\n lineComment: '//',\r\n states: {\r\n root: [\r\n { match: /\\/\\*/, type: 'comment', next: 'blockComment' },\r\n { match: /\\/\\/.*/, type: 'comment' },\r\n { match: /#\\w+/, type: 'preprocessor' },\r\n ...NumberRules,\r\n { match: words( hlslKeywords ), type: 'keyword' },\r\n { match: words( hlslBuiltins ), type: 'builtin' },\r\n { match: words( hlslStatements ), type: 'statement' },\r\n ...TailRules,\r\n ],\r\n ...CommonStates\r\n },\r\n reservedWords: [ ...hlslKeywords, ...hlslBuiltins, ...hlslStatements ],\r\n icon: 'AlignLeft text-purple-500'\r\n} );\r\n\r\n// Python\r\n\r\nconst pyKeywords = [\r\n 'False', 'def', 'None', 'True', 'in', 'is', 'and', 'lambda', 'nonlocal', 'not', 'or'\r\n];\r\n\r\nconst pyStatements = [\r\n 'if', 'elif', 'else', 'for', 'while', 'try', 'except', 'finally', 'with', 'match', 'case',\r\n 'break', 'continue', 'return', 'raise', 'pass', 'import', 'from', 'as', 'global', 'nonlocal',\r\n 'assert', 'del', 'yield'\r\n];\r\n\r\nconst pyBuiltins = [\r\n 'abs', 'all', 'any', 'ascii', 'bin', 'bool', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod',\r\n 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'exec', 'filter',\r\n 'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id',\r\n 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals', 'map', 'max',\r\n 'memoryview', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property',\r\n 'range', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod',\r\n 'str', 'sum', 'super', 'tuple', 'type', 'vars', 'zip'\r\n];\r\n\r\nconst pyTypes = [\r\n 'int', 'float', 'complex', 'bool', 'str', 'bytes', 'bytearray', 'list', 'tuple', 'set', 'frozenset',\r\n 'dict', 'object', 'type', 'ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException',\r\n 'BufferError', 'EOFError', 'Exception', 'FloatingPointError', 'GeneratorExit', 'ImportError',\r\n 'ModuleNotFoundError', 'IndentationError', 'IndexError', 'KeyError', 'KeyboardInterrupt',\r\n 'LookupError', 'MemoryError', 'NameError', 'NotImplementedError', 'OSError', 'OverflowError',\r\n 'RecursionError', 'ReferenceError', 'RuntimeError', 'StopAsyncIteration', 'StopIteration',\r\n 'SyntaxError', 'TabError', 'SystemError', 'SystemExit', 'TypeError', 'UnboundLocalError',\r\n 'UnicodeError', 'UnicodeEncodeError', 'UnicodeDecodeError', 'UnicodeTranslateError',\r\n 'ValueError', 'ZeroDivisionError'\r\n];\r\n\r\nTokenizer.registerLanguage( {\r\n name: 'Python',\r\n extensions: [ 'py' ],\r\n lineComment: '#',\r\n states: {\r\n root: [\r\n { match: /\\/\\*/, type: 'comment', next: 'blockComment' },\r\n { match: /#.*/, type: 'comment' },\r\n { match: /\"/, type: 'string', next: 'doubleString' },\r\n { match: /'/, type: 'string', next: 'singleString' },\r\n ...NumberRules,\r\n { match: words( pyKeywords ), type: 'keyword' },\r\n { match: words( pyTypes ), type: 'type' },\r\n { match: words( pyBuiltins ), type: 'builtin' },\r\n { match: words( pyStatements ), type: 'statement' },\r\n ...TailRules,\r\n ],\r\n ...CommonStates\r\n },\r\n reservedWords: [ ...pyKeywords, ...pyTypes, ...pyBuiltins, ...pyStatements ],\r\n icon: 'Python text-cyan-600'\r\n} );\r\n\r\n// PHP\r\n\r\nconst phpKeywords = [\r\n 'abstract', 'and', 'array', 'as', 'callable', 'class', 'clone', 'const',\r\n 'enum', 'extends', 'final', 'fn', 'function', 'global',\r\n 'implements', 'include', 'include_once', 'instanceof',\r\n 'insteadof', 'interface', 'namespace', 'new', 'null', 'or',\r\n 'private', 'protected', 'public', 'readonly', 'require',\r\n 'require_once', 'static', 'trait', 'use', 'var', 'xor',\r\n 'from', '$this'\r\n];\r\n\r\nconst phpStatements = [\r\n 'if', 'else', 'elseif', 'endif', 'switch', 'case', 'default', 'endswitch',\r\n 'for', 'endfor', 'foreach', 'endforeach', 'while', 'endwhile', 'do',\r\n 'break', 'continue', 'return', 'try', 'catch', 'finally', 'throw',\r\n 'declare', 'enddeclare', 'goto', 'yield', 'match'\r\n];\r\n\r\nconst phpTypes = [\r\n 'int', 'float', 'string', 'bool', 'array', 'object', 'callable', 'iterable',\r\n 'void', 'never', 'mixed', 'static', 'self', 'parent',\r\n 'Exception', 'Error', 'Throwable', 'DateTime', 'DateTimeImmutable',\r\n 'Closure', 'Generator', 'JsonSerializable'\r\n];\r\n\r\nconst phpBuiltins = [\r\n 'echo', 'print', 'isset', 'empty', 'unset', 'eval', 'die', 'exit',\r\n 'count', 'sizeof', 'in_array', 'array_merge', 'array_push', 'array_pop',\r\n 'strlen', 'strpos', 'substr', 'str_replace', 'explode', 'implode',\r\n 'json_encode', 'json_decode', 'var_dump', 'print_r'\r\n];\r\n\r\n\r\nTokenizer.registerLanguage( {\r\n name: 'PHP',\r\n extensions: [ 'php' ],\r\n lineComment: '//',\r\n states: {\r\n root: [\r\n { match: /\\/\\*/, type: 'comment', next: 'blockComment' },\r\n { match: /\\/\\/.*/, type: 'comment' },\r\n { match: /\"/, type: 'string', next: 'doubleString' },\r\n { match: /'/, type: 'string', next: 'singleString' },\r\n ...NumberRules,\r\n { match: words( phpKeywords ), type: 'keyword' },\r\n { match: words( phpTypes ), type: 'type' },\r\n { match: words( phpBuiltins ), type: 'builtin' },\r\n { match: words( phpStatements ), type: 'statement' },\r\n ...TailRules,\r\n ],\r\n ...CommonStates\r\n },\r\n reservedWords: [ ...phpKeywords, ...phpTypes, ...phpBuiltins, ...phpStatements ],\r\n icon: 'Php text-purple-700'\r\n} );\r\n\r\n// C\r\n\r\nconst cKeywords = [\r\n 'int', 'float', 'double', 'bool', 'long', 'short', 'char', 'void', 'const', 'enum', 'extern', 'register', 'sizeof', 'static',\r\n 'struct', 'typedef', 'union', 'volatile', 'true', 'false'\r\n];\r\n\r\nconst cStatements = [\r\n 'break', 'continue', 'do', 'else', 'for', 'goto', 'if', 'return', 'switch', 'while'\r\n];\r\n\r\nTokenizer.registerLanguage({\r\n name: 'C',\r\n extensions: [ 'c', 'h' ],\r\n lineComment: '//',\r\n states: {\r\n root: [\r\n { match: /\\/\\*/, type: 'comment', next: 'blockComment' },\r\n { match: /\\/\\/.*/, type: 'comment' },\r\n { match: /#\\w+/, type: 'preprocessor' },\r\n { match: /\"/, type: 'string', next: 'doubleString' },\r\n { match: /'/, type: 'string', next: 'singleString' },\r\n ...NumberRules,\r\n { match: words( cKeywords ), type: 'keyword' },\r\n { match: words( cStatements ), type: 'statement' },\r\n ...TailRules,\r\n ],\r\n ...CommonStates\r\n },\r\n reservedWords: [ ...cKeywords, ...cStatements ],\r\n icon: { 'c': 'C text-sky-400', 'h': 'C text-fuchsia-500' }\r\n});\r\n\r\n// C++\r\n\r\nconst cppKeywords = [\r\n ...cKeywords, 'wchar_t', 'static_cast', 'dynamic_cast', 'new', 'delete', 'auto', 'class', 'nullptr', 'NULL', 'signed',\r\n 'unsigned', 'namespace', 'static', 'private', 'public'\r\n];\r\n\r\nconst cppStatements = [\r\n ...cStatements, 'case', 'using', 'glm', 'spdlog', 'default'\r\n];\r\n\r\nconst cppTypes = [\r\n 'uint8_t', 'uint16_t', 'uint32_t', 'uint64_t', 'int8_t', 'int16_t', 'int32_t', 'int64_t', 'size_t', 'ptrdiff_t'\r\n];\r\n\r\nconst cppBuiltins = [\r\n 'std', 'string', 'vector', 'map', 'set', 'unordered_map', 'unordered_set', 'array', 'tuple', 'optional', 'variant',\r\n 'cout', 'cin', 'cerr', 'clog'\r\n];\r\n\r\nTokenizer.registerLanguage({\r\n name: 'C++',\r\n extensions: [ 'cpp', 'hpp' ],\r\n lineComment: '//',\r\n states: {\r\n root: [\r\n { match: /\\/\\*/, type: 'comment', next: 'blockComment' },\r\n { match: /\\/\\/.*/, type: 'comment' },\r\n { match: /#\\w+/, type: 'preprocessor' },\r\n { match: /\"/, type: 'string', next: 'doubleString' },\r\n { match: /'/, type: 'string', next: 'singleString' },\r\n ...NumberRules,\r\n { match: words( cppKeywords ), type: 'keyword' },\r\n { match: words( cppTypes ), type: 'type' },\r\n { match: words( cppBuiltins ), type: 'builtin' },\r\n { match: words( cppStatements ), type: 'statement' },\r\n ...TailRules,\r\n ],\r\n ...CommonStates\r\n },\r\n reservedWords: [ ...cppKeywords, ...cppTypes, ...cppBuiltins, ...cppStatements ],\r\n icon: { 'cpp': 'CPlusPlus text-sky-400', 'hpp': 'CPlusPlus text-fuchsia-500' }\r\n});\r\n\r\n// JSON\r\n\r\nTokenizer.registerLanguage({\r\n name: 'JSON',\r\n extensions: [ 'json', 'jsonc', 'bml' ],\r\n states: {\r\n root: [\r\n { match: /\"/, type: 'string', next: 'doubleString' },\r\n { match: /\\btrue\\b|\\bfalse\\b|\\bnull\\b/, type: 'keyword' },\r\n { match: /-?\\d+\\.?\\d*(?:[eE][+-]?\\d+)?/, type: 'number' },\r\n { match: /[{}[\\]:,]/, type: 'symbol' },\r\n { match: /\\s+/, type: 'text' },\r\n ],\r\n ...CommonStates\r\n },\r\n reservedWords: [],\r\n icon: 'Json text-yellow-600'\r\n});\r\n\r\n// XML\r\n\r\nTokenizer.registerLanguage({\r\n name: 'XML',\r\n extensions: [ 'xml', 'xaml', 'xsd', 'xsl' ],\r\n lineComment: '<!--',\r\n states: {\r\n root: [\r\n { match: /<!--/, type: 'comment', next: 'xmlComment' },\r\n { match: /<\\?/, type: 'preprocessor', next: 'processingInstruction' },\r\n { match: /<\\/[a-zA-Z][\\w:-]*>/, type: 'keyword' },\r\n { match: /<[a-zA-Z][\\w:-]*/, type: 'keyword', next: 'tag' },\r\n { match: /[^<]+/, type: 'text' },\r\n ],\r\n tag: [\r\n { match: /\\/?>/, type: 'keyword', pop: true },\r\n { match: /[a-zA-Z][\\w:-]*(?==)/, type: 'type' },\r\n { match: /\"/, type: 'string', next: 'doubleString' },\r\n { match: /'/, type: 'string', next: 'singleString' },\r\n { match: /[^\"'>/]+/, type: 'text' },\r\n ],\r\n xmlComment: [\r\n { match: /-->/, type: 'comment', pop: true },\r\n { match: /[^-]+/, type: 'comment' },\r\n { match: /-/, type: 'comment' },\r\n ],\r\n processingInstruction: [\r\n { match: /\\?>/, type: 'preprocessor', pop: true },\r\n { match: /[^?]+/, type: 'preprocessor' },\r\n { match: /\\?/, type: 'preprocessor' },\r\n ],\r\n ...CommonStates\r\n },\r\n reservedWords: [],\r\n icon: 'Rss text-orange-600'\r\n});\r\n\r\n// HTML\r\n\r\nconst htmlTags = [\r\n 'html', 'head', 'body', 'title', 'meta', 'link', 'script', 'style',\r\n 'div', 'span', 'p', 'a', 'img', 'ul', 'ol', 'li', 'table', 'tr', 'td', 'th',\r\n 'form', 'input', 'button', 'select', 'option', 'textarea', 'label',\r\n 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'footer', 'nav', 'section', 'article',\r\n 'aside', 'main', 'figure', 'figcaption', 'video', 'audio', 'source', 'canvas', 'svg'\r\n];\r\n\r\nTokenizer.registerLanguage({\r\n name: 'HTML',\r\n extensions: [ 'html' ],\r\n lineComment: '<!--',\r\n states: {\r\n root: [\r\n { match: /<!--/, type: 'comment', next: 'xmlComment' },\r\n { match: /<!DOCTYPE/i, type: 'preprocessor' },\r\n { match: /<\\/[a-zA-Z][\\w-]*>/, type: 'keyword' },\r\n { match: /<script\\b/i, type: 'keyword', next: 'scriptTag' },\r\n { match: /<style\\b/i, type: 'keyword', next: 'styleTag' },\r\n { match: /<[a-zA-Z][\\w-]*/, type: 'keyword', next: 'tag' },\r\n { match: /[^<]+/, type: 'text' },\r\n ],\r\n tag: [\r\n { match: /\\/?>/, type: 'keyword', pop: true },\r\n { match: /[a-zA-Z][\\w-]*(?==)/, type: 'type' },\r\n { match: /\"/, type: 'string', next: 'doubleString' },\r\n { match: /'/, type: 'string', next: 'singleString' },\r\n { match: /[^\"'>/]+/, type: 'text' },\r\n ],\r\n scriptTag: [\r\n { match: /\\/>/, type: 'keyword', pop: true },\r\n { match: />/, type: 'keyword', next: 'scriptContent' },\r\n { match: /[a-zA-Z][\\w-]*(?==)/, type: 'type' },\r\n { match: /\"/, type: 'string', next: 'doubleString' },\r\n { match: /'/, type: 'string', next: 'singleString' },\r\n { match: /[^\"'>/]+/, type: 'text' },\r\n ],\r\n scriptContent: [\r\n { match: /<\\/script>/i, type: 'keyword', pop: 2 },\r\n { match: /[^<]+/, type: 'text' },\r\n { match: /</, type: 'text' },\r\n ],\r\n styleTag: [\r\n { match: /\\/>/, type: 'keyword', pop: true },\r\n { match: />/, type: 'keyword', next: 'styleContent' },\r\n { match: /[a-zA-Z][\\w-]*(?==)/, type: 'type' },\r\n { match: /\"/, type: 'string', next: 'doubleString' },\r\n { match: /'/, type: 'string', next: 'singleString' },\r\n { match: /[^\"'>/]+/, type: 'text' },\r\n ],\r\n styleContent: [\r\n { match: /<\\/style>/i, type: 'keyword', pop: 2 },\r\n { match: /[^<]+/, type: 'text' },\r\n { match: /</, type: 'text' },\r\n ],\r\n xmlComment: [\r\n { match: /-->/, type: 'comment', pop: true },\r\n { match: /[^-]+/, type: 'comment' },\r\n { match: /-/, type: 'comment' },\r\n ],\r\n ...CommonStates\r\n },\r\n reservedWords: [ ...htmlTags ],\r\n icon: 'Code text-orange-500'\r\n});\r\n\r\n// CSS\r\n\r\nconst cssProperties = [\r\n 'color', 'background', 'border', 'margin', 'padding', 'font', 'display', 'position',\r\n 'width', 'height', 'top', 'left', 'right', 'bottom', 'flex', 'grid', 'z-index',\r\n 'opacity', 'transform', 'transition', 'animation', 'content', 'visibility'\r\n];\r\n\r\nconst cssPropertyValues = [\r\n 'inherit', 'initial', 'unset', 'revert', 'revert-layer', 'auto', 'none', 'hidden', 'visible', 'collapse',\r\n 'block', 'inline', 'inline-block', 'flex', 'inline-flex', 'grid', 'inline-grid', 'contents', 'list-item',\r\n 'static', 'relative', 'absolute', 'fixed', 'sticky', 'solid', 'dashed', 'dotted', 'double', 'groove', 'ridge',\r\n 'inset', 'outset', 'bold', 'bolder', 'lighter', 'normal', 'italic', 'oblique', 'uppercase', 'lowercase', 'capitalize',\r\n 'left', 'right', 'center', 'top', 'bottom', 'start', 'end', 'stretch', 'space-between', 'space-around', 'space-evenly',\r\n 'repeat', 'no-repeat', 'repeat-x', 'repeat-y', 'cover', 'contain', 'pointer', 'default', 'move', 'text', 'not-allowed',\r\n 'transparent', 'currentColor'\r\n];\r\n\r\nconst cssPseudos = [\r\n 'hover', 'active', 'focus', 'visited', 'link', 'before', 'after', 'first-child',\r\n 'last-child', 'nth-child', 'not', 'root', 'disabled', 'checked'\r\n];\r\n\r\nTokenizer.registerLanguage({\r\n name: 'CSS',\r\n extensions: [ 'css', 'scss', 'sass', 'less' ],\r\n lineComment: '//',\r\n states: {\r\n root: [\r\n { match: /\\/\\*/, type: 'comment', next: 'blockComment' },\r\n { match: /\\/\\/.*/, type: 'comment' }, // SCSS/Less\r\n { match: /@[\\w-]+/, type: 'statement' }, // @media, @import, @keyframes, etc.\r\n { match: /#[\\w-]+/, type: 'keyword' }, // ID selectors\r\n { match: /\\.[\\w-]+/, type: 'keyword' }, // class selectors\r\n { match: /::?[\\w-]+(?:\\([^)]*\\))?/, type: 'keyword' }, // pseudo-classes/elements\r\n { match: /\\[[\\w-]+(?:[~|^$*]?=(?:\"[^\"]*\"|'[^']*'|[\\w-]+))?\\]/, type: 'type' }, // attribute selectors\r\n { match: /{/, type: 'symbol', next: 'properties' },\r\n { match: /}/, type: 'symbol' },\r\n { match: /[,>+~*]/, type: 'symbol' }, // combinators\r\n { match: /[\\w-]+/, type: 'keyword' }, // element selectors\r\n { match: /\\s+/, type: 'text' },\r\n ],\r\n properties: [\r\n { match: /\\/\\*/, type: 'comment', next: 'blockComment' },\r\n { match: /\\/\\/.*/, type: 'comment' }, // SCSS/Less\r\n { match: /}/, type: 'symbol', pop: true },\r\n { match: /[\\w-]+(?=\\s*:)/, type: 'type' }, // property names\r\n { match: /:/, type: 'symbol' },\r\n { match: words( cssPropertyValues ), type: 'string' },\r\n { match: /;/, type: 'symbol' },\r\n { match: /\"/, type: 'string', next: 'doubleString' },\r\n { match: /'/, type: 'string', next: 'singleString' },\r\n { match: /#[a-fA-F0-9]{3,8}\\b/, type: 'string' }, // hex colors\r\n { match: /-?\\d+\\.?\\d*(?:px|em|rem|%|vh|vw|vmin|vmax|pt|cm|mm|in|pc|ex|ch|fr|deg|rad|grad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?/, type: 'number' },\r\n { match: /!important\\b/, type: 'builtin' },\r\n { match: /[\\w-]+\\(/, type: 'method' }, // functions: rgb(), calc(), var(), url()\r\n { match: /--[\\w-]+/, type: 'type' }, // vars --\r\n { match: /[(),]/, type: 'symbol' },\r\n { match: /{/, type: 'symbol', next: 'properties' }, // nested rules (SCSS/Less)\r\n { match: /[\\w-]+/, type: 'text' },\r\n { match: /\\s+/, type: 'text' },\r\n ],\r\n ...CommonStates\r\n },\r\n reservedWords: [ ...cssProperties, ...cssPropertyValues, ...cssPseudos ],\r\n icon: 'Hash text-blue-500'\r\n});\r\n\r\n// Markdown\r\n\r\nTokenizer.registerLanguage({\r\n name: 'Markdown',\r\n extensions: [ 'md', 'markdown' ],\r\n states: {\r\n root: [\r\n { match: /^#{1,6}\\s+.+/, type: 'keyword' },\r\n { match: /^\\*\\*\\*.+$/, type: 'symbol' },\r\n { match: /\\*\\*[^*]+\\*\\*/, type: 'keyword' },\r\n { match: /\\*[^*]+\\*/, type: 'type' },\r\n { match: /__[^_]+__/, type: 'keyword' },\r\n { match: /_[^_]+_/, type: 'type' },\r\n { match: /`[^`]+`/, type: 'string' },\r\n { match: /```/, type: 'comment', next: 'codeBlock' },\r\n { match: /^\\s*[-*+]\\s+/, type: 'symbol' },\r\n { match: /^\\s*\\d+\\.\\s+/, type: 'symbol' },\r\n { match: /\\[([^\\]]+)\\]\\(([^)]+)\\)/, type: 'builtin' },\r\n { match: /^>\\s+/, type: 'comment' },\r\n { match: /.+/, type: 'text' },\r\n ],\r\n codeBlock: [\r\n { match: /```/, type: 'comment', pop: true },\r\n { match: /.+/, type: 'string' },\r\n ]\r\n },\r\n reservedWords: [],\r\n icon: 'Markdown text-red-500'\r\n});\r\n\r\n// Batch\r\n\r\nconst batchKeywords = [\r\n 'if', 'else', 'for', 'in', 'do', 'goto', 'call', 'exit', 'setlocal', 'endlocal',\r\n 'set', 'echo', 'rem', 'pause', 'cd', 'pushd', 'popd', 'shift', 'start'\r\n];\r\n\r\nconst batchBuiltins = [\r\n 'dir', 'copy', 'move', 'del', 'ren', 'md', 'rd', 'type', 'find', 'findstr',\r\n 'tasklist', 'taskkill', 'ping', 'ipconfig', 'netstat', 'cls', 'title', 'color'\r\n];\r\n\r\nTokenizer.registerLanguage({\r\n name: 'Batch',\r\n extensions: [ 'bat', 'cmd' ],\r\n lineComment: 'rem',\r\n states: {\r\n root: [\r\n { match: /^rem\\s+.*/i, type: 'comment' },\r\n { match: /^::.*/, type: 'comment' },\r\n { match: /\"/, type: 'string', next: 'doubleString' },\r\n { match: /%[\\w]+%/, type: 'type' },\r\n { match: /\\b\\d+\\b/, type: 'number' },\r\n { match: words( [ ...batchKeywords, ...batchKeywords.map( w => w.toUpperCase() ) ] ), type: 'keyword' },\r\n { match: words( batchBuiltins ), type: 'builtin' },\r\n { match: /@echo/, type: 'statement' },\r\n { match: /[a-zA-Z_]\\w*/, type: 'text' },\r\n { match: /[<>|&()@]/, type: 'symbol' },\r\n { match: /\\s+/, type: 'text' },\r\n ],\r\n ...CommonStates\r\n },\r\n reservedWords: [ ...batchKeywords, ...batchBuiltins ],\r\n icon: 'Terminal text-gray-300'\r\n});\r\n\r\n// CMake\r\n\r\nconst cmakeCommands = [\r\n 'project', 'cmake_minimum_required', 'add_executable', 'add_library', 'target_link_libraries',\r\n 'target_include_directories', 'set', 'option', 'if', 'else', 'elseif', 'endif', 'foreach',\r\n 'endforeach', 'while', 'endwhile', 'function', 'endfunction', 'macro', 'endmacro',\r\n 'find_package', 'include', 'message', 'install', 'add_subdirectory', 'configure_file'\r\n];\r\n\r\nTokenizer.registerLanguage({\r\n name: 'CMake',\r\n extensions: [ 'cmake', 'txt', 'cmake-cache' ],\r\n lineComment: '#',\r\n states: {\r\n root: [\r\n { match: /#.*/, type: 'comment' },\r\n { match: /\"/, type: 'string', next: 'doubleString' },\r\n { match: /\\$\\{[^}]+\\}/, type: 'type' },\r\n { match: /\\b\\d+\\.?\\d*\\b/, type: 'number' },\r\n { match: words( [ ...cmakeCommands, ...cmakeCommands.map( w => w.toUpperCase() ) ] ), type: 'keyword' },\r\n { match: /\\b[A-Z_][A-Z0-9_]*\\b/, type: 'builtin' },\r\n { match: /[a-zA-Z_]\\w*/, type: 'text' },\r\n { match: /[(){}]/, type: 'symbol' },\r\n { match: /\\s+/, type: 'text' },\r\n ],\r\n ...CommonStates\r\n },\r\n reservedWords: [ ...cmakeCommands ],\r\n icon: 'AlignLeft text-neutral-500'\r\n});\r\n\r\n// Rust\r\n\r\nconst rustKeywords = [\r\n 'as', 'break', 'const', 'continue', 'crate', 'else', 'enum', 'extern', 'false', 'fn',\r\n 'for', 'if', 'impl', 'in', 'let', 'loop', 'match', 'mod', 'move', 'mut', 'pub', 'ref',\r\n 'return', 'self', 'Self', 'static', 'struct', 'super', 'trait', 'true', 'type', 'unsafe',\r\n 'use', 'where', 'while', 'async', 'await', 'dyn', 'abstract', 'become', 'box', 'do',\r\n 'final', 'macro', 'override', 'priv', 'typeof', 'unsized', 'virtual', 'yield'\r\n];\r\n\r\nconst rustTypes = [\r\n 'i8', 'i16', 'i32', 'i64', 'i128', 'isize', 'u8', 'u16', 'u32', 'u64', 'u128', 'usize',\r\n 'f32', 'f64', 'bool', 'char', 'str', 'String', 'Vec', 'Option', 'Result', 'Box'\r\n];\r\n\r\nconst rustBuiltins = [\r\n 'println', 'print', 'eprintln', 'eprint', 'format', 'panic', 'assert', 'assert_eq',\r\n 'assert_ne', 'debug_assert', 'vec', 'Some', 'None', 'Ok', 'Err'\r\n];\r\n\r\nTokenizer.registerLanguage({\r\n name: 'Rust',\r\n extensions: [ 'rs' ],\r\n lineComment: '//',\r\n states: {\r\n root: [\r\n { match: /\\/\\*/, type: 'comment', next: 'blockComment' },\r\n { match: /\\/\\/.*/, type: 'comment' },\r\n { match: /\"/, type: 'string', next: 'doubleString' },\r\n { match: /'(?:\\\\.|[^'])+'/, type: 'string' },\r\n { match: /r#*\"/, type: 'string', next: 'rawString' },\r\n ...NumberRules,\r\n { match: /#\\[[\\w:]+\\]/, type: 'preprocessor' },\r\n { match: words( rustKeywords ), type: 'keyword' },\r\n { match: words( rustTypes ), type: 'type' },\r\n { match: words( rustBuiltins ), type: 'builtin' },\r\n { match: /![a-zA-Z_]\\w*/, type: 'preprocessor' },\r\n ...TailRules,\r\n ],\r\n rawString: [\r\n { match: /\"#*/, type: 'string', pop: true },\r\n { match: /[^\"]+/, type: 'string' },\r\n { match: /\"/, type: 'string' },\r\n ],\r\n ...CommonStates\r\n },\r\n reservedWords: [ ...rustKeywords, ...rustTypes, ...rustBuiltins ],\r\n icon: 'Rust text-orange-400'\r\n});\r\n\r\n// ____ _\r\n// | \\ ___ ___ _ _ _____ ___ ___| |_\r\n// | | | . | _| | | | -_| | _|\r\n// |____/|___|___|___|_|_|_|___|_|_|_|\r\n\r\nclass CodeDocument\r\n{\r\n private onChange: ( ( doc: CodeDocument ) => void ) | undefined = undefined;\r\n private _lines: string[] = [ '' ];\r\n\r\n get lineCount(): number\r\n {\r\n return this._lines.length;\r\n }\r\n\r\n constructor( onChange?: ( doc: CodeDocument ) => void )\r\n {\r\n this.onChange = onChange;\r\n }\r\n\r\n getLine( n: number ): string\r\n {\r\n return this._lines[ n ] ?? '';\r\n }\r\n\r\n getText( separator: string = '\\n' ): string\r\n {\r\n return this._lines.join( separator );\r\n }\r\n\r\n setText( text: string ): void\r\n {\r\n this._lines = text.split( /\\r?\\n/ );\r\n if ( this._lines.length === 0 )\r\n {\r\n this._lines = [ '' ];\r\n }\r\n\r\n if( this.onChange ) this.onChange( this );\r\n }\r\n\r\n getCharAt( line: number, col: number ): string | undefined\r\n {\r\n const l = this._lines[ line ];\r\n if ( !l || col < 0 || col >= l.length ) return undefined;\r\n return l[ col ];\r\n }\r\n\r\n /**\r\n * Get the word at a given position. Returns [word, startCol, endCol].\r\n */\r\n getWordAt( line: number, col: number ): [ string, number, number ]\r\n {\r\n const l = this._lines[ line ];\r\n if ( !l || col < 0 || col > l.length ) return [ '', col, col ];\r\n\r\n // Expand left\r\n let start = col;\r\n while ( start > 0 && isWord( l[ start - 1 ] ) )\r\n {\r\n start--;\r\n }\r\n\r\n // Expand right\r\n let end = col;\r\n while ( end < l.length && isWord( l[ end ] ) )\r\n {\r\n end++;\r\n }\r\n\r\n return [ l.substring( start, end ), start, end ];\r\n }\r\n\r\n /**\r\n * Get the indentation level (number of leading spaces) of a line.\r\n */\r\n getIndent( line: number ): number\r\n {\r\n const idx = firstNonspaceIndex( this._lines[ line ] ?? '' );\r\n return idx === -1 ? ( this._lines[ line ]?.length ?? 0 ) : idx;\r\n }\r\n\r\n /**\r\n * Find the next occurrence of 'text' starting after (line, col). Returns null if no match.\r\n */\r\n findNext( text: string, startLine: number, startCol: number ): { line: number, col: number } | null\r\n {\r\n if ( !text ) return null;\r\n\r\n // Search from startLine:startCol forward\r\n for ( let i = startLine; i < this._lines.length; i++ )\r\n {\r\n const searchFrom = i === startLine ? startCol : 0;\r\n const idx = this._lines[i].indexOf( text, searchFrom );\r\n if ( idx !== -1 ) return { line: i, col: idx };\r\n }\r\n\r\n // Wrap around from beginning\r\n for ( let i = 0; i <= startLine; i++ )\r\n {\r\n const searchUntil = i === startLine ? startCol : this._lines[i].length;\r\n const idx = this._lines[i].indexOf( text );\r\n if ( idx !== -1 && idx < searchUntil ) return { line: i, col: idx };\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // Mutations (return EditOperations for undo):\r\n\r\n /**\r\n * Insert text at a position (handles newlines in the inserted text).\r\n */\r\n insert( line: number, col: number, text: string ): EditOperation\r\n {\r\n const parts = text.split( /\\r?\\n/ );\r\n const currentLine = this._lines[ line ] ?? '';\r\n const before = currentLine.substring( 0, col );\r\n const after = currentLine.substring( col );\r\n\r\n if ( parts.length === 1 )\r\n {\r\n this._lines[ line ] = before + parts[0] + after;\r\n }\r\n else\r\n {\r\n this._lines[ line ] = before + parts[0];\r\n for ( let i = 1; i < parts.length - 1; i++ )\r\n {\r\n this._lines.splice( line + i, 0, parts[i] );\r\n }\r\n this._lines.splice( line + parts.length - 1, 0, parts[ parts.length - 1 ] + after );\r\n }\r\n\r\n if( this.onChange ) this.onChange( this );\r\n\r\n return { type: 'insert', line, col, text };\r\n }\r\n\r\n /**\r\n * Delete `length` characters forward from a position (handles crossing line boundaries).\r\n */\r\n delete( line: number, col: number, length: number ): EditOperation\r\n {\r\n let remaining = length;\r\n let deletedText = '';\r\n let currentLine = line;\r\n let currentCol = col;\r\n\r\n while ( remaining > 0 && currentLine < this._lines.length )\r\n {\r\n const l = this._lines[ currentLine ];\r\n const available = l.length - currentCol;\r\n\r\n if ( remaining <= available )\r\n {\r\n deletedText += l.substring( currentCol, currentCol + remaining );\r\n this._lines[ currentLine ] = l.substring( 0, currentCol ) + l.substring( currentCol + remaining );\r\n remaining = 0;\r\n }\r\n else\r\n {\r\n // Delete rest of this line + the newline\r\n deletedText += l.substring( currentCol ) + '\\n';\r\n remaining -= ( available + 1 ); // +1 for the newline\r\n\r\n // Merge next line into current\r\n const nextContent = this._lines[ currentLine + 1 ] ?? '';\r\n this._lines[ currentLine ] = l.substring( 0, currentCol ) + nextContent;\r\n this._lines.splice( currentLine + 1, 1 );\r\n }\r\n }\r\n\r\n if( this.onChange ) this.onChange( this );\r\n\r\n return { type: 'delete', line, col, text: deletedText };\r\n }\r\n\r\n /**\r\n * Insert a new line after 'afterLine'. If afterLine is -1, inserts at the beginning.\r\n */\r\n insertLine( afterLine: number, text: string = '' ): EditOperation\r\n {\r\n const insertAt = afterLine + 1;\r\n this._lines.splice( insertAt, 0, text );\r\n\r\n if( this.onChange ) this.onChange( this );\r\n\r\n return { type: 'insert', line: Math.max( afterLine, 0 ), col: afterLine >= 0 ? this._lines[ afterLine ]?.length ?? 0 : 0, text: '\\n' + text };\r\n }\r\n\r\n /**\r\n * Remove an entire line and its trailing newline.\r\n */\r\n removeLine( line: number ): EditOperation\r\n {\r\n const text = this._lines[ line ];\r\n this._lines.splice( line, 1 );\r\n if ( this._lines.length === 0 )\r\n {\r\n this._lines = [ '' ];\r\n }\r\n\r\n if( this.onChange ) this.onChange( this );\r\n\r\n return { type: 'delete', line: Math.max( line - 1, 0 ), col: line > 0 ? ( this._lines[ line - 1 ]?.length ?? 0 ) : 0, text: '\\n' + text };\r\n }\r\n\r\n replaceLine( line: number, newText: string ): EditOperation\r\n {\r\n const oldText = this._lines[ line ];\r\n this._lines[ line ] = newText;\r\n\r\n if( this.onChange ) this.onChange( this );\r\n\r\n return { type: 'replaceLine', line, col: 0, text: newText, oldText };\r\n }\r\n\r\n /**\r\n * Apply an edit operation (used by undo/redo).\r\n */\r\n applyInverse( op: EditOperation ): EditOperation\r\n {\r\n if ( op.type === 'insert' )\r\n {\r\n return this.delete( op.line, op.col, op.text.length );\r\n }\r\n else if ( op.type === 'replaceLine' )\r\n {\r\n return this.replaceLine( op.line, op.oldText! );\r\n }\r\n else\r\n {\r\n return this.insert( op.line, op.col, op.text );\r\n }\r\n }\r\n}\r\n\r\n// _____ _ _ _ _____ _ _ _| |_ _____ _ _____ \r\n// | __|_| |_| |_ | |___ ___ ___ ___| |_|_|___ ___ ___ | __| | | |___ _| |___ | |___ ___ ___ ___ ___ ___ \r\n// | __| . | | _| | | | . | -_| _| .'| _| | . | |_ -| | __| | | | | . | . | | | | | .'| | .'| . | -_| _|\r\n// |_____|___|_|_| |_____| _|___|_| |__,|_| |_|___|_|_|___| |_ _| |_____|_|_|___|___| |_|_|_|__,|_|_|__,|_ |___|_| \r\n// |_| |_| |___|\r\n\r\ninterface EditOperation\r\n{\r\n type: 'insert' | 'delete' | 'replaceLine';\r\n line: number;\r\n col: number;\r\n text: string;\r\n oldText?: string; // used by replaceLine to store previous content\r\n}\r\n\r\ninterface UndoEntry\r\n{\r\n operations: EditOperation[];\r\n cursorsBefore: CursorPosition[];\r\n cursorsAfter: CursorPosition[];\r\n}\r\n\r\nclass UndoManager\r\n{\r\n private _undoStack: UndoEntry[] = [];\r\n private _redoStack: UndoEntry[] = [];\r\n private _pendingOps: EditOperation[] = [];\r\n private _pendingCursorsBefore: CursorPosition[] = [];\r\n private _pendingCursorsAfter: CursorPosition[] = [];\r\n private _lastPushTime: number = 0;\r\n private _groupThresholdMs: number;\r\n private _maxSteps: number;\r\n\r\n constructor( groupThresholdMs: number = 2000, maxSteps: number = 200 )\r\n {\r\n this._groupThresholdMs = groupThresholdMs;\r\n this._maxSteps = maxSteps;\r\n }\r\n\r\n /**\r\n * Record an edit operation. Consecutive operations within the time threshold\r\n * are grouped into a single undo step.\r\n */\r\n record( op: EditOperation, cursors: CursorPosition[] ): void\r\n {\r\n const now = Date.now();\r\n const elapsed = now - this._lastPushTime;\r\n\r\n if ( elapsed > this._groupThresholdMs && this._pendingOps.length > 0 )\r\n {\r\n this._flush();\r\n }\r\n\r\n if ( this._pendingOps.length === 0 )\r\n {\r\n this._pendingCursorsBefore = cursors.map( c => ( { ...c } ) );\r\n }\r\n\r\n this._pendingOps.push( op );\r\n this._pendingCursorsAfter = cursors.map( c => ( { ...c } ) );\r\n this._lastPushTime = now;\r\n\r\n // New edits clear the redo stack\r\n this._redoStack.length = 0;\r\n }\r\n\r\n /**\r\n * Force-flush pending operations into a final undo step.\r\n */\r\n flush( cursorsAfter?: CursorPosition[] ): void\r\n {\r\n if ( cursorsAfter && this._pendingOps.length > 0 )\r\n {\r\n this._pendingCursorsAfter = cursorsAfter.map( c => ( { ...c } ) );\r\n }\r\n this._flush();\r\n }\r\n\r\n /**\r\n * Undo the last step. Stores the operations to apply inversely, and returns the cursor state to restore.\r\n */\r\n undo( doc: CodeDocument, currentCursors?: CursorPosition[] ): { cursors: CursorPosition[] } | null\r\n {\r\n this.flush( currentCursors );\r\n\r\n const entry = this._undoStack.pop();\r\n if ( !entry ) return null;\r\n\r\n // Apply in reverse order\r\n const redoOps: EditOperation[] = [];\r\n for ( let i = entry.operations.length - 1; i >= 0; i-- )\r\n {\r\n const inverseOp = doc.applyInverse( entry.operations[i] );\r\n redoOps.unshift( inverseOp );\r\n }\r\n\r\n this._redoStack.push( { operations: redoOps, cursorsBefore: entry.cursorsBefore, cursorsAfter: entry.cursorsAfter } );\r\n\r\n return { cursors: entry.cursorsBefore };\r\n }\r\n\r\n /**\r\n * Redo the last undone step. Returns the cursor state to restore.\r\n */\r\n redo( doc: CodeDocument ): { cursors: CursorPosition[] } | null\r\n {\r\n const entry = this._redoStack.pop();\r\n if ( !entry ) return null;\r\n\r\n // Apply in forward order (redo entries are already in correct order)\r\n const undoOps: EditOperation[] = [];\r\n for ( let i = 0; i < entry.operations.length; i++ )\r\n {\r\n const inverseOp = doc.applyInverse( entry.operations[i] );\r\n undoOps.push( inverseOp );\r\n }\r\n\r\n this._undoStack.push( { operations: undoOps, cursorsBefore: entry.cursorsBefore, cursorsAfter: entry.cursorsAfter } );\r\n\r\n return { cursors: entry.cursorsAfter };\r\n }\r\n\r\n canUndo(): boolean\r\n {\r\n return this._undoStack.length > 0 || this._pendingOps.length > 0;\r\n }\r\n\r\n canRedo(): boolean\r\n {\r\n return this._redoStack.length > 0;\r\n }\r\n\r\n clear(): void\r\n {\r\n this._undoStack.length = 0;\r\n this._redoStack.length = 0;\r\n this._pendingOps.length = 0;\r\n this._lastPushTime = 0;\r\n }\r\n\r\n private _flush(): void\r\n {\r\n if ( this._pendingOps.length === 0 ) return;\r\n\r\n this._undoStack.push( {\r\n operations: [ ...this._pendingOps ],\r\n cursorsBefore: [ ...this._pendingCursorsBefore ],\r\n cursorsAfter: [ ...this._pendingCursorsAfter ]\r\n } );\r\n\r\n this._pendingOps.length = 0;\r\n this._pendingCursorsBefore = [];\r\n this._pendingCursorsAfter = [];\r\n\r\n // Limit stack size\r\n while ( this._undoStack.length > this._maxSteps )\r\n {\r\n this._undoStack.shift();\r\n }\r\n }\r\n}\r\n\r\n// _____ _| |_ _____ _ _ _ \r\n// | |_ _ ___ ___ ___ ___ | __| | __|___| |___ ___| |_|_|___ ___ \r\n// | --| | | _|_ -| . | _| | __| |__ | -_| | -_| _| _| | . | |\r\n// |_____|___|_| |___|___|_| |_ _| |_____|___|_|___|___|_| |_|___|_|_|\r\n// |_|\r\n\r\ninterface CursorPosition\r\n{\r\n line: number;\r\n col: number;\r\n}\r\n\r\ninterface Selection\r\n{\r\n anchor: CursorPosition; // where selection started\r\n head: CursorPosition; // where cursor is (moves during selection)\r\n}\r\n\r\nfunction posEqual( a: CursorPosition, b: CursorPosition ): boolean\r\n{\r\n return a.line === b.line && a.col === b.col;\r\n}\r\n\r\nfunction posBefore( a: CursorPosition, b: CursorPosition ): boolean\r\n{\r\n return a.line < b.line || ( a.line === b.line && a.col < b.col );\r\n}\r\n\r\nfunction selectionStart( sel: Selection ): CursorPosition\r\n{\r\n return posBefore( sel.anchor, sel.head ) ? sel.anchor : sel.head;\r\n}\r\n\r\nfunction selectionEnd( sel: Selection ): CursorPosition\r\n{\r\n return posBefore( sel.anchor, sel.head ) ? sel.head : sel.anchor;\r\n}\r\n\r\nfunction selectionIsEmpty( sel: Selection ): boolean\r\n{\r\n return posEqual( sel.anchor, sel.head );\r\n}\r\n\r\nclass CursorSet\r\n{\r\n cursors: Selection[] = [];\r\n\r\n constructor()\r\n {\r\n // Start with one cursor at 0,0\r\n this.cursors = [ { anchor: { line: 0, col: 0 }, head: { line: 0, col: 0 } } ];\r\n }\r\n\r\n getPrimary(): Selection\r\n {\r\n return this.cursors[0];\r\n }\r\n\r\n /**\r\n * Set a single cursor position. Clears all secondary cursors and selections.\r\n */\r\n set( line: number, col: number ): void\r\n {\r\n this.cursors = [ { anchor: { line, col }, head: { line, col } } ];\r\n }\r\n\r\n // Movement:\r\n\r\n moveLeft( doc: CodeDocument, selecting: boolean = false ): void\r\n {\r\n for ( const sel of this.cursors )\r\n {\r\n this._moveHead( sel, doc, -1, 0, selecting );\r\n }\r\n this._merge();\r\n }\r\n\r\n moveRight( doc: CodeDocument, selecting: boolean = false ): void\r\n {\r\n for ( const sel of this.cursors )\r\n {\r\n this._moveHead( sel, doc, 1, 0, selecting );\r\n }\r\n this._merge();\r\n }\r\n\r\n moveUp( doc: CodeDocument, selecting: boolean = false ): void\r\n {\r\n for ( const sel of this.cursors )\r\n {\r\n this._moveVertical( sel, doc, -1, selecting );\r\n }\r\n this._merge();\r\n }\r\n\r\n moveDown( doc: CodeDocument, selecting: boolean = false ): void\r\n {\r\n for ( const sel of this.cursors )\r\n {\r\n this._moveVertical( sel, doc, 1, selecting );\r\n }\r\n this._merge();\r\n }\r\n\r\n moveToLineStart( doc: CodeDocument, selecting: boolean = false, noIndent: boolean = false ): void\r\n {\r\n for ( const sel of this.cursors )\r\n {\r\n const line = sel.head.line;\r\n const indent = doc.getIndent( line );\r\n // Toggle between indent and column 0\r\n const targetCol = ( sel.head.col === indent || noIndent ) ? 0 : indent;\r\n sel.head = { line, col: targetCol };\r\n if ( !selecting ) sel.anchor = { ...sel.head };\r\n }\r\n this._merge();\r\n }\r\n\r\n moveToLineEnd( doc: CodeDocument, selecting: boolean = false ): void\r\n {\r\n for ( const sel of this.cursors )\r\n {\r\n const line = sel.head.line;\r\n sel.head = { line, col: doc.getLine( line ).length };\r\n if ( !selecting ) sel.anchor = { ...sel.head };\r\n }\r\n this._merge();\r\n }\r\n\r\n moveWordLeft( doc: CodeDocument, selecting: boolean = false ): void\r\n {\r\n for ( const sel of this.cursors )\r\n {\r\n const { line, col } = sel.head;\r\n if ( col === 0 && line > 0 )\r\n {\r\n // Jump to end of previous line\r\n sel.head = { line: line - 1, col: doc.getLine( line - 1 ).length };\r\n }\r\n else\r\n {\r\n const l = doc.getLine( line );\r\n let c = col;\r\n // Skip whitespace\r\n while ( c > 0 && /\\s/.test( l[ c - 1 ] ) ) c--;\r\n // Skip word or symbols\r\n if ( c > 0 && isWord( l[ c - 1 ] ) )\r\n {\r\n while ( c > 0 && isWord( l[ c - 1 ] ) ) c--;\r\n }\r\n else if ( c > 0 )\r\n {\r\n while ( c > 0 && isSymbol( l[ c - 1 ] ) ) c--;\r\n }\r\n sel.head = { line, col: c };\r\n }\r\n if ( !selecting ) sel.anchor = { ...sel.head };\r\n }\r\n this._merge();\r\n }\r\n\r\n moveWordRight( doc: CodeDocument, selecting: boolean = false ): void\r\n {\r\n for ( const sel of this.cursors )\r\n {\r\n const { line, col } = sel.head;\r\n const l = doc.getLine( line );\r\n if ( col >= l.length && line < doc.lineCount - 1 )\r\n {\r\n // Jump to start of next line\r\n sel.head = { line: line + 1, col: 0 };\r\n }\r\n else\r\n {\r\n let c = col;\r\n // Skip leading whitespace first\r\n while ( c < l.length && /\\s/.test( l[ c ] ) ) c++;\r\n // Then skip word or symbols to end of group\r\n if ( c < l.length && isWord( l[ c ] ) )\r\n {\r\n while ( c < l.length && isWord( l[ c ] ) ) c++;\r\n }\r\n else if ( c < l.length && isSymbol( l[ c ] ) )\r\n {\r\n while ( c < l.length && isSymbol( l[ c ] ) ) c++;\r\n }\r\n sel.head = { line, col: c };\r\n }\r\n if ( !selecting ) sel.anchor = { ...sel.head };\r\n }\r\n this._merge();\r\n }\r\n\r\n selectAll( doc: CodeDocument ): void\r\n {\r\n const lastLine = doc.lineCount - 1;\r\n this.cursors = [ {\r\n anchor: { line: 0, col: 0 },\r\n head: { line: lastLine, col: doc.getLine( lastLine ).length }\r\n } ];\r\n }\r\n\r\n // Multi-cursor:\r\n\r\n addCursor( line: number, col: number ): void\r\n {\r\n this.cursors.push( { anchor: { line, col }, head: { line, col } } );\r\n this._merge();\r\n }\r\n\r\n removeSecondaryCursors(): void\r\n {\r\n this.cursors = [ this.cursors[0] ];\r\n }\r\n\r\n /**\r\n * Returns cursor indices sorted by head position, bottom-to-top (last in doc first)\r\n * to ensure earlier cursors' positions stay valid.\r\n */\r\n sortedIndicesBottomUp(): number[]\r\n {\r\n return this.cursors\r\n .map( ( _, i ) => i )\r\n .sort( ( a, b ) =>\r\n {\r\n const ah = this.cursors[a].head;\r\n const bh = this.cursors[b].head;\r\n return bh.line !== ah.line ? bh.line - ah.line : bh.col - ah.col;\r\n } );\r\n }\r\n\r\n /**\r\n * After editing at (line, col), shift all other cursors on the same line\r\n * that are at or after `afterCol` by `colDelta`. Also handles line shifts\r\n * for multi-line inserts/deletes via `lineDelta`.\r\n */\r\n adjustOthers( skipIdx: number, line: number, afterCol: number, colDelta: number, lineDelta: number = 0 ): void\r\n {\r\n for ( let i = 0; i < this.cursors.length; i++ )\r\n {\r\n if ( i === skipIdx ) continue;\r\n const c = this.cursors[i];\r\n\r\n // Adjust head\r\n if ( lineDelta !== 0 && c.head.line > line )\r\n {\r\n c.head = { line: c.head.line + lineDelta, col: c.head.col };\r\n }\r\n else if ( c.head.line === line && c.head.col >= afterCol )\r\n {\r\n c.head = { line: c.head.line + lineDelta, col: c.head.col + colDelta };\r\n }\r\n\r\n // Adjust anchor\r\n if ( lineDelta !== 0 && c.anchor.line > line )\r\n {\r\n c.anchor = { line: c.anchor.line + lineDelta, col: c.anchor.col };\r\n }\r\n else if ( c.anchor.line === line && c.anchor.col >= afterCol )\r\n {\r\n c.anchor = { line: c.anchor.line + lineDelta, col: c.anchor.col + colDelta };\r\n }\r\n }\r\n }\r\n\r\n // Queries:\r\n\r\n hasSelection( index: number = 0 ): boolean\r\n {\r\n const sel = this.cursors[ index ];\r\n return sel ? !posEqual( sel.anchor, sel.head ) : false;\r\n }\r\n\r\n getSelectedText( doc: CodeDocument, index: number = 0 ): string\r\n {\r\n const sel = this.cursors[ index ];\r\n if ( !sel || selectionIsEmpty( sel ) ) return '';\r\n\r\n const start = selectionStart( sel );\r\n const end = selectionEnd( sel );\r\n\r\n if ( start.line === end.line )\r\n {\r\n return doc.getLine( start.line ).substring( start.col, end.col );\r\n }\r\n\r\n const lines: string[] = [];\r\n lines.push( doc.getLine( start.line ).substring( start.col ) );\r\n for ( let i = start.line + 1; i < end.line; i++ )\r\n {\r\n lines.push( doc.getLine( i ) );\r\n }\r\n lines.push( doc.getLine( end.line ).substring( 0, end.col ) );\r\n return lines.join( '\\n' );\r\n }\r\n\r\n getCursorPositions(): CursorPosition[]\r\n {\r\n return this.cursors.map( s => ( { ...s.head } ) );\r\n }\r\n\r\n private _moveHead( sel: Selection, doc: CodeDocument, dx: number, _dy: number, selecting: boolean ): void\r\n {\r\n const { line, col } = sel.head;\r\n\r\n // If there's a selection and we're not extending it, collapse to the edge\r\n if ( !selecting && !selectionIsEmpty( sel ) )\r\n {\r\n const target = dx < 0 ? selectionStart( sel ) : selectionEnd( sel );\r\n sel.head = { ...target };\r\n sel.anchor = { ...target };\r\n return;\r\n }\r\n\r\n if ( dx < 0 )\r\n {\r\n if ( col > 0 )\r\n {\r\n sel.head = { line, col: col - 1 };\r\n }\r\n else if ( line > 0 )\r\n {\r\n sel.head = { line: line - 1, col: doc.getLine( line - 1 ).length };\r\n }\r\n }\r\n else if ( dx > 0 )\r\n {\r\n const lineLen = doc.getLine( line ).length;\r\n if ( col < lineLen )\r\n {\r\n sel.head = { line, col: col + 1 };\r\n }\r\n else if ( line < doc.lineCount - 1 )\r\n {\r\n sel.head = { line: line + 1, col: 0 };\r\n }\r\n }\r\n\r\n if ( !selecting ) sel.anchor = { ...sel.head };\r\n }\r\n\r\n private _moveVertical( sel: Selection, doc: CodeDocument, direction: number, selecting: boolean ): void\r\n {\r\n const { line, col } = sel.head;\r\n const newLine = line + direction;\r\n\r\n if ( newLine < 0 || newLine >= doc.lineCount ) return;\r\n\r\n const newLineLen = doc.getLine( newLine ).length;\r\n sel.head = { line: newLine, col: Math.min( col, newLineLen ) };\r\n\r\n if ( !selecting ) sel.anchor = { ...sel.head };\r\n }\r\n\r\n /**\r\n * Merge overlapping cursors/selections. Keeps the first one when duplicates exist.\r\n */\r\n private _merge(): void\r\n {\r\n if ( this.cursors.length <= 1 ) return;\r\n\r\n // Sort by head position\r\n this.cursors.sort( ( a, b ) => {\r\n if ( a.head.line !== b.head.line ) return a.head.line - b.head.line;\r\n return a.head.col - b.head.col;\r\n } );\r\n\r\n const merged: Selection[] = [ this.cursors[0] ];\r\n\r\n for ( let i = 1; i < this.cursors.length; i++ )\r\n {\r\n const prev = merged[ merged.length - 1 ];\r\n const curr = this.cursors[i];\r\n\r\n if ( posEqual( prev.head, curr.head ) )\r\n {\r\n // Same position — skip duplicate\r\n continue;\r\n }\r\n\r\n merged.push( curr );\r\n }\r\n\r\n this.cursors = merged;\r\n }\r\n}\r\n\r\n// _____ _ _\r\n// | __|_ _ _____| |_ ___| |___\r\n// |__ | | | | . | . | |_ -|\r\n// |_____|_ |_|_|_|___|___|_|___|\r\n// |___|\r\n\r\ninterface Symbol\r\n{\r\n name: string;\r\n kind: string; // class | function | method | variable | interface | type | enum | struct | property | constructor-call | method-call\r\n scope: string;\r\n line: number;\r\n col?: number;\r\n}\r\n\r\ninterface ScopeInfo\r\n{\r\n name: string;\r\n type: string; // global | class | function | method | enum | struct | interface | anonymous\r\n line: number; // Line where scope opened\r\n}\r\n\r\n/**\r\n * Manages code symbols for autocomplete, navigation, and outlining.\r\n * Incrementally updates as lines change.\r\n */\r\nclass SymbolTable\r\n{\r\n private _symbols: Map<string, Symbol[]> = new Map(); // name -> symbols[]\r\n private _lineSymbols: Symbol[][] = []; // [lineNum] -> symbols declared on that line\r\n private _scopeStack: ScopeInfo[] = [{ name: 'global', type: 'global', line: 0 }];\r\n private _lineScopes: ScopeInfo[][] = []; // [lineNum] -> scope stack at that line\r\n\r\n get currentScope(): string\r\n {\r\n return this._scopeStack[this._scopeStack.length - 1]?.name ?? 'global';\r\n }\r\n\r\n get currentScopeType(): string\r\n {\r\n return this._scopeStack[this._scopeStack.length - 1]?.type ?? 'global';\r\n }\r\n\r\n getScopeAtLine( line: number ): ScopeInfo[]\r\n {\r\n return this._lineScopes[line] ?? [{ name: 'global', type: 'global', line: 0 }];\r\n }\r\n\r\n getSymbols( name: string ): Symbol[]\r\n {\r\n return this._symbols.get( name ) ?? [];\r\n }\r\n\r\n getAllSymbolNames(): string[]\r\n {\r\n return Array.from( this._symbols.keys() );\r\n }\r\n\r\n getAllSymbols(): Symbol[]\r\n {\r\n const all: Symbol[] = [];\r\n for ( const symbols of this._symbols.values() )\r\n {\r\n all.push( ...symbols );\r\n }\r\n return all;\r\n }\r\n\r\n getLineSymbols( line: number ): Symbol[]\r\n {\r\n return this._lineSymbols[line] ?? [];\r\n }\r\n\r\n /** Update scope stack for a line (call before parsing symbols) */\r\n updateScopeForLine( line: number, lineText: string ): void\r\n {\r\n // Track braces to maintain scope stack\r\n const openBraces = ( lineText.match( /\\{/g ) || [] ).length;\r\n const closeBraces = ( lineText.match( /\\}/g ) || [] ).length;\r\n\r\n // Save current scope for this line\r\n this._lineScopes[line] = [ ...this._scopeStack ];\r\n\r\n // Pop scopes for closing braces\r\n for ( let i = 0; i < closeBraces; i++ )\r\n {\r\n if ( this._scopeStack.length > 1 ) this._scopeStack.pop();\r\n }\r\n\r\n // Push scopes for opening braces (will be named by symbol detection)\r\n for ( let i = 0; i < openBraces; i++ )\r\n {\r\n this._scopeStack.push( { name: 'anonymous', type: 'anonymous', line } );\r\n }\r\n }\r\n\r\n /** Name the most recent anonymous scope (called when detecting class/function) */\r\n nameCurrentScope( name: string, type: string ): void\r\n {\r\n if ( this._scopeStack.length > 0 )\r\n {\r\n const current = this._scopeStack[this._scopeStack.length - 1];\r\n if ( current.name === 'anonymous' || current.type === 'anonymous' )\r\n {\r\n current.name = name;\r\n current.type = type;\r\n }\r\n }\r\n }\r\n\r\n /** Remove symbols from a line (before reparsing) */\r\n removeLineSymbols( line: number ): void\r\n {\r\n const oldSymbols = this._lineSymbols[line];\r\n if ( !oldSymbols ) return;\r\n\r\n for ( const symbol of oldSymbols )\r\n {\r\n const list = this._symbols.get( symbol.name );\r\n if ( !list ) continue;\r\n\r\n // Remove this specific symbol from the name's list\r\n const index = list.findIndex( s => s.line === line && s.kind === symbol.kind && s.scope === symbol.scope );\r\n if ( index !== -1 ) list.splice( index, 1 );\r\n\r\n if ( list.length === 0 ) this._symbols.delete( symbol.name );\r\n }\r\n\r\n this._lineSymbols[line] = [];\r\n }\r\n\r\n addSymbol( symbol: Symbol ): void\r\n {\r\n if ( !this._symbols.has( symbol.name ) )\r\n {\r\n this._symbols.set( symbol.name, [] );\r\n }\r\n this._symbols.get( symbol.name )!.push( symbol );\r\n\r\n if ( !this._lineSymbols[symbol.line] )\r\n {\r\n this._lineSymbols[symbol.line] = [];\r\n }\r\n this._lineSymbols[symbol.line].push( symbol );\r\n }\r\n\r\n /** Reset scope stack (e.g. when document structure changes significantly) */\r\n resetScopes(): void\r\n {\r\n this._scopeStack = [{ name: 'global', type: 'global', line: 0 }];\r\n this._lineScopes = [];\r\n }\r\n\r\n clear(): void\r\n {\r\n this._symbols.clear();\r\n this._lineSymbols = [];\r\n this.resetScopes();\r\n }\r\n}\r\n\r\n/**\r\n * Parse symbols from a line of code using token types and text patterns to detect declarations.\r\n */\r\nfunction parseSymbolsFromLine( lineText: string, tokens: Token[], line: number, symbolTable: SymbolTable ): Symbol[]\r\n{\r\n const symbols: Symbol[] = [];\r\n const scope = symbolTable.currentScope;\r\n const scopeType = symbolTable.currentScopeType;\r\n\r\n // Build set of reserved words from tokens (keywords, statements, builtins) to skip when detecting symbols\r\n const reservedWords = new Set<string>();\r\n for ( const token of tokens )\r\n {\r\n if ( [ 'keyword', 'statement', 'builtin', 'preprocessor' ].includes( token.type ) )\r\n {\r\n reservedWords.add( token.value );\r\n }\r\n }\r\n\r\n // Track added symbols by name and approximate position to avoid duplicates\r\n const addedSymbols = new Set<string>();\r\n\r\n const addSymbol = ( name: string, kind: string, col: number = 0 ) =>\r\n {\r\n if ( !name || !name.match( /^[a-zA-Z_$][\\w$]*$/ ) ) return; // Valid identifier check\r\n if ( reservedWords.has( name ) ) return;\r\n\r\n // Unique key using 5 chars tolerance\r\n const posKey = `${name}@${Math.floor( col / 5 ) * 5}`;\r\n if ( addedSymbols.has( posKey ) ) return; // Already added\r\n\r\n symbols.push( { name, kind, scope, line, col } );\r\n addedSymbols.add( posKey );\r\n };\r\n\r\n // Top-level declaration patterns (only one per line, checked with anchors)\r\n const topLevelPatterns = [\r\n { regex: /^\\s*class\\s+([A-Z_]\\w*)/i, kind: 'class' },\r\n { regex: /^\\s*struct\\s+([A-Z_]\\w*)/i, kind: 'struct' },\r\n { regex: /^\\s*interface\\s+([A-Z_]\\w*)/i, kind: 'interface' },\r\n { regex: /^\\s*enum\\s+([A-Z_]\\w*)/i, kind: 'enum' },\r\n { regex: /^\\s*type\\s+([A-Z_]\\w*)\\s*=/i, kind: 'type' },\r\n { regex: /^\\s*(?:export\\s+)?(?:async\\s+)?function\\s+(\\w+)/i, kind: 'function' },\r\n { regex: /^\\s*(?:const|let|var)\\s+(\\w+)\\s*=\\s*(?:async\\s+)?\\([^)]*\\)\\s*=>/i, kind: 'function' },\r\n { regex: /^\\s*(?:static\\s+|const\\s+|virtual\\s+|inline\\s+|extern\\s+|pub\\s+|async\\s+)*(\\w+[\\w\\s\\*&:<>,]*?)\\s+(\\w+)\\s*\\([^)]*\\)\\s*[{;]/i, kind: 'typed-function' },\r\n { regex: /^\\s*(?:public|private|protected|static|readonly)*\\s*(\\w+)\\s*\\([^)]*\\)\\s*[:{]/i, kind: scopeType === 'class' ? 'method' : 'function' }\r\n ];\r\n\r\n const multiPatterns = [\r\n { regex: /(?:const|let|var)\\s+(\\w+)/gi, kind: 'variable' },\r\n { regex: /(\\w+)\\s*:\\s*(?:function|[A-Z]\\w*)/gi, kind: 'variable' },\r\n { regex: /this\\.(\\w+)\\s*=/gi, kind: 'property' },\r\n { regex: /new\\s+([A-Z]\\w+)/gi, kind: 'constructor-call' },\r\n { regex: /(\\w+)\\s*\\(/gi, kind: 'method-call' }\r\n ];\r\n\r\n let foundTopLevel = false;\r\n for ( const pattern of topLevelPatterns )\r\n {\r\n const match = lineText.match( pattern.regex );\r\n if ( match )\r\n {\r\n let name: string;\r\n let kind = pattern.kind;\r\n\r\n if ( pattern.kind === 'typed-function' && match[2] )\r\n {\r\n name = match[2];\r\n kind = scopeType === 'class' ? 'method' : 'function';\r\n }\r\n else if ( match[1] )\r\n {\r\n name = match[1];\r\n }\r\n else\r\n {\r\n continue;\r\n }\r\n\r\n const col = lineText.indexOf( name );\r\n addSymbol( name, kind, col );\r\n\r\n if ( [ 'class', 'function', 'method', 'enum', 'struct', 'interface' ].includes( kind ) )\r\n {\r\n symbolTable.nameCurrentScope( name, kind );\r\n }\r\n\r\n foundTopLevel = true;\r\n break;\r\n }\r\n }\r\n\r\n // If no top-level declaration, check for multiple occurrences\r\n if ( !foundTopLevel )\r\n {\r\n for ( const pattern of multiPatterns )\r\n {\r\n const matches = lineText.matchAll( pattern.regex );\r\n for ( const match of matches )\r\n {\r\n if ( match[1] )\r\n {\r\n const name = match[1];\r\n const col = match.index ?? 0;\r\n addSymbol( name, pattern.kind, col );\r\n }\r\n }\r\n }\r\n }\r\n\r\n if ( scopeType === 'enum' )\r\n {\r\n const enumValueMatch = lineText.match( /^\\s*(\\w+)\\s*[,=]?/ );\r\n if ( enumValueMatch && enumValueMatch[1] && !lineText.includes( 'enum' ) )\r\n {\r\n addSymbol( enumValueMatch[1], 'enum-value', lineText.indexOf( enumValueMatch[1] ) );\r\n }\r\n }\r\n\r\n return symbols;\r\n}\r\n\r\n// _____ _ _____ _ _ _ ____ _____ _____ \r\n// | |___ _| |___| __|_| |_| |_ ___ ___ | \\| | |\r\n// | --| . | . | -_| __| . | | _| . | _| | | | | | | | |\r\n// |_____|___|___|___|_____|___|_|_| |___|_| |____/|_____|_|_|_|\r\n\r\nconst g = globalThis as any;\r\nconst TOKEN_CLASS_MAP: Record<string, string> = {\r\n 'keyword': 'cm-kwd',\r\n 'statement': 'cm-std',\r\n 'type': 'cm-typ',\r\n 'builtin': 'cm-bln',\r\n 'string': 'cm-str',\r\n 'comment': 'cm-com',\r\n 'number': 'cm-dec',\r\n 'method': 'cm-mtd',\r\n 'symbol': 'cm-sym',\r\n 'enum': 'cm-enu',\r\n 'preprocessor': 'cm-ppc',\r\n 'variable': 'cm-var',\r\n};\r\n\r\nconst Area = LX.Area;\r\nconst Panel = LX.Panel;\r\nconst Tabs = LX.Tabs;\r\nconst NodeTree = LX.NodeTree;\r\n\r\ninterface CodeTab\r\n{\r\n name: string;\r\n dom: HTMLElement;\r\n doc: CodeDocument;\r\n cursorSet: CursorSet;\r\n undoManager: UndoManager;\r\n language: string;\r\n title?: string;\r\n path?: string;\r\n}\r\n\r\n// _____ _ _ _____\r\n// | __|___ ___ ___| | | __ |___ ___\r\n// |__ | _| _| . | | | __ -| .'| _|\r\n// |_____|___|_| |___|_|_|_____|__,|_|\r\n\r\nclass ScrollBar\r\n{\r\n static SIZE = 10;\r\n\r\n root: HTMLElement;\r\n thumb: HTMLElement;\r\n\r\n private _vertical: boolean;\r\n private _thumbPos: number = 0; // current thumb offset in px\r\n private _thumbRatio: number = 0; // thumb size as fraction of track (0..1)\r\n private _lastMouse: number = 0;\r\n private _onDrag: ( ( delta: number ) => void ) | null = null;\r\n\r\n get visible(): boolean { return !this.root.classList.contains( 'hidden' ); }\r\n get isVertical(): boolean { return this._vertical; }\r\n\r\n constructor( vertical: boolean, onDrag: ( delta: number ) => void )\r\n {\r\n this._vertical = vertical;\r\n this._onDrag = onDrag;\r\n\r\n this.root = LX.makeElement( 'div', `lexcodescrollbar hidden ${vertical ? 'vertical' : 'horizontal'}` );\r\n\r\n this.thumb = LX.makeElement( 'div' );\r\n this.thumb.addEventListener( 'mousedown', ( e: MouseEvent ) => this._onMouseDown( e ) );\r\n this.root.appendChild( this.thumb );\r\n }\r\n\r\n setThumbRatio( ratio: number ): void\r\n {\r\n this._thumbRatio = LX.clamp( ratio, 0, 1 );\r\n const needed = this._thumbRatio < 1;\r\n this.root.classList.toggle( 'hidden', !needed );\r\n\r\n if ( needed )\r\n {\r\n if ( this._vertical )\r\n this.thumb.style.height = ( this._thumbRatio * 100 ) + '%';\r\n else\r\n this.thumb.style.width = ( this._thumbRatio * 100 ) + '%';\r\n }\r\n }\r\n\r\n syncToScroll( scrollPos: number, scrollMax: number ): void\r\n {\r\n if ( scrollMax <= 0 ) return;\r\n const trackSize = this._vertical ? this.root.offsetHeight : this.root.offsetWidth;\r\n const thumbSize = this._vertical ? this.thumb.offsetHeight : this.thumb.offsetWidth;\r\n const available = trackSize - thumbSize;\r\n if ( available <= 0 ) return;\r\n\r\n this._thumbPos = ( scrollPos / scrollMax ) * available;\r\n this._applyPosition();\r\n }\r\n\r\n applyDragDelta( delta: number, scrollMax: number ): number\r\n {\r\n const trackSize = this._vertical ? this.root.offsetHeight : this.root.offsetWidth;\r\n const thumbSize = this._vertical ? this.thumb.offsetHeight : this.thumb.offsetWidth;\r\n const available = trackSize - thumbSize;\r\n if ( available <= 0 ) return 0;\r\n\r\n this._thumbPos = LX.clamp( this._thumbPos + delta, 0, available );\r\n this._applyPosition();\r\n\r\n return ( this._thumbPos / available ) * scrollMax;\r\n }\r\n\r\n private _applyPosition(): void\r\n {\r\n if ( this._vertical )\r\n this.thumb.style.top = this._thumbPos + 'px';\r\n else\r\n this.thumb.style.left = this._thumbPos + 'px';\r\n }\r\n\r\n private _onMouseDown( e: MouseEvent ): void\r\n {\r\n const doc = document;\r\n this._lastMouse = this._vertical ? e.clientY : e.clientX;\r\n\r\n const onMouseMove = ( e: MouseEvent ) =>\r\n {\r\n const current = this._vertical ? e.clientY : e.clientX;\r\n const delta = current - this._lastMouse;\r\n this._lastMouse = current;\r\n this._onDrag?.( delta );\r\n e.stopPropagation();\r\n e.preventDefault();\r\n };\r\n\r\n const onMouseUp = () =>\r\n {\r\n doc.removeEventListener( 'mousemove', onMouseMove );\r\n doc.removeEventListener( 'mouseup', onMouseUp );\r\n };\r\n\r\n doc.addEventListener( 'mousemove', onMouseMove );\r\n doc.addEventListener( 'mouseup', onMouseUp );\r\n e.stopPropagation();\r\n e.preventDefault();\r\n }\r\n}\r\n\r\n/**\r\n * @class CodeEditor\r\n * The main editor class. Wires Document, Tokenizer, CursorSet, UndoManager\r\n * together with the DOM.\r\n */\r\nexport class CodeEditor\r\n{\r\n static __instances: CodeEditor[] = [];\r\n\r\n language: LanguageDef;\r\n symbolTable: SymbolTable;\r\n\r\n // DOM:\r\n area: typeof Area;\r\n baseArea: typeof Area;\r\n codeArea: typeof Area;\r\n explorerArea: typeof Area;\r\n tabs: typeof Tabs;\r\n root: HTMLElement;\r\n codeScroller: HTMLElement;\r\n codeSizer: HTMLElement;\r\n cursorsLayer: HTMLElement;\r\n selectionsLayer: HTMLElement;\r\n lineGutter: HTMLElement;\r\n vScrollbar!: ScrollBar;\r\n hScrollbar!: ScrollBar;\r\n searchBox: HTMLElement | null = null;\r\n searchLineBox: HTMLElement | null = null;\r\n autocomplete: HTMLElement | null = null;\r\n currentTab: CodeTab | null = null;\r\n statusPanel: typeof Panel;\r\n leftStatusPanel: typeof Panel;\r\n rightStatusPanel: typeof Panel;\r\n explorer: typeof NodeTree | null = null;\r\n\r\n // Measurements:\r\n charWidth: number = 0;\r\n lineHeight: number = 0;\r\n fontSize: number = 0;\r\n xPadding: number = 64; // 4rem left padding in pixels\r\n private _cachedTabsHeight: number = 0;\r\n private _cachedStatusPanelHeight: number = 0;\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 allowAddScripts: boolean = true;\r\n allowClosingTabs: boolean = true;\r\n allowLoadingFiles: boolean = true;\r\n tabSize: number = 4;\r\n highlight: string = 'Plain Text';\r\n newTabOptions: any[] | null = null;\r\n customSuggestions: any[] = [];\r\n explorerName: string = 'EXPLORER';\r\n\r\n // Editor callbacks:\r\n onSave: ( text: string, editor: CodeEditor ) => void;\r\n onRun: ( text: string, editor: CodeEditor ) => void;\r\n onCtrlSpace: ( text: string, editor: CodeEditor ) => void;\r\n onCreateStatusPanel: ( panel: typeof Panel, editor: CodeEditor ) => void;\r\n onContextMenu: any;\r\n onNewTab: ( event: MouseEvent ) => void;\r\n onSelectTab: ( name: string, editor: CodeEditor ) => void;\r\n onReady: ( ( editor: CodeEditor ) => void ) | undefined;\r\n onCreateFile: ( ( editor: CodeEditor ) => void ) | undefined;\r\n onCodeChange: ( ( doc: CodeDocument ) => void ) | undefined;\r\n\r\n private _inputArea!: HTMLTextAreaElement;\r\n\r\n // State:\r\n private _lineStates: TokenizerState[] = []; // tokenizer state at end of each line\r\n private _lineElements: HTMLElement[] = []; // <pre> element per line\r\n private _openedTabs: Record<string, CodeTab> = {};\r\n private _loadedTabs: Record<string, CodeTab> = {};\r\n private _storedTabs: Record<string, any> = {};\r\n private _focused: boolean = false;\r\n private _composing: boolean = false;\r\n private _keyChain: string | null = null;\r\n private _wasPaired: boolean = false;\r\n private _lastAction: string = '';\r\n private _blinkerInterval: ReturnType<typeof setInterval> | null = null;\r\n private _cursorVisible: boolean = true;\r\n private _cursorBlinkRate: number = 550;\r\n private _clickCount: number = 0;\r\n private _lastClickTime: number = 0;\r\n private _lastClickLine: number = -1;\r\n private _isSearchBoxActive: boolean = false;\r\n private _isSearchLineBoxActive: boolean = false;\r\n private _searchMatchCase: boolean = false;\r\n private _lastTextFound: string = '';\r\n private _lastSearchPos: { line: number, col: number } | null = null;\r\n private _discardScroll: boolean = false;\r\n private _isReady: boolean = false;\r\n private _lastMaxLineLength: number = 0;\r\n private _lastLineCount: number = 0;\r\n private _isAutoCompleteActive: boolean = false;\r\n private _selectedAutocompleteIndex: number = 0;\r\n private _displayObservers: { intersectionObserver: IntersectionObserver, resizeObserver: ResizeObserver } | undefined;\r\n\r\n private static readonly CODE_MIN_FONT_SIZE = 9;\r\n private static readonly CODE_MAX_FONT_SIZE = 22;\r\n private static readonly PAIR_KEYS: Record<string, string> = { '\"': '\"', \"'\": \"'\", '`': '`', '(': ')', '{': '}', '[': ']' };\r\n\r\n get doc(): CodeDocument\r\n {\r\n return this.currentTab!.doc;\r\n }\r\n\r\n get undoManager(): UndoManager\r\n {\r\n return this.currentTab!.undoManager;\r\n }\r\n\r\n get cursorSet(): CursorSet\r\n {\r\n return this.currentTab!.cursorSet;\r\n }\r\n\r\n get codeContainer(): HTMLElement\r\n {\r\n return this.currentTab!.dom;\r\n }\r\n\r\n static getInstances()\r\n {\r\n return CodeEditor.__instances;\r\n }\r\n\r\n constructor( area: typeof Area, options: Record<string, any> = {} )\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.allowAddScripts = options.allowAddScripts ?? this.allowAddScripts;\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;\r\n this.onRun = options.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 this.onCodeChange = options.onCodeChange;\r\n\r\n this.language = Tokenizer.getLanguage( this.highlight ) ?? Tokenizer.getLanguage( 'Plain Text' )!;\r\n this.symbolTable = new SymbolTable();\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 const name = node.id;\r\n this.loadTab( name );\r\n } );\r\n\r\n this.explorer.on( 'beforeDelete', ( event: any, resolve: Function ) => {\r\n return;\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 // Full editor\r\n area.root.className = LX.mergeClass( area.root.className, 'codebasearea overflow-hidden flex relative' );\r\n\r\n this.baseArea = area;\r\n this.area = new LX.Area( {\r\n className: 'lexcodeeditor flex flex-col outline-none overflow-hidden size-full select-none bg-inherit relative',\r\n skipAppend: true\r\n } );\r\n\r\n const codeAreaClassName = 'lexcodearea scrollbar-hidden flex flex-row flex-auto-fill';\r\n\r\n if ( !this.skipTabs )\r\n {\r\n this.tabs = this.area.addTabs( { contentClass: codeAreaClassName, onclose: ( name: string ) => {\r\n // this.closeTab triggers this onclose!\r\n delete this._openedTabs[name];\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 ( !this.allowAddScripts ) return;\r\n e.preventDefault();\r\n this._onCreateNewFile();\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( { className: codeAreaClassName, skipAppend: true } );\r\n this.area.attach( this.codeArea );\r\n }\r\n\r\n this.root = this.area.root;\r\n area.attach( this.root );\r\n\r\n this.codeScroller = this.codeArea.root;\r\n // Add Line numbers gutter, only the container, line numbers are in the same line div\r\n this.lineGutter = LX.makeElement( 'div', `w-16 overflow-hidden absolute top-0 bg-inherit z-10 ${this.skipTabs ? '' : 'mt-8'}`, null, this.codeScroller );\r\n // Add code sizer, which will have the code elements\r\n this.codeSizer = LX.makeElement( 'div', 'pseudoparent-tabs w-full', null, this.codeScroller );\r\n\r\n // Cursors and selections\r\n this.cursorsLayer = LX.makeElement( 'div', 'cursors', null, this.codeSizer );\r\n this.selectionsLayer = LX.makeElement( 'div', 'selections', null, this.codeSizer );\r\n\r\n // Custom scrollbars\r\n if ( !this.disableEdition )\r\n {\r\n this.vScrollbar = new ScrollBar( true, ( delta ) => {\r\n const scrollMax = this.codeScroller.scrollHeight - this.codeScroller.clientHeight;\r\n this.codeScroller.scrollTop = this.vScrollbar.applyDragDelta( delta, scrollMax );\r\n this._discardScroll = true;\r\n } );\r\n this.root.appendChild( this.vScrollbar.root );\r\n\r\n this.hScrollbar = new ScrollBar( false, ( delta ) => {\r\n const scrollMax = this.codeScroller.scrollWidth - this.codeScroller.clientWidth;\r\n this.codeScroller.scrollLeft = this.hScrollbar.applyDragDelta( delta, scrollMax );\r\n this._discardScroll = true;\r\n } );\r\n this.root.appendChild( this.hScrollbar.root );\r\n\r\n // Sync scrollbar thumbs on native scroll\r\n this.codeScroller.addEventListener( 'scroll', () => {\r\n if ( this._discardScroll )\r\n {\r\n this._discardScroll = false;\r\n return;\r\n }\r\n this._syncScrollBars();\r\n } );\r\n\r\n // Touch events for native scrolling on mobile\r\n let touchStartX = 0;\r\n let touchStartY = 0;\r\n\r\n this.codeScroller.addEventListener( 'touchstart', ( e: TouchEvent ) => {\r\n touchStartX = e.touches[0].clientX;\r\n touchStartY = e.touches[0].clientY;\r\n }, { passive: true } );\r\n\r\n this.codeScroller.addEventListener( 'touchmove', ( e: TouchEvent ) => {\r\n const touchX = e.touches[0].clientX;\r\n const touchY = e.touches[0].clientY;\r\n\r\n const deltaX = touchStartX - touchX;\r\n const deltaY = touchStartY - touchY;\r\n\r\n this.codeScroller.scrollLeft += deltaX;\r\n this.codeScroller.scrollTop += deltaY;\r\n\r\n touchStartX = touchX;\r\n touchStartY = touchY;\r\n }, { passive: true } );\r\n\r\n // Wheel: Ctrl+Wheel for font zoom, Shift+Wheel for horizontal scroll\r\n this.codeScroller.addEventListener( 'wheel', ( e: WheelEvent ) => {\r\n if ( e.ctrlKey )\r\n {\r\n e.preventDefault();\r\n this._applyFontSizeOffset( e.deltaY < 0 ? 1 : -1 );\r\n return;\r\n }\r\n\r\n if ( e.shiftKey )\r\n {\r\n this.codeScroller.scrollLeft += e.deltaY > 0 ? 10 : -10;\r\n }\r\n }, { passive: false } );\r\n }\r\n\r\n // Resize observer\r\n const codeResizeObserver = new ResizeObserver( () => {\r\n if ( !this.currentTab ) return;\r\n this.resize( true );\r\n } );\r\n codeResizeObserver.observe( this.codeArea.root );\r\n\r\n if ( !this.disableEdition )\r\n {\r\n // Add autocomplete box\r\n if( this.useAutoComplete )\r\n {\r\n this.autocomplete = LX.makeElement( 'div','autocomplete' );\r\n this.codeArea.attach( this.autocomplete );\r\n }\r\n\r\n const searchBoxClass = 'searchbox bg-card min-w-96 absolute z-100 top-8 right-2 rounded-lg border-color overflow-y-scroll opacity-0';\r\n\r\n // Add search box\r\n {\r\n const box = LX.makeElement( 'div', searchBoxClass, null, this.codeArea );\r\n const searchPanel = new LX.Panel();\r\n box.appendChild( searchPanel.root );\r\n\r\n searchPanel.sameLine();\r\n const textComponent = searchPanel.addText( null, '', null, { placeholder: 'Find', inputClass: 'bg-secondary' } );\r\n searchPanel.addButton( null, 'MatchCaseButton', ( v: boolean ) => {\r\n this._searchMatchCase = v;\r\n this._doSearch();\r\n }, { icon: 'CaseSensitive', selectable: true, buttonClass: 'link', title: 'Match Case',\r\n tooltip: true } );\r\n searchPanel.addButton( null, 'up', () => this._doSearch( null, true ), { icon: 'ArrowUp', buttonClass: 'ghost', title: 'Previous Match',\r\n tooltip: true } );\r\n searchPanel.addButton( null, 'down', () => this._doSearch(), { icon: 'ArrowDown', buttonClass: 'ghost', title: 'Next Match',\r\n tooltip: true } );\r\n searchPanel.addButton( null, 'x', this._doHideSearch.bind( this ), { icon: 'X', buttonClass: 'ghost', title: 'Close',\r\n tooltip: true } );\r\n searchPanel.endLine();\r\n\r\n const searchInput = textComponent.root.querySelector( 'input' );\r\n searchInput?.addEventListener( 'keyup', ( e: KeyboardEvent ) => {\r\n if ( e.key == 'Escape' ) this._doHideSearch();\r\n else if ( e.key == 'Enter' ) this._doSearch( ( e.target as HTMLInputElement ).value, !!e.shiftKey );\r\n } );\r\n\r\n this.searchBox = box;\r\n }\r\n\r\n // Add search LINE box\r\n {\r\n const box = LX.makeElement( 'div', searchBoxClass, null, this.codeArea );\r\n const searchPanel = new LX.Panel();\r\n box.appendChild( searchPanel.root );\r\n\r\n searchPanel.sameLine();\r\n const textComponent = searchPanel.addText( null, '', ( value: string ) => {\r\n searchInput.value = ':' + value.replaceAll( ':', '' );\r\n this._doGotoLine( parseInt( searchInput.value.slice( 1 ) ) );\r\n }, { className: 'flex-auto-fill', placeholder: 'Go to line', trigger: 'input' } );\r\n searchPanel.addButton( null, 'x', this._doHideSearch.bind( this ), { icon: 'X', title: 'Close', buttonClass: 'ghost',\r\n tooltip: true } );\r\n searchPanel.endLine();\r\n\r\n const searchInput = textComponent.root.querySelector( 'input' );\r\n searchInput.addEventListener( 'keyup', ( e: KeyboardEvent ) => {\r\n if ( e.key == 'Escape' ) this._doHideSearch();\r\n } );\r\n\r\n searchPanel.addText( null, 'Type a line number to go to (from 0 to 0).', null,\r\n { disabled: true, inputClass: 'text-xs bg-none', signal: '@line-number-range' } );\r\n\r\n this.searchLineBox = box;\r\n }\r\n }\r\n\r\n // Hidden textarea for capturing keyboard input (dead keys, IME, etc.)\r\n this._inputArea = LX.makeElement( 'textarea', 'absolute opacity-0 w-[1px] h-[1px] top-0 left-0 overflow-hidden resize-none', '', this.root );\r\n this._inputArea.setAttribute( 'autocorrect', 'off' );\r\n this._inputArea.setAttribute( 'autocapitalize', 'off' );\r\n this._inputArea.setAttribute( 'spellcheck', 'false' );\r\n this._inputArea.tabIndex = 0;\r\n\r\n // Events:\r\n this._inputArea.addEventListener( 'keydown', this._onKeyDown.bind( this ) );\r\n this._inputArea.addEventListener( 'compositionstart', () => this._composing = true );\r\n this._inputArea.addEventListener( 'compositionend', ( e: CompositionEvent ) => {\r\n this._composing = false;\r\n this._inputArea.value = '';\r\n if ( e.data ) this._doInsertChar( e.data );\r\n } );\r\n this._inputArea.addEventListener( 'input', () => {\r\n if ( this._composing ) return;\r\n const val = this._inputArea.value;\r\n if ( val )\r\n {\r\n this._inputArea.value = '';\r\n this._doInsertChar( val );\r\n }\r\n } );\r\n this._inputArea.addEventListener( 'focus', () => this._setFocused( true ) );\r\n this._inputArea.addEventListener( 'blur', () => this._setFocused( false ) );\r\n this.codeArea.root.addEventListener( 'mousedown', this._onMouseDown.bind( this ) );\r\n this.codeArea.root.addEventListener( 'contextmenu', this._onMouseDown.bind( this ) );\r\n\r\n // Bottom status panel\r\n this.statusPanel = this._createStatusPanel( options );\r\n if ( this.statusPanel )\r\n {\r\n // Don't do this.area.attach here, since it will append to the tabs area.\r\n this.area.root.appendChild( this.statusPanel.root );\r\n }\r\n\r\n if ( this.allowAddScripts )\r\n {\r\n this.onCreateFile = options.onCreateFile;\r\n this.addTab( '+', {\r\n selected: false,\r\n title: 'Create file'\r\n } );\r\n }\r\n\r\n // Starter code tab container\r\n if( options.defaultTab ?? true )\r\n {\r\n this.addTab( options.name || 'untitled', {\r\n language: this.highlight,\r\n title: options.title\r\n } );\r\n\r\n // Initial render\r\n this._renderAllLines();\r\n this._renderCursors();\r\n }\r\n \r\n this._init();\r\n }\r\n\r\n private _init()\r\n {\r\n if ( this._displayObservers ) 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 // 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._displayObservers = {\r\n intersectionObserver,\r\n resizeObserver\r\n // interval,\r\n };\r\n }\r\n\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 addExplorerItem( item: any )\r\n {\r\n if ( !this.explorer )\r\n {\r\n return;\r\n }\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 setText( text: string ): void\r\n {\r\n if( !this.currentTab ) return;\r\n\r\n this.doc.setText( text );\r\n this.cursorSet.set( 0, 0 );\r\n this.undoManager.clear();\r\n this._lineStates = [];\r\n this._renderAllLines();\r\n this._renderCursors();\r\n this._renderSelections();\r\n this.resize( true );\r\n }\r\n\r\n appendText( text: string ): void\r\n {\r\n const cursor = this.cursorSet.getPrimary();\r\n const { line, col } = cursor.head;\r\n\r\n const op = this.doc.insert( line, col, text );\r\n this.undoManager.record( op, this.cursorSet.getCursorPositions() );\r\n\r\n // Move cursor to end of inserted text\r\n const lines = text.split( /\\r?\\n/ );\r\n if ( lines.length === 1 )\r\n {\r\n cursor.head = { line, col: col + text.length };\r\n }\r\n else\r\n {\r\n cursor.head = { line: line + lines.length - 1, col: lines[ lines.length - 1 ].length };\r\n }\r\n cursor.anchor = { ...cursor.head };\r\n\r\n this._rebuildLines();\r\n this._renderCursors();\r\n this._renderSelections();\r\n this.resize();\r\n this._scrollCursorIntoView();\r\n }\r\n\r\n getText(): string\r\n {\r\n return this.doc.getText();\r\n }\r\n\r\n setLanguage( name: string, extension?: string ): void\r\n {\r\n const lang = Tokenizer.getLanguage( name );\r\n if ( !lang ) return;\r\n\r\n this.language = lang;\r\n\r\n if ( this.currentTab )\r\n {\r\n this.currentTab.language = name;\r\n\r\n if( !this.skipTabs )\r\n {\r\n this.tabs.setIcon( this.currentTab.name, getLanguageIcon( lang, extension ) );\r\n }\r\n }\r\n\r\n this._lineStates = [];\r\n this._renderAllLines();\r\n LX.emitSignal( '@highlight', name );\r\n }\r\n\r\n focus(): void\r\n {\r\n this._inputArea.focus();\r\n }\r\n\r\n addTab( name: string, options: Record<string, any> = {} ): CodeTab\r\n {\r\n const isNewTabButton = name === '+';\r\n const dom = LX.makeElement( 'div', 'code' );\r\n const langName = options.language ?? 'Plain Text';\r\n const langDef = Tokenizer.getLanguage( langName );\r\n const extension = LX.getExtension( name );\r\n const icon = isNewTabButton ? null : getLanguageIcon( langDef, extension );\r\n const selected = options.selected ?? true;\r\n\r\n const codeTab : CodeTab = {\r\n name,\r\n dom,\r\n doc: new CodeDocument( this.onCodeChange ),\r\n cursorSet: new CursorSet(),\r\n undoManager: new UndoManager(),\r\n language: langName,\r\n title: options.title ?? name\r\n };\r\n \r\n this._openedTabs[name] = codeTab;\r\n this._loadedTabs[name] = codeTab;\r\n\r\n if ( this.useFileExplorer && !isNewTabButton )\r\n {\r\n this.addExplorerItem( { id: name, skipVisibility: true, icon } );\r\n this.explorer.innerTree.frefresh( name );\r\n }\r\n\r\n if( !this.skipTabs )\r\n {\r\n this.tabs.add( name, dom, {\r\n selected,\r\n icon,\r\n fixed: isNewTabButton,\r\n title: codeTab.title,\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( dom );\r\n\r\n if( options.text )\r\n {\r\n codeTab.doc.setText( options.text );\r\n codeTab.cursorSet.set( 0, 0 );\r\n codeTab.undoManager.clear();\r\n this._renderAllLines();\r\n this._renderCursors();\r\n this._renderSelections();\r\n this._resetGutter();\r\n }\r\n\r\n if ( selected )\r\n {\r\n this.currentTab = codeTab;\r\n this._updateDataInfoPanel( '@tab-name', name );\r\n this.setLanguage( langName, extension );\r\n }\r\n\r\n return codeTab;\r\n }\r\n\r\n loadTab( name: string )\r\n {\r\n if ( this._openedTabs[name] )\r\n {\r\n this.tabs.select( name );\r\n return;\r\n }\r\n\r\n const tab = this._loadedTabs[name];\r\n if( tab )\r\n {\r\n this._openedTabs[name] = tab;\r\n\r\n this.tabs.add( name, tab.dom, {\r\n selected: true,\r\n // icon,\r\n title: tab.title,\r\n onSelect: this._onSelectTab.bind( this ),\r\n onContextMenu: this._onContextMenuTab.bind( this ),\r\n allowDelete: this.allowClosingTabs\r\n } );\r\n\r\n // Move into the sizer..\r\n this.codeSizer.appendChild( tab.dom );\r\n\r\n this.currentTab = tab;\r\n this._updateDataInfoPanel( '@tab-name', name );\r\n return;\r\n }\r\n \r\n this.addTab( name, this._storedTabs[name] ?? null );\r\n }\r\n\r\n closeTab( name: string )\r\n {\r\n if ( !this.allowClosingTabs ) return;\r\n\r\n this.tabs.delete( name );\r\n const tab = this._openedTabs[name];\r\n if ( tab )\r\n {\r\n tab.dom.remove();\r\n delete this._openedTabs[name];\r\n }\r\n\r\n // If we closed the current tab, switch to the first available\r\n if ( this.currentTab?.name === name )\r\n {\r\n const remaining = Object.keys( this._openedTabs ).filter( k => k !== '+' );\r\n if ( remaining.length > 0 )\r\n {\r\n this.tabs.select( remaining[0] );\r\n }\r\n else\r\n {\r\n this.currentTab = null;\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 console.warn( 'suggestions should be a string array!' );\r\n return;\r\n }\r\n\r\n this.customSuggestions = suggestions;\r\n }\r\n\r\n loadFile( file: File | string, options: Record<string, any> = {} ): void\r\n {\r\n const onLoad = ( text: string, name: string ) =>\r\n {\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.tabSize ) );\r\n\r\n const ext = LX.getExtension( name );\r\n const lang = options.language ?? ( Tokenizer.getLanguage( options.language )\r\n ?? ( Tokenizer.getLanguageByExtension( ext ) ?? Tokenizer.getLanguage( 'Plain Text' )! ) );\r\n const langName = lang.name;\r\n\r\n if ( this.useFileExplorer || this.skipTabs )\r\n {\r\n this._storedTabs[name] = {\r\n text,\r\n title: options.title ?? name,\r\n language: langName,\r\n ...options\r\n };\r\n\r\n if ( this.useFileExplorer )\r\n {\r\n this.addExplorerItem( { id: name, skipVisibility: true, icon: getLanguageIcon( lang, ext ) } );\r\n this.explorer.innerTree.frefresh( name );\r\n }\r\n }\r\n else\r\n {\r\n this.addTab( name, {\r\n selected: true,\r\n title: options.title ?? name,\r\n language: langName\r\n } );\r\n \r\n this.doc.setText( text );\r\n this.setLanguage( langName, ext );\r\n this.cursorSet.set( 0, 0 );\r\n this.undoManager.clear();\r\n this._renderCursors();\r\n this._renderSelections();\r\n this._resetGutter();\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 ( typeof file === 'string' )\r\n {\r\n const url = file;\r\n const name = options.filename ?? url.substring( url.lastIndexOf( '/' ) + 1 );\r\n\r\n LX.request( { url, success: ( text: string ) => {\r\n onLoad( text, name );\r\n } } );\r\n }\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 onLoad( text, file.name );\r\n };\r\n }\r\n }\r\n\r\n async loadFiles( files: string[], onComplete?: ( editor: CodeEditor, results: any[], total: number ) => void, async: boolean = false )\r\n {\r\n if ( !files || files.length === 0 )\r\n {\r\n onComplete?.( this, [], 0 );\r\n return;\r\n }\r\n\r\n const results: any[] = [];\r\n\r\n for ( const filePath of files )\r\n {\r\n try\r\n {\r\n const text = await LX.requestFileAsync( filePath, 'text' );\r\n\r\n // Process the loaded file\r\n const name = filePath.substring( filePath.lastIndexOf( '/' ) + 1 );\r\n const processedText = text.replaceAll( '\\r', '' ).replaceAll( /\\t|\\\\t/g, ' '.repeat( this.tabSize ) );\r\n\r\n const ext = LX.getExtension( name );\r\n const lang = Tokenizer.getLanguageByExtension( ext ) ?? Tokenizer.getLanguage( 'Plain Text' )!;\r\n const langName = lang.name;\r\n\r\n if ( this.useFileExplorer || this.skipTabs )\r\n {\r\n this._storedTabs[name] = {\r\n text: processedText,\r\n title: name,\r\n language: langName\r\n };\r\n\r\n if ( this.useFileExplorer )\r\n {\r\n this.addExplorerItem( { id: name, skipVisibility: true, icon: getLanguageIcon( lang, ext ) } );\r\n this.explorer.innerTree.frefresh( name );\r\n }\r\n }\r\n else\r\n {\r\n this.addTab( name, {\r\n selected: results.length === 0, // Select first tab only\r\n title: name,\r\n language: langName\r\n } );\r\n\r\n if ( results.length === 0 )\r\n {\r\n this.doc.setText( processedText );\r\n this.setLanguage( langName, ext );\r\n this.cursorSet.set( 0, 0 );\r\n this.undoManager.clear();\r\n this._renderCursors();\r\n this._renderSelections();\r\n this._resetGutter();\r\n }\r\n }\r\n\r\n results.push( { filePath, name, success: true } );\r\n }\r\n catch ( error )\r\n {\r\n console.error( `[LX.CodeEditor] Failed to load file: ${filePath}`, error );\r\n results.push( { filePath, success: false, error } );\r\n }\r\n }\r\n\r\n onComplete?.( this, results, results.length );\r\n }\r\n\r\n async _setupEditorWhenVisible()\r\n {\r\n // Load any font size from local storage\r\n // If not, use default size and make sure it's sync by not hardcoding a number by default here\r\n const savedFontSize = window.localStorage.getItem( 'lexcodeeditor-font-size' );\r\n if ( savedFontSize )\r\n {\r\n await this._setFontSize( parseInt( savedFontSize ), false );\r\n }\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 await this._measureChar();\r\n }\r\n\r\n LX.emitSignal( '@font-size', this.fontSize );\r\n\r\n LX.doAsync( () => {\r\n \r\n if ( !this._isReady )\r\n {\r\n this._isReady = true;\r\n\r\n if ( this.onReady )\r\n {\r\n this.onReady( this );\r\n }\r\n\r\n console.log( `[LX.CodeEditor] Ready! (font size: ${this.fontSize}px, char size: ${this.charWidth}px)` );\r\n }\r\n }, 20 );\r\n }\r\n\r\n private _onSelectTab( isNewTabButton: boolean, event: MouseEvent, name: string ): void\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.currentTab = this._openedTabs[name];\r\n\r\n this._updateDataInfoPanel( '@tab-name', name );\r\n\r\n this.language = Tokenizer.getLanguage( this.currentTab.language ) ?? Tokenizer.getLanguage( 'Plain Text' )!;\r\n LX.emitSignal( '@highlight', this.currentTab.language );\r\n \r\n this._renderAllLines();\r\n this._afterCursorMove();\r\n\r\n if ( !isNewTabButton && this.onSelectTab )\r\n {\r\n this.onSelectTab( name, this );\r\n }\r\n }\r\n\r\n private _onNewTab( event: MouseEvent )\r\n {\r\n if ( this.onNewTab )\r\n {\r\n this.onNewTab( event );\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._doLoadFromFile.bind( this ) }\r\n ];\r\n\r\n LX.addDropdownMenu( event.target, dmOptions, { side: 'bottom', align: 'start' } );\r\n }\r\n\r\n private _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 // Skip adding new file\r\n if ( !options )\r\n { \r\n return;\r\n }\r\n }\r\n\r\n const name = options.name ?? 'unnamed.js';\r\n this.addTab( name, {\r\n selected: true,\r\n title: name,\r\n indexOffset: options.indexOffset,\r\n language: options.language ?? 'JavaScript'\r\n } );\r\n\r\n this._renderAllLines();\r\n this._renderCursors();\r\n this._renderSelections();\r\n this._resetGutter();\r\n }\r\n\r\n private _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 LX.addDropdownMenu( 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 of Object.keys( 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 of Object.keys( 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 private async _measureChar(): Promise<void>\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 measurer = document.createElement( 'span' );\r\n measurer.className = 'codechar';\r\n measurer.style.visibility = 'hidden';\r\n measurer.textContent = 'M';\r\n line.appendChild( measurer );\r\n\r\n // Force load the font before measuring\r\n const computedStyle = getComputedStyle( measurer );\r\n const fontFamily = computedStyle.fontFamily;\r\n const fontSize = computedStyle.fontSize;\r\n const fontWeight = computedStyle.fontWeight || 'normal';\r\n const fontStyle = computedStyle.fontStyle || 'normal';\r\n const fontString = `${fontStyle} ${fontWeight} ${fontSize} ${fontFamily}`;\r\n\r\n try\r\n {\r\n await document.fonts.load( fontString );\r\n }\r\n catch ( e )\r\n {\r\n console.warn( '[LX.CodeEditor] Failed to load font:', fontString, e );\r\n }\r\n\r\n // Use requestAnimationFrame to ensure the element is rendered\r\n requestAnimationFrame( () =>\r\n {\r\n const rect = measurer.getBoundingClientRect();\r\n this.charWidth = rect.width || 7;\r\n this.lineHeight = parseFloat( getComputedStyle( this.root ).getPropertyValue( '--code-editor-row-height' ) ) || 20;\r\n LX.deleteElement( parentContainer );\r\n\r\n // Re-render cursors with correct measurements\r\n this._renderCursors();\r\n this._renderSelections();\r\n this.resize( true );\r\n } );\r\n }\r\n\r\n private _createStatusPanel( options: Record<string, 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 bg-inherit flex flex-row flex-auto-keep', 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 // Zoom Component\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 // Filename cursor data\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.currentTab?.title ?? '', { id: 'EditorFilenameStatusComponent', fit: true, inputClass: 'text-xs',\r\n signal: '@tab-name' } );\r\n rightStatusPanel.addButton( null, 'Ln 1, Col 1', this._doOpenLineSearch.bind( this ), {\r\n id: 'EditorSelectionStatusComponent',\r\n buttonClass: 'outline xs',\r\n fit: true,\r\n signal: '@cursor-data'\r\n } );\r\n\r\n const tabSizeButton = rightStatusPanel.addButton( null, 'Spaces: ' + this.tabSize, ( value: any, event: any ) => {\r\n\r\n const _onNewTabSize = ( v: string ) => {\r\n this.tabSize = parseInt( v );\r\n this._rebuildLines();\r\n this._updateDataInfoPanel( '@tab-spaces', `Spaces: ${this.tabSize}` );\r\n }\r\n\r\n const dd = LX.addDropdownMenu(\r\n tabSizeButton.root,\r\n [ '2', '4', '8' ].map( ( v ) => { return { name: v, className: 'w-full place-content-center', callback: _onNewTabSize } } ),\r\n { side: 'top', align: 'end' }\r\n );\r\n LX.addClass( dd.root, 'min-w-16! items-center' );\r\n\r\n }, { id: 'EditorIndentationStatusComponent', buttonClass: 'outline xs', signal: '@tab-spaces' } );\r\n\r\n const langButton = rightStatusPanel.addButton( '<b>{ }</b>', this.highlight, ( value: any, event: any ) => {\r\n\r\n const dd = LX.addDropdownMenu(\r\n langButton.root,\r\n Tokenizer.getRegisteredLanguages().map( ( v ) => {\r\n const lang = Tokenizer.getLanguage( v );\r\n const icon: any = getLanguageIcon( lang );\r\n const iconData = icon ? icon.split( ' ' ) : [];\r\n return {\r\n name: v,\r\n icon: iconData[0],\r\n className: 'w-full text-xs px-3',\r\n svgClass: iconData.slice( 1 ).join( ' ' ),\r\n callback: ( v: string ) => this.setLanguage( v )\r\n };\r\n } ),\r\n { side: 'top', align: 'end' }\r\n );\r\n LX.addClass( dd.root, 'min-w-min! items-center' );\r\n\r\n }, { id: 'EditorLanguageStatusComponent', nameWidth: 'auto', buttonClass: 'outline xs', signal: '@highlight', title: '' } );\r\n\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\r\n LX.addDropdownMenu( e.target, menuOptions, { side: 'top', align: 'start' } );\r\n } );\r\n\r\n return panel;\r\n }\r\n\r\n private _updateDataInfoPanel( signal: string, value: string )\r\n {\r\n if ( this.skipInfo ) return;\r\n\r\n if ( this.cursorSet.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 * Tokenize a line and return its innerHTML with syntax highlighting spans.\r\n */\r\n private _tokenizeLine( lineIndex: number ): { html: string; endState: TokenizerState; tokens: Token[] }\r\n {\r\n const prevState = lineIndex > 0\r\n ? ( this._lineStates[ lineIndex - 1 ] ?? Tokenizer.initialState() )\r\n : Tokenizer.initialState();\r\n\r\n const lineText = this.doc.getLine( lineIndex );\r\n const result = Tokenizer.tokenizeLine( lineText, this.language, prevState );\r\n\r\n // Build HTML\r\n const langClass = this.language.name.toLowerCase().replace( /[^a-z]/g, '' );\r\n let html = '';\r\n for ( const token of result.tokens )\r\n {\r\n const cls = TOKEN_CLASS_MAP[ token.type ];\r\n const escaped = token.value\r\n .replace( /&/g, '&amp;' )\r\n .replace( /</g, '&lt;' )\r\n .replace( />/g, '&gt;' );\r\n if ( cls )\r\n {\r\n html += `<span class=\"${cls} ${langClass}\">${escaped}</span>`;\r\n }\r\n else\r\n {\r\n html += escaped;\r\n }\r\n }\r\n\r\n return { html: html || '&nbsp;', endState: result.state, tokens: result.tokens };\r\n }\r\n\r\n /**\r\n * Update symbol table for a line.\r\n */\r\n private _updateSymbolsForLine( lineIndex: number ): void\r\n {\r\n const lineText = this.doc.getLine( lineIndex );\r\n\r\n this.symbolTable.updateScopeForLine( lineIndex, lineText );\r\n\r\n this.symbolTable.removeLineSymbols( lineIndex );\r\n\r\n const { tokens } = this._tokenizeLine( lineIndex );\r\n const symbols = parseSymbolsFromLine( lineText, tokens, lineIndex, this.symbolTable );\r\n for ( const symbol of symbols )\r\n {\r\n this.symbolTable.addSymbol( symbol );\r\n }\r\n }\r\n\r\n /**\r\n * Render all lines from scratch.\r\n */\r\n private _renderAllLines(): void\r\n {\r\n if ( !this.currentTab ) return;\r\n\r\n this.codeContainer.innerHTML = '';\r\n this._lineElements = [];\r\n this._lineStates = [];\r\n this.symbolTable.clear(); // Clear all symbols on full rebuild\r\n\r\n for ( let i = 0; i < this.doc.lineCount; i++ )\r\n {\r\n this._appendLineElement( i );\r\n }\r\n }\r\n\r\n /**\r\n * Gets the html for the line gutter.\r\n */\r\n private _getGutterHtml( lineIndex: number ): string\r\n {\r\n return `<span class=\"line-gutter\">${lineIndex + 1}</span>`;\r\n }\r\n\r\n /**\r\n * Create and append a <pre> element for a line.\r\n */\r\n private _appendLineElement( lineIndex: number ): void\r\n {\r\n const { html, endState } = this._tokenizeLine( lineIndex );\r\n this._lineStates[ lineIndex ] = endState;\r\n\r\n const pre = document.createElement( 'pre' );\r\n pre.innerHTML = this._getGutterHtml( lineIndex ) + html;\r\n this.codeContainer.appendChild( pre );\r\n this._lineElements[ lineIndex ] = pre;\r\n\r\n // Update symbols for this line\r\n this._updateSymbolsForLine( lineIndex );\r\n }\r\n\r\n /**\r\n * Re-render a single line's content (after editing).\r\n */\r\n private _updateLine( lineIndex: number ): void\r\n {\r\n const { html, endState } = this._tokenizeLine( lineIndex );\r\n const oldState = this._lineStates[ lineIndex ];\r\n this._lineStates[ lineIndex ] = endState;\r\n\r\n if ( this._lineElements[ lineIndex ] )\r\n {\r\n this._lineElements[ lineIndex ].innerHTML = this._getGutterHtml( lineIndex ) + html;\r\n }\r\n\r\n // Update symbols for this line\r\n this._updateSymbolsForLine( lineIndex );\r\n\r\n // If the tokenizer state changed (e.g. opened/closed a block comment),\r\n // re-render subsequent lines until states stabilize\r\n if ( !this._statesEqual( oldState, endState ) )\r\n {\r\n for ( let i = lineIndex + 1; i < this.doc.lineCount; i++ )\r\n {\r\n const { html: nextHtml, endState: nextEnd } = this._tokenizeLine( i );\r\n const nextOld = this._lineStates[ i ];\r\n this._lineStates[ i ] = nextEnd;\r\n if ( this._lineElements[ i ] )\r\n {\r\n this._lineElements[ i ].innerHTML = this._getGutterHtml( i ) + nextHtml;\r\n }\r\n this._updateSymbolsForLine( i ); // Update symbols for cascaded lines too\r\n if ( this._statesEqual( nextOld, nextEnd ) ) break;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Rebuild line elements after structural changes (insert/delete lines).\r\n */\r\n private _rebuildLines(): void\r\n {\r\n // Diff: if count matches, just update content; otherwise full rebuild\r\n if ( this._lineElements.length === this.doc.lineCount )\r\n {\r\n for ( let i = 0; i < this.doc.lineCount; i++ )\r\n {\r\n this._updateLine( i );\r\n }\r\n }\r\n else\r\n {\r\n this._renderAllLines();\r\n }\r\n this.resize();\r\n }\r\n\r\n private _statesEqual( a: TokenizerState | undefined, b: TokenizerState ): boolean\r\n {\r\n if ( !a ) return false;\r\n if ( a.stack.length !== b.stack.length ) return false;\r\n for ( let i = 0; i < a.stack.length; i++ )\r\n {\r\n if ( a.stack[i] !== b.stack[i] ) return false;\r\n }\r\n return true;\r\n }\r\n\r\n private _updateActiveLine(): void\r\n {\r\n const hasSelection = this.cursorSet.hasSelection();\r\n const activeLine = this.cursorSet.getPrimary().head.line;\r\n const activeCol = this.cursorSet.getPrimary().head.col;\r\n for ( let i = 0; i < this._lineElements.length; i++ )\r\n {\r\n this._lineElements[i].classList.toggle( 'active-line', !hasSelection && i === activeLine );\r\n }\r\n\r\n this._updateDataInfoPanel( '@cursor-data', `Ln ${activeLine + 1}, Col ${activeCol + 1}` );\r\n }\r\n\r\n private _renderCursors(): void\r\n {\r\n if ( !this.currentTab ) return;\r\n\r\n this.cursorsLayer.innerHTML = '';\r\n\r\n for ( const sel of this.cursorSet.cursors )\r\n {\r\n const el = document.createElement( 'div' );\r\n el.className = 'cursor';\r\n el.innerHTML = '&nbsp;';\r\n el.style.left = ( sel.head.col * this.charWidth + this.xPadding ) + 'px';\r\n el.style.top = ( sel.head.line * this.lineHeight ) + 'px';\r\n this.cursorsLayer.appendChild( el );\r\n }\r\n\r\n this._updateActiveLine();\r\n }\r\n\r\n private _renderSelections(): void\r\n {\r\n if ( !this.currentTab ) return;\r\n\r\n this.selectionsLayer.innerHTML = '';\r\n\r\n for ( const sel of this.cursorSet.cursors )\r\n {\r\n if ( selectionIsEmpty( sel ) ) continue;\r\n\r\n const start = selectionStart( sel );\r\n const end = selectionEnd( sel );\r\n\r\n for ( let line = start.line; line <= end.line; line++ )\r\n {\r\n const lineText = this.doc.getLine( line );\r\n const fromCol = line === start.line ? start.col : 0;\r\n const toCol = line === end.line ? end.col : lineText.length;\r\n\r\n if ( fromCol === toCol ) continue;\r\n\r\n const div = document.createElement( 'div' );\r\n div.className = 'lexcodeselection';\r\n div.style.top = ( line * this.lineHeight ) + 'px';\r\n div.style.left = ( fromCol * this.charWidth + this.xPadding ) + 'px';\r\n div.style.width = ( ( toCol - fromCol ) * this.charWidth ) + 'px';\r\n this.selectionsLayer.appendChild( div );\r\n }\r\n }\r\n }\r\n\r\n private _setFocused( focused: boolean ): void\r\n {\r\n this._focused = focused;\r\n\r\n if ( focused )\r\n {\r\n this.cursorsLayer.classList.add( 'show' );\r\n this.selectionsLayer.classList.add( 'show' );\r\n this.selectionsLayer.classList.remove( 'unfocused' );\r\n this._startBlinker();\r\n }\r\n else\r\n {\r\n this.cursorsLayer.classList.remove( 'show' );\r\n if ( !this._isSearchBoxActive )\r\n {\r\n this.selectionsLayer.classList.add( 'unfocused' );\r\n }\r\n else\r\n {\r\n this.selectionsLayer.classList.add( 'show' );\r\n }\r\n this._stopBlinker();\r\n }\r\n }\r\n\r\n private _startBlinker(): void\r\n {\r\n this._stopBlinker();\r\n this._cursorVisible = true;\r\n this._setCursorVisibility( true );\r\n\r\n this._blinkerInterval = setInterval( () =>\r\n {\r\n this._cursorVisible = !this._cursorVisible;\r\n this._setCursorVisibility( this._cursorVisible );\r\n }, this._cursorBlinkRate );\r\n }\r\n\r\n private _stopBlinker(): void\r\n {\r\n if ( this._blinkerInterval !== null )\r\n {\r\n clearInterval( this._blinkerInterval );\r\n this._blinkerInterval = null;\r\n }\r\n }\r\n\r\n private _resetBlinker(): void\r\n {\r\n if ( this._focused )\r\n {\r\n this._startBlinker();\r\n }\r\n }\r\n\r\n private _setCursorVisibility( visible: boolean ): void\r\n {\r\n const cursors = this.cursorsLayer.querySelectorAll( '.cursor' );\r\n for ( const c of cursors )\r\n {\r\n ( c as HTMLElement ).style.opacity = visible ? '0.6' : '0';\r\n }\r\n }\r\n\r\n // Keyboard input events:\r\n\r\n private _onKeyDown( e: KeyboardEvent ): void\r\n {\r\n if ( !this.currentTab ) return;\r\n\r\n // Ignore events during IME / dead key composition\r\n if ( this._composing || e.key === 'Dead' ) return;\r\n\r\n // Ignore modifier-only presses\r\n if ( [ 'Control', 'Shift', 'Alt', 'Meta' ].includes( e.key ) ) return;\r\n\r\n const ctrl = e.ctrlKey || e.metaKey;\r\n const shift = e.shiftKey;\r\n const alt = e.altKey;\r\n\r\n if ( this._keyChain )\r\n {\r\n const chain = this._keyChain;\r\n this._keyChain = null;\r\n e.preventDefault();\r\n\r\n if ( ctrl && chain === 'k' )\r\n {\r\n switch ( e.key.toLowerCase() )\r\n {\r\n case 'c': this._commentLines(); return;\r\n case 'u': this._uncommentLines(); return;\r\n }\r\n }\r\n return; // Unknown chord, just consume it\r\n }\r\n\r\n if ( ctrl )\r\n {\r\n switch ( e.key.toLowerCase() )\r\n {\r\n case 'a':\r\n e.preventDefault();\r\n this.cursorSet.selectAll( this.doc );\r\n this._afterCursorMove();\r\n return;\r\n case 'd':\r\n e.preventDefault();\r\n this._doFindNextOcurrence();\r\n return;\r\n case 'f':\r\n e.preventDefault();\r\n this._doOpenSearch();\r\n return;\r\n case 'g':\r\n e.preventDefault();\r\n this._doOpenLineSearch();\r\n return;\r\n case 'k':\r\n e.preventDefault();\r\n this._keyChain = 'k';\r\n return;\r\n case 's': // save\r\n e.preventDefault();\r\n if ( this.onSave )\r\n {\r\n this.onSave( this.getText(), this );\r\n }\r\n return;\r\n case 'z':\r\n e.preventDefault();\r\n shift ? this._doRedo() : this._doUndo();\r\n return;\r\n case 'y':\r\n e.preventDefault();\r\n this._doRedo();\r\n return;\r\n case 'c':\r\n e.preventDefault();\r\n this._doCopy();\r\n return;\r\n case 'x':\r\n e.preventDefault();\r\n this._doCut();\r\n return;\r\n case 'v':\r\n e.preventDefault();\r\n this._doPaste();\r\n return;\r\n case ' ':\r\n e.preventDefault();\r\n // Also call user callback if provided\r\n if ( this.onCtrlSpace )\r\n {\r\n this.onCtrlSpace( this.getText(), this );\r\n }\r\n return;\r\n }\r\n }\r\n\r\n switch ( e.key )\r\n {\r\n case 'ArrowLeft':\r\n e.preventDefault();\r\n this._wasPaired = false;\r\n if ( ctrl ) this.cursorSet.moveWordLeft( this.doc, shift );\r\n else this.cursorSet.moveLeft( this.doc, shift );\r\n this._afterCursorMove();\r\n return;\r\n case 'ArrowRight':\r\n e.preventDefault();\r\n this._wasPaired = false;\r\n if ( ctrl ) this.cursorSet.moveWordRight( this.doc, shift );\r\n else this.cursorSet.moveRight( this.doc, shift );\r\n this._afterCursorMove();\r\n return;\r\n case 'ArrowUp':\r\n e.preventDefault();\r\n if ( this._isAutoCompleteActive )\r\n {\r\n const items = this.autocomplete!.childNodes as NodeListOf<HTMLElement>;\r\n items[this._selectedAutocompleteIndex]?.classList.remove( 'selected' );\r\n this._selectedAutocompleteIndex = ( this._selectedAutocompleteIndex - 1 + items.length ) % items.length;\r\n items[this._selectedAutocompleteIndex]?.classList.add( 'selected' );\r\n items[this._selectedAutocompleteIndex]?.scrollIntoView( { block: 'nearest' } );\r\n return;\r\n }\r\n this._wasPaired = false;\r\n if ( alt && shift ) { this._duplicateLine( -1 ); return; }\r\n if ( alt ) { this._swapLine( -1 ); return; }\r\n this.cursorSet.moveUp( this.doc, shift );\r\n this._afterCursorMove();\r\n return;\r\n case 'ArrowDown':\r\n e.preventDefault();\r\n if ( this._isAutoCompleteActive )\r\n {\r\n const items = this.autocomplete!.childNodes as NodeListOf<HTMLElement>;\r\n items[this._selectedAutocompleteIndex]?.classList.remove( 'selected' );\r\n this._selectedAutocompleteIndex = ( this._selectedAutocompleteIndex + 1 ) % items.length;\r\n items[this._selectedAutocompleteIndex]?.classList.add( 'selected' );\r\n items[this._selectedAutocompleteIndex]?.scrollIntoView( { block: 'nearest' } );\r\n return;\r\n }\r\n this._wasPaired = false;\r\n if ( alt && shift ) { this._duplicateLine( 1 ); return; }\r\n if ( alt ) { this._swapLine( 1 ); return; }\r\n this.cursorSet.moveDown( this.doc, shift );\r\n this._afterCursorMove();\r\n return;\r\n case 'Home':\r\n e.preventDefault();\r\n this._wasPaired = false;\r\n this.cursorSet.moveToLineStart( this.doc, shift );\r\n this._afterCursorMove();\r\n return;\r\n case 'End':\r\n e.preventDefault();\r\n this._wasPaired = false;\r\n this.cursorSet.moveToLineEnd( this.doc, shift );\r\n this._afterCursorMove();\r\n return;\r\n case 'Escape':\r\n e.preventDefault();\r\n if( this._isAutoCompleteActive )\r\n {\r\n this._doHideAutocomplete();\r\n return;\r\n }\r\n if ( this._doHideSearch() ) return;\r\n this.cursorSet.removeSecondaryCursors();\r\n // Collapse selection\r\n const h = this.cursorSet.getPrimary().head;\r\n this.cursorSet.set( h.line, h.col );\r\n this._afterCursorMove();\r\n return;\r\n }\r\n\r\n switch ( e.key )\r\n {\r\n case 'Backspace':\r\n e.preventDefault();\r\n this._doBackspace( ctrl );\r\n return;\r\n case 'Delete':\r\n e.preventDefault();\r\n this._doDelete( ctrl );\r\n return;\r\n case 'Enter':\r\n e.preventDefault();\r\n this._doEnter( ctrl );\r\n return;\r\n case 'Tab':\r\n e.preventDefault();\r\n this._doTab( shift );\r\n return;\r\n }\r\n\r\n if ( e.key.length === 1 && !ctrl )\r\n {\r\n e.preventDefault();\r\n this._doInsertChar( e.key );\r\n }\r\n }\r\n\r\n private _flushIfActionChanged( action: string ): void\r\n {\r\n if ( this._lastAction !== action )\r\n {\r\n this.undoManager.flush( this.cursorSet.getCursorPositions() );\r\n this._lastAction = action;\r\n }\r\n }\r\n\r\n private _flushAction(): void\r\n {\r\n this.undoManager.flush( this.cursorSet.getCursorPositions() );\r\n this._lastAction = '';\r\n }\r\n\r\n private _doInsertChar( char: string ): void\r\n {\r\n // Enclose selection if applicable\r\n if ( char in CodeEditor.PAIR_KEYS && this.cursorSet.hasSelection() )\r\n {\r\n this._encloseSelection( char, CodeEditor.PAIR_KEYS[ char ] );\r\n return;\r\n }\r\n\r\n this._flushIfActionChanged( 'insert' );\r\n\r\n this._deleteSelectionIfAny();\r\n\r\n const changedLines = new Set<number>();\r\n let paired = false;\r\n\r\n for ( const idx of this.cursorSet.sortedIndicesBottomUp() )\r\n {\r\n const cursor = this.cursorSet.cursors[idx];\r\n const { line, col } = cursor.head;\r\n const nextChar = this.doc.getCharAt( line, col );\r\n\r\n // If we just auto-paired and the next char is the same closing char, skip over it\r\n if ( this._wasPaired && nextChar === char )\r\n {\r\n cursor.head = { line, col: col + 1 };\r\n cursor.anchor = { ...cursor.head };\r\n continue;\r\n }\r\n\r\n const op = this.doc.insert( line, col, char );\r\n this.undoManager.record( op, this.cursorSet.getCursorPositions() );\r\n\r\n const pairInserted = char in CodeEditor.PAIR_KEYS && ( !nextChar || /\\s/.test( nextChar ) );\r\n const charsInserted = pairInserted ? 2 : 1;\r\n\r\n // Auto-pair: insert closing char if next char is whitespace or end of line\r\n if ( pairInserted )\r\n {\r\n const closeOp = this.doc.insert( line, col + 1, CodeEditor.PAIR_KEYS[ char ] );\r\n this.undoManager.record( closeOp, this.cursorSet.getCursorPositions() );\r\n paired = true;\r\n }\r\n\r\n cursor.head = { line, col: col + 1 };\r\n cursor.anchor = { ...cursor.head };\r\n this.cursorSet.adjustOthers( idx, line, col, charsInserted );\r\n changedLines.add( line );\r\n }\r\n\r\n this._wasPaired = paired;\r\n for ( const line of changedLines ) this._updateLine( line );\r\n this._afterCursorMove();\r\n\r\n // Close autocomplete when typing most chars (except word chars which update it)\r\n if ( /[\\w$]/.test( char ) )\r\n {\r\n // Update autocomplete with new partial word\r\n this._doOpenAutocomplete();\r\n }\r\n else\r\n {\r\n // Non-word char, close autocomplete\r\n this._doHideAutocomplete();\r\n }\r\n }\r\n\r\n private _getAffectedLines(): [ number, number ]\r\n {\r\n const cursor = this.cursorSet.getPrimary();\r\n const a = cursor.anchor.line;\r\n const h = cursor.head.line;\r\n return a <= h ? [ a, h ] : [ h, a ];\r\n }\r\n\r\n private _commentLines(): void\r\n {\r\n const token = this.language.lineComment;\r\n if ( !token ) return;\r\n\r\n const [ fromLine, toLine ] = this._getAffectedLines();\r\n const comment = token + ' ';\r\n\r\n // Find minimum indentation across affected lines (skip empty lines)\r\n let minIndent = Infinity;\r\n for ( let i = fromLine; i <= toLine; i++ )\r\n {\r\n const line = this.doc.getLine( i );\r\n if ( line.trim().length === 0 ) continue;\r\n minIndent = Math.min( minIndent, this.doc.getIndent( i ) );\r\n }\r\n if ( minIndent === Infinity ) minIndent = 0;\r\n\r\n this._flushAction();\r\n for ( let i = fromLine; i <= toLine; i++ )\r\n {\r\n const line = this.doc.getLine( i );\r\n if ( line.trim().length === 0 ) continue;\r\n const op = this.doc.insert( i, minIndent, comment );\r\n this.undoManager.record( op, this.cursorSet.getCursorPositions() );\r\n this._updateLine( i );\r\n }\r\n\r\n this._afterCursorMove();\r\n }\r\n\r\n private _uncommentLines(): void\r\n {\r\n const token = this.language.lineComment;\r\n if ( !token ) return;\r\n\r\n const [ fromLine, toLine ] = this._getAffectedLines();\r\n\r\n this._flushAction();\r\n for ( let i = fromLine; i <= toLine; i++ )\r\n {\r\n const line = this.doc.getLine( i );\r\n const indent = this.doc.getIndent( i );\r\n const rest = line.substring( indent );\r\n\r\n // Check for \"// \" or \"//\"\r\n if ( rest.startsWith( token + ' ' ) )\r\n {\r\n const op = this.doc.delete( i, indent, token.length + 1 );\r\n this.undoManager.record( op, this.cursorSet.getCursorPositions() );\r\n }\r\n else if ( rest.startsWith( token ) )\r\n {\r\n const op = this.doc.delete( i, indent, token.length );\r\n this.undoManager.record( op, this.cursorSet.getCursorPositions() );\r\n }\r\n }\r\n\r\n this._rebuildLines();\r\n this._afterCursorMove();\r\n }\r\n\r\n private _doFindNextOcurrence(): void\r\n {\r\n const primary = this.cursorSet.getPrimary();\r\n\r\n // Get the search text: selection or word under cursor\r\n let searchText = this.cursorSet.getSelectedText( this.doc );\r\n if ( !searchText )\r\n {\r\n const { line, col } = primary.head;\r\n const [ word, start, end ] = this.doc.getWordAt( line, col );\r\n if ( !word ) return;\r\n\r\n // Select the word under cursor first (first Ctrl+D)\r\n primary.anchor = { line, col: start };\r\n primary.head = { line, col: end };\r\n this._renderCursors();\r\n this._renderSelections();\r\n return;\r\n }\r\n\r\n const lastCursor = this.cursorSet.cursors[ this.cursorSet.cursors.length - 1 ];\r\n const lastEnd = posBefore( lastCursor.anchor, lastCursor.head ) ? lastCursor.head : lastCursor.anchor;\r\n\r\n const match = this.doc.findNext( searchText, lastEnd.line, lastEnd.col );\r\n if ( !match ) return;\r\n\r\n // Check if this occurrence is already selected by any cursor\r\n const alreadySelected = this.cursorSet.cursors.some( sel =>\r\n {\r\n const start = posBefore( sel.anchor, sel.head ) ? sel.anchor : sel.head;\r\n return start.line === match.line && start.col === match.col;\r\n } );\r\n\r\n if ( alreadySelected ) return;\r\n\r\n this.cursorSet.cursors.push( {\r\n anchor: { line: match.line, col: match.col },\r\n head: { line: match.line, col: match.col + searchText.length }\r\n } );\r\n\r\n this._renderCursors();\r\n this._renderSelections();\r\n this._scrollCursorIntoView();\r\n }\r\n\r\n private _doOpenSearch( clear: boolean = false ): void\r\n {\r\n if ( !this.searchBox ) return;\r\n\r\n this._doHideSearch();\r\n\r\n LX.addClass( this.searchBox, 'opened' );\r\n this._isSearchBoxActive = true;\r\n\r\n const input: HTMLInputElement | null = this.searchBox.querySelector( 'input' );\r\n if ( !input ) return;\r\n\r\n if ( clear )\r\n {\r\n input.value = '';\r\n }\r\n else if ( this.cursorSet.hasSelection() )\r\n {\r\n input.value = this.cursorSet.getSelectedText( this.doc );\r\n }\r\n\r\n input.selectionStart = 0;\r\n input.selectionEnd = input.value.length;\r\n input.focus();\r\n }\r\n\r\n private _doOpenLineSearch(): void\r\n {\r\n if ( !this.searchLineBox ) return;\r\n\r\n this._doHideSearch();\r\n\r\n LX.emitSignal( '@line-number-range', `Type a line number to go to (from 1 to ${this.doc.lineCount}).` )\r\n\r\n LX.addClass( this.searchLineBox, 'opened' );\r\n this._isSearchLineBoxActive = true;\r\n\r\n const input: HTMLInputElement | null = this.searchLineBox.querySelector( 'input' );\r\n if ( !input ) return;\r\n input.value = ':';\r\n input.focus();\r\n }\r\n\r\n /**\r\n * Returns true if visibility changed.\r\n */\r\n private _doHideSearch(): boolean\r\n {\r\n if ( !this.searchBox || !this.searchLineBox ) return false;\r\n\r\n const active = this._isSearchBoxActive;\r\n const activeLine = this._isSearchLineBoxActive;\r\n if ( active )\r\n {\r\n this.searchBox.classList.remove( 'opened' );\r\n this._isSearchBoxActive = false;\r\n this._lastSearchPos = null;\r\n }\r\n else if ( activeLine )\r\n {\r\n this.searchLineBox.classList.remove( 'opened' );\r\n this._isSearchLineBoxActive = false;\r\n }\r\n\r\n return ( active != this._isSearchBoxActive ) || ( activeLine != this._isSearchLineBoxActive );\r\n }\r\n\r\n private _doSearch( text?: string | null, reverse: boolean = false, callback?: any, skipAlert: boolean = true, forceFocus: boolean = true )\r\n {\r\n text = text ?? this._lastTextFound;\r\n\r\n if ( !text ) return;\r\n\r\n const doc = this.doc;\r\n let startLine: number;\r\n let startCol: number;\r\n\r\n if ( this._lastSearchPos )\r\n {\r\n startLine = this._lastSearchPos.line;\r\n startCol = this._lastSearchPos.col + ( reverse ? -text.length : text.length );\r\n }\r\n else\r\n {\r\n const cursor = this.cursorSet.getPrimary();\r\n startLine = cursor.head.line;\r\n startCol = cursor.head.col;\r\n }\r\n\r\n const findInLine = ( lineIdx: number, fromCol: number ): number =>\r\n {\r\n let lineText = doc.getLine( lineIdx );\r\n let needle = text!;\r\n\r\n if ( !this._searchMatchCase )\r\n {\r\n lineText = lineText.toLowerCase();\r\n needle = needle.toLowerCase();\r\n }\r\n\r\n if ( reverse )\r\n {\r\n const sub = lineText.substring( 0, fromCol );\r\n return sub.lastIndexOf( needle );\r\n }\r\n else\r\n {\r\n return lineText.indexOf( needle, fromCol );\r\n }\r\n };\r\n\r\n let foundLine: number = -1;\r\n let foundCol: number = -1;\r\n\r\n if ( reverse )\r\n {\r\n for ( let j = startLine; j >= 0; j-- )\r\n {\r\n const col = findInLine( j, j === startLine ? startCol : doc.getLine( j ).length );\r\n if ( col > -1 )\r\n {\r\n foundLine = j;\r\n foundCol = col;\r\n break;\r\n }\r\n }\r\n\r\n // Wrap around from bottom\r\n if ( foundLine === -1 )\r\n {\r\n for ( let j = doc.lineCount - 1; j > startLine; j-- )\r\n {\r\n const col = findInLine( j, doc.getLine( j ).length );\r\n if ( col > -1 )\r\n {\r\n foundLine = j;\r\n foundCol = col;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n else\r\n {\r\n for ( let j = startLine; j < doc.lineCount; j++ )\r\n {\r\n const col = findInLine( j, j === startLine ? startCol : 0 );\r\n if ( col > -1 )\r\n {\r\n foundLine = j;\r\n foundCol = col;\r\n break;\r\n }\r\n }\r\n\r\n // Wrap around from top\r\n if ( foundLine === -1 )\r\n {\r\n for ( let j = 0; j < startLine; j++ )\r\n {\r\n const col = findInLine( j, 0 );\r\n if ( col > -1 )\r\n {\r\n foundLine = j;\r\n foundCol = col;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if ( foundLine === -1 )\r\n {\r\n if ( !skipAlert ) alert( 'No results!' );\r\n this._lastSearchPos = null;\r\n return;\r\n }\r\n\r\n this._lastTextFound = text;\r\n this._lastSearchPos = { line: foundLine, col: foundCol };\r\n\r\n if ( callback )\r\n {\r\n callback( foundCol, foundLine );\r\n }\r\n else\r\n {\r\n // Select the found text\r\n const primary = this.cursorSet.getPrimary();\r\n primary.anchor = { line: foundLine, col: foundCol };\r\n primary.head = { line: foundLine, col: foundCol + text.length };\r\n this._renderCursors();\r\n this._renderSelections();\r\n }\r\n\r\n // Scroll to the match\r\n this.codeScroller.scrollTop = Math.max( ( foundLine - 10 ) * this.lineHeight, 0 );\r\n this.codeScroller.scrollLeft = Math.max( foundCol * this.charWidth - this.codeScroller.clientWidth / 2, 0 );\r\n\r\n if ( forceFocus )\r\n {\r\n const input = this.searchBox?.querySelector( 'input' );\r\n input?.focus();\r\n }\r\n }\r\n\r\n private _doGotoLine( lineNumber: number ): void\r\n {\r\n if ( Number.isNaN( lineNumber ) || lineNumber < 1 || lineNumber > this.doc.lineCount ) return;\r\n\r\n this.cursorSet.set( lineNumber - 1, 0 );\r\n\r\n this._afterCursorMove();\r\n }\r\n\r\n private _encloseSelection( open: string, close: string ): void\r\n {\r\n const cursor = this.cursorSet.getPrimary();\r\n const sel = cursor.anchor;\r\n const head = cursor.head;\r\n\r\n // Normalize selection (old invertIfNecessary)\r\n const fromLine = sel.line < head.line || ( sel.line === head.line && sel.col < head.col ) ? sel : head;\r\n const toLine = fromLine === sel ? head : sel;\r\n\r\n // Only single-line selections for now\r\n if ( fromLine.line !== toLine.line ) return;\r\n\r\n const line = fromLine.line;\r\n const from = fromLine.col;\r\n const to = toLine.col;\r\n\r\n this._flushAction();\r\n\r\n const op1 = this.doc.insert( line, from, open );\r\n this.undoManager.record( op1, this.cursorSet.getCursorPositions() );\r\n const op2 = this.doc.insert( line, to + 1, close );\r\n this.undoManager.record( op2, this.cursorSet.getCursorPositions() );\r\n\r\n // Keep selection on the enclosed word (shifted by 1)\r\n cursor.anchor = { line, col: from + 1 };\r\n cursor.head = { line, col: to + 1 };\r\n\r\n this._updateLine( line );\r\n this._afterCursorMove();\r\n }\r\n\r\n private _doBackspace( ctrlKey: boolean ): void\r\n {\r\n this._flushIfActionChanged( 'backspace' );\r\n\r\n // If any cursor has a selection, delete selections\r\n if ( this.cursorSet.hasSelection() )\r\n {\r\n this._deleteSelectionIfAny();\r\n this._rebuildLines();\r\n this._afterCursorMove();\r\n return;\r\n }\r\n\r\n for ( const idx of this.cursorSet.sortedIndicesBottomUp() )\r\n {\r\n const cursor = this.cursorSet.cursors[idx];\r\n const { line, col } = cursor.head;\r\n\r\n if ( line === 0 && col === 0 ) continue;\r\n\r\n if ( col === 0 )\r\n {\r\n // Merge with previous line\r\n const prevLineLen = this.doc.getLine( line - 1 ).length;\r\n const op = this.doc.delete( line - 1, prevLineLen, 1 );\r\n this.undoManager.record( op, this.cursorSet.getCursorPositions() );\r\n cursor.head = { line: line - 1, col: prevLineLen };\r\n cursor.anchor = { ...cursor.head };\r\n this.cursorSet.adjustOthers( idx, line, 0, prevLineLen, -1 );\r\n }\r\n else if ( ctrlKey )\r\n {\r\n // Delete word left\r\n const [ word, from ] = this.doc.getWordAt( line, col - 1 );\r\n const deleteFrom = word.length > 0 ? from : col - 1;\r\n const deleteLen = col - deleteFrom;\r\n const op = this.doc.delete( line, deleteFrom, deleteLen );\r\n this.undoManager.record( op, this.cursorSet.getCursorPositions() );\r\n cursor.head = { line, col: deleteFrom };\r\n cursor.anchor = { ...cursor.head };\r\n this.cursorSet.adjustOthers( idx, line, col, -deleteLen );\r\n }\r\n else\r\n {\r\n const op = this.doc.delete( line, col - 1, 1 );\r\n this.undoManager.record( op, this.cursorSet.getCursorPositions() );\r\n cursor.head = { line, col: col - 1 };\r\n cursor.anchor = { ...cursor.head };\r\n this.cursorSet.adjustOthers( idx, line, col, -1 );\r\n }\r\n }\r\n\r\n this._rebuildLines();\r\n this._afterCursorMove();\r\n this._doOpenAutocomplete();\r\n }\r\n\r\n private _doDelete( ctrlKey: boolean ): void\r\n {\r\n if ( this.cursorSet.hasSelection() )\r\n {\r\n this._deleteSelectionIfAny();\r\n this._rebuildLines();\r\n this._afterCursorMove();\r\n return;\r\n }\r\n\r\n this._flushIfActionChanged( 'delete' );\r\n\r\n for ( const idx of this.cursorSet.sortedIndicesBottomUp() )\r\n {\r\n const cursor = this.cursorSet.cursors[idx];\r\n const { line, col } = cursor.head;\r\n const lineText = this.doc.getLine( line );\r\n\r\n if ( col >= lineText.length && line >= this.doc.lineCount - 1 ) continue;\r\n\r\n if ( col >= lineText.length )\r\n {\r\n // Merge with next line\r\n const op = this.doc.delete( line, col, 1 );\r\n this.undoManager.record( op, this.cursorSet.getCursorPositions() );\r\n this.cursorSet.adjustOthers( idx, line, col, 0, -1 );\r\n }\r\n else if ( ctrlKey )\r\n {\r\n // Delete word right\r\n const [ word, , end ] = this.doc.getWordAt( line, col );\r\n const deleteLen = word.length > 0 ? end - col : 1;\r\n const op = this.doc.delete( line, col, deleteLen );\r\n this.undoManager.record( op, this.cursorSet.getCursorPositions() );\r\n this.cursorSet.adjustOthers( idx, line, col, -deleteLen );\r\n }\r\n else\r\n {\r\n const op = this.doc.delete( line, col, 1 );\r\n this.undoManager.record( op, this.cursorSet.getCursorPositions() );\r\n this.cursorSet.adjustOthers( idx, line, col, -1 );\r\n }\r\n }\r\n\r\n this._rebuildLines();\r\n this._afterCursorMove();\r\n }\r\n\r\n private _doEnter( shift: boolean ): void\r\n {\r\n if ( this._isAutoCompleteActive )\r\n {\r\n this._doAutocompleteWord();\r\n return;\r\n }\r\n\r\n if ( shift && this.onRun )\r\n {\r\n this.onRun( this.getText(), this );\r\n return;\r\n }\r\n\r\n this._deleteSelectionIfAny();\r\n this._flushAction();\r\n\r\n for ( const idx of this.cursorSet.sortedIndicesBottomUp() )\r\n {\r\n const cursor = this.cursorSet.cursors[idx];\r\n const { line, col } = cursor.head;\r\n\r\n const indent = this.doc.getIndent( line );\r\n const spaces = ' '.repeat( indent );\r\n\r\n const op = this.doc.insert( line, col, '\\n' + spaces );\r\n this.undoManager.record( op, this.cursorSet.getCursorPositions() );\r\n\r\n cursor.head = { line: line + 1, col: indent };\r\n cursor.anchor = { ...cursor.head };\r\n this.cursorSet.adjustOthers( idx, line, col, 0, 1 );\r\n }\r\n\r\n this._rebuildLines();\r\n this._afterCursorMove();\r\n }\r\n\r\n private _doTab( shift: boolean ): void\r\n {\r\n if ( this._isAutoCompleteActive )\r\n {\r\n this._doAutocompleteWord();\r\n return;\r\n }\r\n\r\n this._flushAction();\r\n\r\n for ( const idx of this.cursorSet.sortedIndicesBottomUp() )\r\n {\r\n const cursor = this.cursorSet.cursors[idx];\r\n const { line, col } = cursor.head;\r\n\r\n if ( shift )\r\n {\r\n // Dedent: remove up to tabSize spaces from start\r\n const lineText = this.doc.getLine( line );\r\n let spacesToRemove = 0;\r\n while ( spacesToRemove < this.tabSize && spacesToRemove < lineText.length && lineText[spacesToRemove] === ' ' )\r\n {\r\n spacesToRemove++;\r\n }\r\n if ( spacesToRemove > 0 )\r\n {\r\n const op = this.doc.delete( line, 0, spacesToRemove );\r\n this.undoManager.record( op, this.cursorSet.getCursorPositions() );\r\n cursor.head = { line, col: Math.max( 0, col - spacesToRemove ) };\r\n cursor.anchor = { ...cursor.head };\r\n this.cursorSet.adjustOthers( idx, line, 0, -spacesToRemove );\r\n }\r\n }\r\n else\r\n {\r\n const spacesToAdd = this.tabSize - ( col % this.tabSize );\r\n const spaces = ' '.repeat( spacesToAdd );\r\n const op = this.doc.insert( line, col, spaces );\r\n this.undoManager.record( op, this.cursorSet.getCursorPositions() );\r\n cursor.head = { line, col: col + spacesToAdd };\r\n cursor.anchor = { ...cursor.head };\r\n this.cursorSet.adjustOthers( idx, line, col, spacesToAdd );\r\n }\r\n }\r\n\r\n this._rebuildLines();\r\n this._afterCursorMove();\r\n }\r\n\r\n private _deleteSelectionIfAny(): void\r\n {\r\n let anyDeleted = false;\r\n\r\n for ( const idx of this.cursorSet.sortedIndicesBottomUp() )\r\n {\r\n const sel = this.cursorSet.cursors[idx];\r\n if ( selectionIsEmpty( sel ) ) continue;\r\n\r\n const start = selectionStart( sel );\r\n const end = selectionEnd( sel );\r\n const selectedText = this.cursorSet.getSelectedText( this.doc, idx );\r\n if ( !selectedText ) continue;\r\n\r\n const linesRemoved = end.line - start.line;\r\n // not exact for multiline, but start.col is where cursor lands\r\n const colDelta = linesRemoved === 0 ? ( end.col - start.col ) : start.col; \r\n\r\n const op = this.doc.delete( start.line, start.col, selectedText.length );\r\n this.undoManager.record( op, this.cursorSet.getCursorPositions() );\r\n\r\n sel.head = { ...start };\r\n sel.anchor = { ...start };\r\n this.cursorSet.adjustOthers( idx, start.line, start.col, -colDelta, -linesRemoved );\r\n anyDeleted = true;\r\n }\r\n\r\n if ( anyDeleted ) this._rebuildLines();\r\n }\r\n\r\n // Clipboard helpers:\r\n\r\n private _doCopy(): void\r\n {\r\n const text = this.cursorSet.getSelectedText( this.doc );\r\n if ( text )\r\n {\r\n navigator.clipboard.writeText( text );\r\n }\r\n }\r\n\r\n private _doCut(): void\r\n {\r\n this._flushAction();\r\n\r\n const text = this.cursorSet.getSelectedText( this.doc );\r\n if ( text )\r\n {\r\n navigator.clipboard.writeText( text );\r\n this._deleteSelectionIfAny();\r\n }\r\n else\r\n {\r\n const cursor = this.cursorSet.getPrimary();\r\n const line = cursor.head.line;\r\n const lineText = this.doc.getLine( line );\r\n const isLastLine = line === this.doc.lineCount - 1;\r\n\r\n navigator.clipboard.writeText( lineText + ( isLastLine ? '' : '\\n' ) );\r\n\r\n \r\n const op = this.doc.removeLine( line );\r\n this.undoManager.record( op, this.cursorSet.getCursorPositions() );\r\n\r\n // Place cursor at col 0 of the resulting line\r\n const newLine = Math.min( line, this.doc.lineCount - 1 );\r\n cursor.head = { line: newLine, col: 0 };\r\n cursor.anchor = { ...cursor.head };\r\n }\r\n\r\n this._rebuildLines();\r\n this._afterCursorMove();\r\n }\r\n\r\n private _swapLine( dir: -1 | 1 ): void\r\n {\r\n const cursor = this.cursorSet.getPrimary();\r\n const line = cursor.head.line;\r\n const targetLine = line + dir;\r\n\r\n if ( targetLine < 0 || targetLine >= this.doc.lineCount ) return;\r\n\r\n const currentText = this.doc.getLine( line );\r\n const targetText = this.doc.getLine( targetLine );\r\n\r\n this._flushAction();\r\n const op1 = this.doc.replaceLine( line, targetText );\r\n this.undoManager.record( op1, this.cursorSet.getCursorPositions() );\r\n const op2 = this.doc.replaceLine( targetLine, currentText );\r\n this.undoManager.record( op2, this.cursorSet.getCursorPositions() );\r\n\r\n cursor.head = { line: targetLine, col: cursor.head.col };\r\n cursor.anchor = { ...cursor.head };\r\n\r\n this._rebuildLines();\r\n this._afterCursorMove();\r\n }\r\n\r\n private _duplicateLine( dir: -1 | 1 ): void\r\n {\r\n const cursor = this.cursorSet.getPrimary();\r\n const line = cursor.head.line;\r\n const text = this.doc.getLine( line );\r\n\r\n this._flushAction();\r\n const op = this.doc.insertLine( line, text );\r\n this.undoManager.record( op, this.cursorSet.getCursorPositions() );\r\n\r\n const newLine = dir === 1 ? line + 1 : line;\r\n cursor.head = { line: newLine, col: cursor.head.col };\r\n cursor.anchor = { ...cursor.head };\r\n\r\n this._rebuildLines();\r\n this._afterCursorMove();\r\n }\r\n\r\n private async _doPaste(): Promise<void>\r\n {\r\n const text = await navigator.clipboard.readText();\r\n if ( !text ) return;\r\n \r\n this._flushAction();\r\n\r\n this._deleteSelectionIfAny();\r\n\r\n const cursor = this.cursorSet.getPrimary();\r\n const op = this.doc.insert( cursor.head.line, cursor.head.col, text );\r\n this.undoManager.record( op, this.cursorSet.getCursorPositions() );\r\n\r\n // Calculate new cursor position after paste\r\n const lines = text.split( '\\n' );\r\n if ( lines.length === 1 )\r\n {\r\n this.cursorSet.set( cursor.head.line, cursor.head.col + text.length );\r\n }\r\n else\r\n {\r\n this.cursorSet.set(\r\n cursor.head.line + lines.length - 1,\r\n lines[ lines.length - 1 ].length\r\n );\r\n }\r\n\r\n this._rebuildLines();\r\n this._afterCursorMove();\r\n }\r\n\r\n // Undo/Redo:\r\n\r\n private _doUndo(): void\r\n {\r\n const result = this.undoManager.undo( this.doc, this.cursorSet.getCursorPositions() );\r\n if ( result )\r\n {\r\n if ( result.cursors.length > 0 )\r\n {\r\n const c = result.cursors[0];\r\n this.cursorSet.set( c.line, c.col );\r\n }\r\n this._rebuildLines();\r\n this._afterCursorMove();\r\n }\r\n }\r\n\r\n private _doRedo(): void\r\n {\r\n const result = this.undoManager.redo( this.doc );\r\n if ( result )\r\n {\r\n if ( result.cursors.length > 0 )\r\n {\r\n const c = result.cursors[0];\r\n this.cursorSet.set( c.line, c.col );\r\n }\r\n this._rebuildLines();\r\n this._afterCursorMove();\r\n }\r\n }\r\n\r\n // Mouse input events:\r\n\r\n private _onMouseDown( e: MouseEvent ): void\r\n {\r\n if ( !this.currentTab ) return;\r\n if ( this.searchBox && this.searchBox.contains( e.target as Node ) ) return;\r\n if ( this.autocomplete && this.autocomplete.contains( e.target as Node ) ) return;\r\n\r\n e.preventDefault(); // Prevent browser from stealing focus from _inputArea\r\n this._wasPaired = false;\r\n\r\n // Calculate line and column from click position\r\n const rect = this.codeContainer.getBoundingClientRect();\r\n const x = e.clientX - rect.left - this.xPadding;\r\n const y = e.clientY - rect.top;\r\n\r\n const line = LX.clamp( Math.floor( y / this.lineHeight ), 0, this.doc.lineCount - 1 );\r\n const col = LX.clamp( Math.round( x / this.charWidth ), 0, this.doc.getLine( line ).length );\r\n\r\n if( e.type === 'contextmenu' )\r\n {\r\n this._onContextMenu( e, line, col );\r\n return;\r\n }\r\n\r\n if ( e.button !== 0 ) return;\r\n\r\n const now = Date.now();\r\n if ( now - this._lastClickTime < 400 && line === this._lastClickLine )\r\n {\r\n this._clickCount = Math.min( this._clickCount + 1, 3 );\r\n }\r\n else\r\n {\r\n this._clickCount = 1;\r\n }\r\n\r\n this._lastClickTime = now;\r\n this._lastClickLine = line;\r\n\r\n // Triple click: select entire line\r\n if ( this._clickCount === 3 )\r\n {\r\n const sel = this.cursorSet.getPrimary();\r\n sel.anchor = { line, col: 0 };\r\n sel.head = { line, col: this.doc.getLine( line ).length };\r\n }\r\n // Double click: select word\r\n else if ( this._clickCount === 2 )\r\n {\r\n const [ , start, end ] = this.doc.getWordAt( line, col );\r\n const sel = this.cursorSet.getPrimary();\r\n sel.anchor = { line, col: start };\r\n sel.head = { line, col: end };\r\n }\r\n else if ( e.shiftKey )\r\n {\r\n // Extend selection\r\n const sel = this.cursorSet.getPrimary();\r\n sel.head = { line, col };\r\n }\r\n else\r\n {\r\n this.cursorSet.set( line, col );\r\n }\r\n\r\n this._afterCursorMove();\r\n this._inputArea.focus();\r\n\r\n // Track mouse for drag selection\r\n const onMouseMove = ( me: MouseEvent ) =>\r\n {\r\n const mx = me.clientX - rect.left - this.xPadding;\r\n const my = me.clientY - rect.top;\r\n const ml = Math.max( 0, Math.min( Math.floor( my / this.lineHeight ), this.doc.lineCount - 1 ) );\r\n const mc = Math.max( 0, Math.min( Math.round( mx / this.charWidth ), this.doc.getLine( ml ).length ) );\r\n\r\n const sel = this.cursorSet.getPrimary();\r\n sel.head = { line: ml, col: mc };\r\n this._renderCursors();\r\n this._renderSelections();\r\n };\r\n\r\n const onMouseUp = () =>\r\n {\r\n document.removeEventListener( 'mousemove', onMouseMove );\r\n document.removeEventListener( 'mouseup', onMouseUp );\r\n };\r\n\r\n document.addEventListener( 'mousemove', onMouseMove );\r\n document.addEventListener( 'mouseup', onMouseUp );\r\n }\r\n\r\n private _onContextMenu( e: MouseEvent, line: number, col: number ): void\r\n {\r\n e.preventDefault();\r\n \r\n // if ( !this.canOpenContextMenu )\r\n // {\r\n // return;\r\n // }\r\n\r\n const dmOptions: any[] = [ { name: 'Copy', icon: 'Copy', callback: () => this._doCopy(), kbd: ['Ctrl', 'C'], useKbdSpecialKeys: false } ];\r\n\r\n if ( !this.disableEdition )\r\n {\r\n dmOptions.push( { name: 'Cut', icon: 'Scissors', callback: () => this._doCut(), kbd: ['Ctrl', 'X'], useKbdSpecialKeys: false } );\r\n dmOptions.push( { name: 'Paste', icon: 'Paste', callback: () => this._doPaste(), kbd: ['Ctrl', 'V'], useKbdSpecialKeys: false } );\r\n }\r\n\r\n if ( this.onContextMenu )\r\n {\r\n const content = this.cursorSet.getSelectedText( this.doc );\r\n const options = this.onContextMenu( this, content, e );\r\n if ( options?.length )\r\n {\r\n dmOptions.push( null ); // Separator\r\n\r\n for ( const o of options )\r\n {\r\n dmOptions.push( { name: o.path, disabled: o.disabled, callback: o.callback } );\r\n }\r\n }\r\n }\r\n\r\n LX.addDropdownMenu( e.target, dmOptions, { event: e, side: 'bottom', align: 'start' } );\r\n }\r\n\r\n // Autocomplete:\r\n\r\n /**\r\n * Get word at cursor position for autocomplete.\r\n */\r\n private _getWordAtCursor(): { word: string, start: number, end: number }\r\n {\r\n const cursor = this.cursorSet.getPrimary().head;\r\n const line = this.doc.getLine( cursor.line );\r\n let start = cursor.col;\r\n let end = cursor.col;\r\n\r\n // Find word boundaries\r\n while ( start > 0 && /[\\w$]/.test( line[start - 1] ) ) start--;\r\n while ( end < line.length && /[\\w$]/.test( line[end] ) ) end++;\r\n\r\n return { word: line.slice( start, end ), start, end };\r\n }\r\n\r\n /**\r\n * Open autocomplete box with suggestions from symbols and custom suggestions.\r\n */\r\n private _doOpenAutocomplete(): void\r\n {\r\n if ( !this.autocomplete || !this.useAutoComplete ) return;\r\n\r\n this.autocomplete.innerHTML = ''; // Clear all suggestions\r\n\r\n const { word } = this._getWordAtCursor();\r\n if( !word || word.length === 0 )\r\n {\r\n this._doHideAutocomplete();\r\n return;\r\n }\r\n\r\n const suggestions: Array<{ label: string, kind?: string, scope?: string, detail?: string }> = [];\r\n const added = new Set<string>();\r\n\r\n const addSuggestion = ( label: string, kind?: string, scope?: string, detail?: string ) =>\r\n {\r\n if ( !added.has( label ) )\r\n {\r\n suggestions.push( { label, kind, scope, detail } );\r\n added.add( label );\r\n }\r\n };\r\n\r\n // Get first suggestions from symbol table\r\n const allSymbols = this.symbolTable.getAllSymbols();\r\n for ( const symbol of allSymbols )\r\n {\r\n if ( symbol.name.toLowerCase().startsWith( word.toLowerCase() ) )\r\n {\r\n addSuggestion( symbol.name, symbol.kind, symbol.scope, `${symbol.kind} in ${symbol.scope}` );\r\n }\r\n }\r\n\r\n // Add language reserved keys\r\n for ( const reservedWord of this.language.reservedWords )\r\n {\r\n if ( reservedWord.toLowerCase().startsWith( word.toLowerCase() ) )\r\n {\r\n addSuggestion( reservedWord );\r\n }\r\n }\r\n\r\n // Add custom suggestions\r\n for ( const suggestion of this.customSuggestions )\r\n {\r\n const label = typeof suggestion === 'string' ? suggestion : suggestion.label;\r\n const kind = typeof suggestion === 'object' ? suggestion.kind : undefined;\r\n const detail = typeof suggestion === 'object' ? suggestion.detail : undefined;\r\n\r\n if ( label.toLowerCase().startsWith( word.toLowerCase() ) )\r\n {\r\n addSuggestion( label, kind, undefined, detail );\r\n }\r\n }\r\n\r\n // Close autocomplete if no suggestions\r\n if ( suggestions.length === 0 )\r\n {\r\n this._doHideAutocomplete();\r\n return;\r\n }\r\n\r\n // Sort suggestions: exact matches first, then alphabetically\r\n suggestions.sort( ( a, b ) =>\r\n {\r\n const aExact = a.label.toLowerCase() === word.toLowerCase() ? 0 : 1;\r\n const bExact = b.label.toLowerCase() === word.toLowerCase() ? 0 : 1;\r\n if ( aExact !== bExact ) return aExact - bExact;\r\n return a.label.localeCompare( b.label );\r\n } );\r\n\r\n this._selectedAutocompleteIndex = 0;\r\n\r\n // Render suggestions\r\n suggestions.forEach( ( suggestion, index ) =>\r\n {\r\n const item = document.createElement( 'pre' );\r\n if ( index === this._selectedAutocompleteIndex ) item.classList.add( 'selected' );\r\n const currSuggestion = suggestion.label;\r\n\r\n let iconName = 'CaseLower';\r\n let iconClass = 'foo';\r\n\r\n switch ( suggestion.kind )\r\n {\r\n case 'class':\r\n iconName = 'CircleNodes';\r\n iconClass = 'text-orange-500';\r\n break;\r\n case 'struct':\r\n iconName = 'Form';\r\n iconClass = 'text-orange-400';\r\n break;\r\n case 'interface':\r\n iconName = 'FileType';\r\n iconClass = 'text-cyan-500';\r\n break;\r\n case 'enum':\r\n iconName = 'ListTree';\r\n iconClass = 'text-yellow-500';\r\n break;\r\n case 'enum-value':\r\n iconName = 'Dot';\r\n iconClass = 'text-yellow-400';\r\n break;\r\n case 'type':\r\n iconName = 'Type';\r\n iconClass = 'text-teal-500';\r\n break;\r\n case 'function':\r\n iconName = 'Function';\r\n iconClass = 'text-purple-500';\r\n break;\r\n case 'method':\r\n iconName = 'Box';\r\n iconClass = 'text-fuchsia-500';\r\n break;\r\n case 'variable':\r\n iconName = 'Cuboid';\r\n iconClass = 'text-blue-400';\r\n break;\r\n case 'property':\r\n iconName = 'Layers';\r\n iconClass = 'text-blue-300';\r\n break;\r\n case 'constructor-call':\r\n iconName = 'Hammer';\r\n iconClass = 'text-green-500';\r\n break;\r\n case 'method-call':\r\n iconName = 'PlayCircle';\r\n iconClass = 'text-gray-400';\r\n break;\r\n default:\r\n iconName = 'CaseLower';\r\n iconClass = 'text-gray-500';\r\n break;\r\n }\r\n\r\n item.appendChild( LX.makeIcon( iconName, { iconClass: 'ml-1 mr-2', svgClass: 'sm ' + iconClass } ) );\r\n\r\n // Highlight the written part\r\n const hIndex = currSuggestion.toLowerCase().indexOf( word.toLowerCase() );\r\n\r\n var preWord = document.createElement( 'span' );\r\n preWord.textContent = currSuggestion.substring( 0, hIndex );\r\n item.appendChild( preWord );\r\n\r\n var actualWord = document.createElement( 'span' );\r\n actualWord.textContent = currSuggestion.substring( hIndex, hIndex + word.length );\r\n actualWord.classList.add( 'word-highlight' );\r\n item.appendChild( actualWord );\r\n\r\n var postWord = document.createElement( 'span' );\r\n postWord.textContent = currSuggestion.substring( hIndex + word.length );\r\n item.appendChild( postWord );\r\n\r\n if ( suggestion.kind )\r\n {\r\n const kind = document.createElement( 'span' );\r\n kind.textContent = ` (${suggestion.kind})`;\r\n kind.className = 'kind text-muted-foreground text-xs! ml-2';\r\n item.appendChild( kind );\r\n }\r\n\r\n item.addEventListener( 'click', () =>\r\n {\r\n this._doAutocompleteWord();\r\n } );\r\n\r\n this.autocomplete!.appendChild( item );\r\n } );\r\n\r\n this._isAutoCompleteActive = true;\r\n\r\n const handleClick = ( e: MouseEvent ) =>\r\n {\r\n if ( !this.autocomplete?.contains( e.target as Node ) )\r\n {\r\n this._doHideAutocomplete();\r\n }\r\n };\r\n setTimeout( () => document.addEventListener( 'click', handleClick, { once: true } ), 0 );\r\n\r\n // Store cleanup function\r\n ( this.autocomplete as any )._cleanup = () =>\r\n {\r\n document.removeEventListener( 'click', handleClick );\r\n };\r\n\r\n // Prepare autocomplete ui\r\n this.autocomplete.classList.toggle( 'show', true );\r\n this.autocomplete.classList.toggle( 'no-scrollbar', !( this.autocomplete.scrollHeight > this.autocomplete.offsetHeight ) );\r\n const cursor = this.cursorSet.getPrimary().head;\r\n const left = cursor.col * this.charWidth + this.xPadding;\r\n const top = ( cursor.line + 1 ) * this.lineHeight + this._cachedTabsHeight - this.codeScroller.scrollTop;\r\n this.autocomplete.style.left = left + 'px';\r\n this.autocomplete.style.top = top + 'px';\r\n }\r\n\r\n private _doHideAutocomplete(): void\r\n {\r\n if ( !this.autocomplete || !this._isAutoCompleteActive ) return;\r\n\r\n this.autocomplete.innerHTML = ''; // Clear all suggestions\r\n this.autocomplete.classList.remove( 'show' );\r\n this._isAutoCompleteActive = false;\r\n\r\n if ( ( this.autocomplete as any )._cleanup )\r\n {\r\n ( this.autocomplete as any )._cleanup();\r\n delete ( this.autocomplete as any )._cleanup;\r\n }\r\n }\r\n\r\n /**\r\n * Insert the selected autocomplete word at cursor.\r\n */\r\n private _doAutocompleteWord(): void\r\n {\r\n const word = this._getSelectedAutoCompleteWord();\r\n if ( !word ) return;\r\n const cursor = this.cursorSet.getPrimary().head;\r\n const { start, end } = this._getWordAtCursor();\r\n const line = cursor.line;\r\n\r\n const cursorsBefore = this.cursorSet.getCursorPositions();\r\n if ( end > start )\r\n {\r\n const deleteOp = this.doc.delete( line, start, end - start );\r\n this.undoManager.record( deleteOp, cursorsBefore );\r\n }\r\n\r\n const insertOp = this.doc.insert( line, start, word );\r\n this.cursorSet.set( line, start + word.length );\r\n\r\n const cursorsAfter = this.cursorSet.getCursorPositions();\r\n this.undoManager.record( insertOp, cursorsAfter );\r\n\r\n this._rebuildLines();\r\n this._afterCursorMove();\r\n this._doHideAutocomplete();\r\n }\r\n\r\n private _getSelectedAutoCompleteWord(): string | null\r\n {\r\n if ( !this.autocomplete || !this._isAutoCompleteActive ) return null;\r\n\r\n const pre = this.autocomplete.childNodes[ this._selectedAutocompleteIndex ];\r\n var word = '';\r\n for ( let childSpan of pre.childNodes )\r\n {\r\n const span = childSpan as HTMLElement;\r\n\r\n if ( span.constructor != HTMLSpanElement || span.classList.contains( 'kind' ) )\r\n {\r\n continue;\r\n }\r\n word += span.textContent;\r\n }\r\n\r\n return word;\r\n }\r\n\r\n private _afterCursorMove(): void\r\n {\r\n this._renderCursors();\r\n this._renderSelections();\r\n this._resetBlinker();\r\n this.resize();\r\n this._scrollCursorIntoView();\r\n }\r\n\r\n // Scrollbar & Resize:\r\n\r\n private _scrollCursorIntoView(): void\r\n {\r\n const cursor = this.cursorSet.getPrimary().head;\r\n const top = cursor.line * this.lineHeight;\r\n const left = cursor.col * this.charWidth;\r\n\r\n // Vertical scroll\r\n if ( top < this.codeScroller.scrollTop )\r\n {\r\n this.codeScroller.scrollTop = top;\r\n }\r\n else if ( top + this.lineHeight > this.codeScroller.scrollTop + this.codeScroller.clientHeight )\r\n {\r\n this.codeScroller.scrollTop = top + this.lineHeight - this.codeScroller.clientHeight;\r\n }\r\n\r\n // Horizontal scroll\r\n const sbOffset = ScrollBar.SIZE * 2;\r\n if ( left < this.codeScroller.scrollLeft )\r\n {\r\n this.codeScroller.scrollLeft = left;\r\n }\r\n else if ( left + sbOffset > this.codeScroller.scrollLeft + this.codeScroller.clientWidth - this.xPadding )\r\n {\r\n this.codeScroller.scrollLeft = left + sbOffset - this.codeScroller.clientWidth + this.xPadding;\r\n }\r\n }\r\n\r\n private _resetGutter(): void\r\n {\r\n // Use cached value or compute if not available (e.g., on initial load)\r\n const tabsHeight = this._cachedTabsHeight || ( this.tabs?.root.getBoundingClientRect().height ?? 0 );\r\n this.lineGutter.style.height = `calc(100% - ${tabsHeight}px)`;\r\n }\r\n\r\n getMaxLineLength(): number\r\n {\r\n if ( !this.currentTab ) return 0;\r\n\r\n let max = 0;\r\n for ( let i = 0; i < this.doc.lineCount; i++ )\r\n {\r\n const len = this.doc.getLine( i ).length;\r\n if ( len > max ) max = len;\r\n }\r\n return max;\r\n }\r\n\r\n resize( force: boolean = false ): void\r\n {\r\n if ( !this.charWidth ) return;\r\n\r\n // Cache layout measurements to avoid reflows\r\n this._cachedTabsHeight = this.tabs?.root.getBoundingClientRect().height ?? 0;\r\n this._cachedStatusPanelHeight = this.statusPanel?.root.getBoundingClientRect().height ?? 0;\r\n\r\n const maxLineLength = this.getMaxLineLength();\r\n const lineCount = this.currentTab ? this.doc.lineCount : 0;\r\n const viewportChars = Math.floor( ( this.codeScroller.clientWidth - this.xPadding ) / this.charWidth );\r\n const viewportLines = Math.floor( this.codeScroller.clientHeight / this.lineHeight );\r\n\r\n let needsHResize = maxLineLength !== this._lastMaxLineLength\r\n && ( maxLineLength >= viewportChars || this._lastMaxLineLength >= viewportChars );\r\n let needsVResize = lineCount !== this._lastLineCount\r\n && ( lineCount >= viewportLines || this._lastLineCount >= viewportLines );\r\n\r\n\r\n // If doesn't need resize due to not reaching min length, maybe we need to resize if the content shrinks and we have extra space now\r\n needsHResize = needsHResize || ( maxLineLength < viewportChars && this.hScrollbar?.visible );\r\n needsVResize = needsVResize || ( lineCount < viewportLines && this.vScrollbar?.visible );\r\n\r\n if ( !force && !needsHResize && !needsVResize ) return;\r\n\r\n this._lastMaxLineLength = maxLineLength;\r\n this._lastLineCount = lineCount;\r\n\r\n if ( force || needsHResize )\r\n {\r\n this.codeSizer.style.minWidth = ( maxLineLength * this.charWidth + this.xPadding + ScrollBar.SIZE * 2 ) + 'px';\r\n }\r\n\r\n if ( force || needsVResize )\r\n {\r\n this.codeSizer.style.minHeight = ( lineCount * this.lineHeight + ScrollBar.SIZE * 2 ) + 'px';\r\n }\r\n\r\n this._resetGutter();\r\n\r\n setTimeout( () => this._resizeScrollBars(), 10 );\r\n }\r\n\r\n private _resizeScrollBars(): void\r\n {\r\n if ( !this.vScrollbar ) return;\r\n\r\n // Use cached offsets to avoid reflows\r\n const topOffset = this._cachedTabsHeight;\r\n const bottomOffset = this._cachedStatusPanelHeight;\r\n\r\n // Vertical scrollbar: right edge, between tabs and status bar\r\n const scrollHeight = this.codeScroller.scrollHeight;\r\n this.vScrollbar.setThumbRatio( scrollHeight > 0 ? this.codeScroller.clientHeight / scrollHeight : 1 );\r\n this.vScrollbar.root.style.top = topOffset + 'px';\r\n this.vScrollbar.root.style.height = `calc(100% - ${topOffset + bottomOffset}px)`;\r\n\r\n // Horizontal scrollbar: bottom of code area, offset by gutter and vertical scrollbar\r\n const scrollWidth = this.codeScroller.scrollWidth;\r\n this.hScrollbar.setThumbRatio( scrollWidth > 0 ? this.codeScroller.clientWidth / scrollWidth : 1 );\r\n this.hScrollbar.root.style.bottom = bottomOffset + 'px';\r\n this.hScrollbar.root.style.width = `calc(100% - ${this.xPadding + ( this.vScrollbar.visible ? ScrollBar.SIZE : 0 )}px)`;\r\n }\r\n\r\n private _syncScrollBars(): void\r\n {\r\n if ( !this.vScrollbar ) return;\r\n\r\n this.vScrollbar.syncToScroll(\r\n this.codeScroller.scrollTop,\r\n this.codeScroller.scrollHeight - this.codeScroller.clientHeight\r\n );\r\n this.hScrollbar.syncToScroll(\r\n this.codeScroller.scrollLeft,\r\n this.codeScroller.scrollWidth - this.codeScroller.clientWidth\r\n );\r\n }\r\n\r\n // Files:\r\n\r\n private _doLoadFromFile()\r\n {\r\n const input = LX.makeElement( 'input', '', '', document.body );\r\n input.type = 'file';\r\n input.click();\r\n input.addEventListener( 'change', ( e: Event ) => {\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 // Font Size utils:\r\n\r\n private async _setFontSize( size: number, updateDOM: boolean = true )\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 window.localStorage.setItem( 'lexcodeeditor-font-size', `${this.fontSize}` );\r\n await this._measureChar();\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 if ( updateDOM )\r\n {\r\n this._rebuildLines();\r\n this._afterCursorMove();\r\n }\r\n\r\n // Emit event\r\n LX.emitSignal( '@font-size', this.fontSize );\r\n }\r\n\r\n private _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 private _increaseFontSize()\r\n {\r\n this._applyFontSizeOffset( 1 );\r\n }\r\n\r\n private _decreaseFontSize()\r\n {\r\n this._applyFontSizeOffset( -1 );\r\n }\r\n}\r\n\r\n( LX as any ).CodeEditor = CodeEditor;"],"names":[],"mappings":";;;AAAA;AAIA,IAAK,CAAC,EAAE,EACR;IACI,OAAQ,uBAAuB;AACnC;AAEA,EAAE,CAAC,UAAU,CAAC,IAAI,CAAE,YAAY,CAAE;AA2ClC;AACA;AACA;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