Skip to content

Commit

Permalink
remove references to mutex/mux - closes #15
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonad committed Jan 12, 2025
1 parent 637183e commit 45fd7de
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/y-undomanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import * as cmState from '@codemirror/state'
import * as cmView from '@codemirror/view'
import { ySyncFacet, ySyncAnnotation } from './y-sync.js'
import { YRange } from './y-range.js' // eslint-disable-line
import { createMutex } from 'lib0/mutex'

export class YUndoManagerConfig {
/**
Expand Down Expand Up @@ -73,8 +72,6 @@ class YUndoManagerPluginValue {
* @type {null | YRange}
*/
this._beforeChangeSelection = null
this._mux = createMutex()

this._onStackItemAdded = ({ stackItem, changedParentTypes }) => {
// only store metadata if this type was affected
if (changedParentTypes.has(this.syncConf.ytext) && this._beforeChangeSelection && !stackItem.meta.has(this)) { // do not overwrite previous stored selection
Expand All @@ -92,9 +89,6 @@ class YUndoManagerPluginValue {
this._storeSelection()
}
}
/**
* Do this without mutex, simply use the sync annotation
*/
this._storeSelection = () => {
// store the selection before the change is applied so we can restore it with the undo manager.
this._beforeChangeSelection = this.syncConf.toYRange(this.view.state.selection.main)
Expand Down

0 comments on commit 45fd7de

Please sign in to comment.