@codemirror/lint
Advanced tools
Comparing version 0.20.0 to 0.20.1
@@ -0,1 +1,7 @@ | ||
## 0.20.1 (2022-04-22) | ||
### Bug fixes | ||
Hide lint tooltips when the document is changed. | ||
## 0.20.0 (2022-04-20) | ||
@@ -2,0 +8,0 @@ |
@@ -44,2 +44,5 @@ import { Decoration, showPanel, EditorView, ViewPlugin, hoverTooltip, logException, gutter, showTooltip, getPanel, WidgetType, GutterMarker } from '@codemirror/view'; | ||
} | ||
function hideTooltip(tr, tooltip) { | ||
return !!(tr.effects.some(e => e.is(setDiagnosticsEffect)) || tr.changes.touchesRange(tooltip.pos)); | ||
} | ||
function maybeEnableLint(state, effects) { | ||
@@ -54,3 +57,3 @@ return state.field(lintState, false) ? effects : effects.concat(StateEffect.appendConfig.of([ | ||
}), | ||
hoverTooltip(lintTooltip), | ||
hoverTooltip(lintTooltip, { hideOn: hideTooltip }), | ||
baseTheme | ||
@@ -666,3 +669,3 @@ ])); | ||
if (tooltip && tr.docChanged) | ||
tooltip = Object.assign(Object.assign({}, tooltip), { pos: tr.changes.mapPos(tooltip.pos) }); | ||
tooltip = hideTooltip(tr, tooltip) ? null : Object.assign(Object.assign({}, tooltip), { pos: tr.changes.mapPos(tooltip.pos) }); | ||
return tr.effects.reduce((t, e) => e.is(setLintGutterTooltip) ? e.value : t, tooltip); | ||
@@ -669,0 +672,0 @@ }, |
{ | ||
"name": "@codemirror/lint", | ||
"version": "0.20.0", | ||
"version": "0.20.1", | ||
"description": "Linting support for the CodeMirror code editor", | ||
@@ -30,3 +30,3 @@ "scripts": { | ||
"@codemirror/state": "^0.20.0", | ||
"@codemirror/view": "^0.20.0", | ||
"@codemirror/view": "^0.20.2", | ||
"crelt": "^1.0.5" | ||
@@ -33,0 +33,0 @@ }, |
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
64065
1541
Updated@codemirror/view@^0.20.2