Socket
Socket
Sign inDemoInstall

@codemirror/history

Package Overview
Dependencies
6
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.19.1 to 0.19.2

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## 0.19.2 (2022-01-03)
### Bug fixes
Redoing a change now puts the cursor right after the change, regardless of where the selection was when the change was undone.
## 0.19.1 (2021-12-28)

@@ -2,0 +8,0 @@

14

dist/index.js

@@ -1,2 +0,2 @@

import { Annotation, Facet, combineConfig, StateField, Transaction, ChangeSet, ChangeDesc, EditorSelection, StateEffect } from '@codemirror/state';
import { Annotation, Facet, combineConfig, StateField, EditorSelection, Transaction, ChangeSet, ChangeDesc, StateEffect } from '@codemirror/state';
import { EditorView } from '@codemirror/view';

@@ -29,2 +29,7 @@

});
function changeEnd(changes) {
let end = 0;
changes.iterChangedRanges((_, to) => end = to);
return end;
}
const historyField_ = /*@__PURE__*/StateField.define({

@@ -38,3 +43,4 @@ create() {

if (fromHist) {
let item = HistEvent.fromTransaction(tr), from = fromHist.side;
let selection = tr.docChanged ? EditorSelection.single(changeEnd(tr.changes)) : undefined;
let item = HistEvent.fromTransaction(tr, selection), from = fromHist.side;
let other = from == 0 /* Done */ ? state.undone : state.done;

@@ -185,3 +191,3 @@ if (item)

// there are no changes or effects in the transaction.
static fromTransaction(tr) {
static fromTransaction(tr, selection) {
let effects = none;

@@ -195,3 +201,3 @@ for (let invert of tr.startState.facet(invertedEffects)) {

return null;
return new HistEvent(tr.changes.invert(tr.startState.doc), effects, undefined, tr.startState.selection, none);
return new HistEvent(tr.changes.invert(tr.startState.doc), effects, undefined, selection || tr.startState.selection, none);
}

@@ -198,0 +204,0 @@ static selection(selections) {

{
"name": "@codemirror/history",
"version": "0.19.1",
"version": "0.19.2",
"description": "Undo/redo history for the CodeMirror code editor",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc