@codemirror/text
Advanced tools
Comparing version 0.18.1 to 0.19.0
@@ -0,1 +1,7 @@ | ||
## 0.19.0 (2021-08-11) | ||
### Breaking changes | ||
`countColumn` now takes different arguments. | ||
## 0.18.1 (2021-07-06) | ||
@@ -2,0 +8,0 @@ |
@@ -33,3 +33,3 @@ /** | ||
*/ | ||
declare function countColumn(string: string, n: number, tabSize: number): number; | ||
declare function countColumn(string: string, tabSize: number, to?: number): number; | ||
/** | ||
@@ -36,0 +36,0 @@ Find the offset that corresponds to the given column position in a |
@@ -110,4 +110,5 @@ // Compressed representation of the Grapheme_Cluster_Break=Extend | ||
*/ | ||
function countColumn(string, n, tabSize) { | ||
for (let i = 0; i < string.length;) { | ||
function countColumn(string, tabSize, to = string.length) { | ||
let n = 0; | ||
for (let i = 0; i < to;) { | ||
if (string.charCodeAt(i) == 9) { | ||
@@ -129,7 +130,2 @@ n += tabSize - (n % tabSize); | ||
function findColumn(string, col, tabSize) { | ||
let _compat = arguments[3]; | ||
if (_compat != null) { | ||
col = tabSize; | ||
tabSize = _compat; | ||
} // FIXME remove at next major version | ||
for (let i = 0, n = 0; i < string.length;) { | ||
@@ -136,0 +132,0 @@ if (n >= col) |
{ | ||
"name": "@codemirror/text", | ||
"version": "0.18.1", | ||
"version": "0.19.0", | ||
"description": "Document data structure 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
56016
1400