-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit session operation #5657
Edit session operation #5657
Conversation
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5657 +/- ##
==========================================
+ Coverage 86.97% 87.00% +0.03%
==========================================
Files 594 594
Lines 43395 43516 +121
Branches 7170 7174 +4
==========================================
+ Hits 37742 37862 +120
- Misses 5653 5654 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
Could you add a brief description to the PR description why we want to make this change and what type of features we unblock by this? |
src/editor.js
Outdated
} | ||
|
||
onStartOperation(commandEvent) { | ||
// scrollTop is kept inside of session.curOp only for backwards compatibility reasons |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just because the bottom line this.curOp = this.session.curOp = ...
was inserting it.
So someone could had have integration code doing something like session.curOp.scrollTop
. I fully agree though that conceptually this shouldn't be there...
Regarding backwards compatibility, are you okay with just treating this as an implementation detail on our end, since we don't really officially document it in
Line 507 in 37c5f76
export interface EditSession extends EventEmitter, OptionsProvider, Folding { |
@@ -347,6 +326,11 @@ class Editor { | |||
|
|||
this.$onSelectionChange = this.onSelectionChange.bind(this); | |||
this.selection.on("changeSelection", this.$onSelectionChange); | |||
|
|||
this.$onStartOperation = this.onStartOperation.bind(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better to do in constructor to not recreate the bound function every time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this exactly what we want, since this listener belongs to a session and should be created and cleaned up according to the session lifecycle?
One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR. |
What
Why
beforeEndOperation
to avoid intermediary states.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Pull Request Checklist:
ace.d.ts
) and its references: