Skip to content

Commit

Permalink
(fix) Monaco Adapter: Fix EOL Reset in Monaco Model
Browse files Browse the repository at this point in the history
Remove setValue call in setIntiated method in Monaco Adapter, replaced with it's own setText method.

Signed-off-by: Progyan Bhattacharya <[email protected]>
  • Loading branch information
Progyan-APAC authored Jun 25, 2021
1 parent 176358a commit c0a2a13
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ Good to have: commit or PR links.
-->

## v0.1.1 - [#30](https://github.com/interviewstreet/firepad-x/pull/24)

### Fixes

- EOL Reset in Monaco Model content due to `setValue` call in `setInitiated` method, changed it to use existing `setText` call in Monaco Adapter.

## v0.1.0 - [#24](https://github.com/interviewstreet/firepad-x/pull/24)

### Added
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hackerrank/firepad",
"description": "Collaborative text editing powered by Firebase",
"version": "0.1.0",
"version": "0.1.1",
"author": {
"email": "[email protected]",
"name": "Progyan Bhattacharya",
Expand Down
3 changes: 2 additions & 1 deletion src/monaco-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,8 @@ export class MonacoAdapter implements IEditorAdapter {
}

setInitiated(init: boolean): void {
this._monaco.setValue(""); // Perfomance boost on clearing editor after network calls
// Perfomance boost on clearing editor after network calls (do not directly setValue or EOL will get reset and break sync)
this.setText("");
this._initiated = init;
}

Expand Down

0 comments on commit c0a2a13

Please sign in to comment.