Skip to content

Commit

Permalink
chore: make typedef EditSession.curOp consistent (#5698)
Browse files Browse the repository at this point in the history
* move curOp typedef to init

---------

Co-authored-by: Alice Koreman <[email protected]>
  • Loading branch information
akoreman and Alice Koreman authored Dec 17, 2024
1 parent 11e97dd commit fcf6384
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion demo/test_package/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ function createPopup() {
}

const acePopup = createPopup();

const activeCommand = acePopup.getData(acePopup.getRow());
if (activeCommand && activeCommand.command && activeCommand.command.name) {
acePopup.setData([]);
}
acePopup.destroy();

const filter = new FilteredList([]);
filter.setFilter("test");
Expand Down
2 changes: 1 addition & 1 deletion src/edit_session.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class EditSession {
}

$initOperationListeners() {
/**@type {import("../ace-internal").Ace.Operation | null}*/
this.curOp = null;
this.on("change", () => {
if (!this.curOp) {
Expand Down Expand Up @@ -127,7 +128,6 @@ class EditSession {
}

this.$operationResetTimer.schedule();
/**@type {import("../ace-internal").Ace.Operation | null}*/
this.curOp = {
command: commandEvent.command || {},
args: commandEvent.args
Expand Down
2 changes: 1 addition & 1 deletion types/ace-modules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ declare module "ace-code/src/virtual_renderer" {
* @param {EditSession} session The session to associate with
**/
setSession(session: EditSession): void;
session: import("ace-code").Ace.EditSession;
session: import("ace-code/src/edit_session").EditSession;
/**
* Triggers a partial update of the text, from the range given by the two parameters.
* @param {Number} firstRow The first row to update
Expand Down

0 comments on commit fcf6384

Please sign in to comment.