Socket
Socket
Sign inDemoInstall

@codemirror/autocomplete

Package Overview
Dependencies
Maintainers
2
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codemirror/autocomplete - npm Package Compare versions

Comparing version 0.19.12 to 0.19.13

8

CHANGELOG.md

@@ -0,1 +1,9 @@

## 0.19.13 (2022-02-18)
### Bug fixes
Fix an issue where the completion tooltip stayed open if it was explicitly opened and the user backspaced past its start.
Stop snippet filling when a change happens across one of the snippet fields' boundaries.
## 0.19.12 (2022-01-11)

@@ -2,0 +10,0 @@

19

dist/index.js

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

import { Annotation, Facet, combineConfig, StateEffect, StateField, Prec, EditorSelection, Text } from '@codemirror/state';
import { Annotation, Facet, combineConfig, StateEffect, StateField, Prec, EditorSelection, Text, MapMode } from '@codemirror/state';
import { Direction, logException, EditorView, ViewPlugin, Decoration, WidgetType, keymap } from '@codemirror/view';

@@ -740,3 +740,5 @@ import { showTooltip, getTooltip } from '@codemirror/tooltip';

let pos = cur(tr.state);
if ((this.explicitPos > -1 ? pos < from : pos <= from) || pos > to)
if ((this.explicitPos < 0 ? pos <= from : pos < this.from) ||
pos > to ||
type == "delete" && cur(tr.startState) == this.from)
return new ActiveSource(this.source, type == "input" && conf.activateOnTyping ? 1 /* Pending */ : 0 /* Inactive */);

@@ -1093,3 +1095,5 @@ let explicitPos = this.explicitPos < 0 ? -1 : tr.changes.mapPos(this.explicitPos);

map(changes) {
return new FieldRange(this.field, changes.mapPos(this.from, -1), changes.mapPos(this.to, 1));
let from = changes.mapPos(this.from, -1, MapMode.TrackDel);
let to = changes.mapPos(this.to, 1, MapMode.TrackDel);
return from == null || to == null ? null : new FieldRange(this.field, from, to);
}

@@ -1163,3 +1167,10 @@ }

map(changes) {
return new ActiveSnippet(this.ranges.map(r => r.map(changes)), this.active);
let ranges = [];
for (let r of this.ranges) {
let mapped = r.map(changes);
if (!mapped)
return null;
ranges.push(mapped);
}
return new ActiveSnippet(ranges, this.active);
}

@@ -1166,0 +1177,0 @@ selectionInsideField(sel) {

{
"name": "@codemirror/autocomplete",
"version": "0.19.12",
"version": "0.19.13",
"description": "Autocompletion 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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc