mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-02 00:29:22 -06:00
fix default
This commit is contained in:
@@ -61,7 +61,7 @@ export class Ast extends MonacoPane<monaco.editor.IStandaloneCodeEditor, AstStat
|
||||
prevDecorations: any[] = [];
|
||||
colourScheme?: string = undefined;
|
||||
srcColours?: Record<number, number> = undefined;
|
||||
astCode: AstCodeEntry[] = [];
|
||||
astCode?: AstCodeEntry[] = undefined;
|
||||
linkedFadeTimeoutId?: NodeJS.Timeout = undefined;
|
||||
|
||||
constructor(hub: Hub, container: Container, state: AstState & MonacoPaneState) {
|
||||
@@ -134,7 +134,7 @@ export class Ast extends MonacoPane<monaco.editor.IStandaloneCodeEditor, AstStat
|
||||
if (e.target.position === null) return;
|
||||
if (this.settings.hoverShowSource === true) {
|
||||
this.clearLinkedLines();
|
||||
if (e.target.position.lineNumber - 1 in this.astCode) {
|
||||
if (this.astCode && e.target.position.lineNumber - 1 in this.astCode) {
|
||||
const hoverCode = this.astCode[e.target.position.lineNumber - 1];
|
||||
let sourceLine = -1;
|
||||
let colBegin = -1;
|
||||
@@ -238,7 +238,7 @@ export class Ast extends MonacoPane<monaco.editor.IStandaloneCodeEditor, AstStat
|
||||
}
|
||||
|
||||
tryApplyAstColours(): void {
|
||||
if (!this.srcColours || !this.colourScheme || this.astCode.length === 0) return;
|
||||
if (!this.srcColours || !this.colourScheme || !this.astCode || this.astCode.length === 0) return;
|
||||
const astColours = {};
|
||||
for (const [index, code] of this.astCode.entries()) {
|
||||
if (
|
||||
@@ -288,7 +288,7 @@ export class Ast extends MonacoPane<monaco.editor.IStandaloneCodeEditor, AstStat
|
||||
revealLine: boolean,
|
||||
sender: string,
|
||||
) {
|
||||
if (Number(compilerId) === this.compilerInfo.compilerId) {
|
||||
if (Number(compilerId) === this.compilerInfo.compilerId && this.astCode) {
|
||||
const lineNums: number[] = [];
|
||||
const singleNodeLines: number[] = [];
|
||||
const signalFromAnotherPane = sender !== this.getPaneName();
|
||||
|
||||
Reference in New Issue
Block a user