-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎉 Major Update: Add C1 support to C0VM.ts, Add tutorial page (#33)
* ✨ Change UI and parser to support C1 * ✨ Support void* in C1 standard * 🐛 Fix tag_ptr display in struct under graph debug mode, Fix behavior of type inference on void* in struct * ✨ Support Function Pointer, but have problem in distinguish struct type and function type * ✨ Extract function types from typedef, Support function pointer in debuggers * fix folder import * ✨ Add Tutorials page * 🔥 Put debug statements into DEBUG branch Co-authored-by: chaosarium <[email protected]>
- Loading branch information
1 parent
47c00ec
commit fc6eb51
Showing
80 changed files
with
1,762 additions
and
1,632 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletions
9
src/components/bc0-editor.tsx → src/components/code_editor/bc0-editor.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import React from "react"; | ||
import AutosizeInput from 'react-18-input-autosize'; | ||
|
||
export default class EditableTab extends React.Component<EditableTabProps, EditableTabState> { | ||
|
||
constructor(props: EditableTabProps) { | ||
super(props); | ||
this.state = { | ||
title: props.title, | ||
being_edited: false, | ||
wip_title: "", | ||
}; | ||
this.onChange = this.onChange.bind(this); | ||
this.onKeyDown = this.onKeyDown.bind(this); | ||
this.startEditing = this.startEditing.bind(this); | ||
this.stopEditing = this.stopEditing.bind(this); | ||
} | ||
|
||
componentDidUpdate(prevProps: EditableTabProps) { | ||
if (this.props.title !== prevProps.title) { | ||
this.setState({title: this.props.title}) | ||
} | ||
} | ||
|
||
onChange(e: React.ChangeEvent<HTMLInputElement>) { | ||
e.preventDefault(); | ||
this.setState({wip_title: e.target.value}); | ||
} | ||
|
||
onKeyDown(e: React.KeyboardEvent<HTMLInputElement>) { | ||
if (e.key === 'Enter') { | ||
this.stopEditing(); | ||
} | ||
} | ||
|
||
startEditing() { | ||
this.setState({wip_title: this.state.title}); | ||
this.setState({being_edited: true}); | ||
} | ||
|
||
async stopEditing() { | ||
await this.props.updateName(this.props.editor_key, this.state.wip_title); | ||
this.setState({ | ||
being_edited: false, | ||
title: this.props.title, // update display title | ||
wip_title: this.state.title // resets title if updateName fails | ||
}); | ||
} | ||
|
||
render() { | ||
if (!this.state.being_edited) { | ||
return ( | ||
<span onDoubleClick={this.startEditing}>{this.state.title}</span> | ||
); | ||
} else { | ||
return ( | ||
<AutosizeInput | ||
className="tab-name" | ||
type="text" | ||
value={this.state.wip_title} | ||
onChange={this.onChange} | ||
onKeyDown={this.onKeyDown} | ||
onBlur={this.stopEditing} | ||
autoFocus | ||
></AutosizeInput> | ||
); | ||
} | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.