@codemirror/autocomplete
Advanced tools
Comparing version 0.19.12 to 0.19.13
@@ -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 @@ |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
141186
3246