File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed
Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 33let { fileURLToPath, pathToFileURL } = require ( 'url' )
44let { resolve, isAbsolute } = require ( 'path' )
55let { nanoid } = require ( 'nanoid/non-secure' )
6- let lineColumn = require ( 'line-column ' )
6+ let vfileLocation = require ( 'vfile-location ' )
77
88let terminalHighlight = require ( './terminal-highlight' )
99let CssSyntaxError = require ( './css-syntax-error' )
@@ -50,8 +50,14 @@ class Input {
5050 }
5151
5252 fromOffset ( offset ) {
53- let finder = lineColumn ( this . css )
54- this . fromOffset = i => finder . fromIndex ( i )
53+ let finder = vfileLocation ( this . css )
54+ this . fromOffset = i => {
55+ let position = finder . toPoint ( i )
56+ return {
57+ line : position . line ,
58+ col : position . column
59+ }
60+ }
5561 return this . fromOffset ( offset )
5662 }
5763
Original file line number Diff line number Diff line change 3939 "repository" : " postcss/postcss" ,
4040 "dependencies" : {
4141 "colorette" : " ^1.2.1" ,
42- "line-column" : " ^1.0.2" ,
4342 "nanoid" : " ^3.1.16" ,
44- "source-map" : " ^0.6.1"
43+ "source-map" : " ^0.6.1" ,
44+ "vfile-location" : " ^3.2.0"
4545 },
4646 "devDependencies" : {
4747 "@logux/eslint-config" : " ^42.2.2" ,
Original file line number Diff line number Diff line change @@ -11037,6 +11037,11 @@ vfile-location@^2.0.0:
1103711037 resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-2.0.6.tgz#8a274f39411b8719ea5728802e10d9e0dff1519e"
1103811038 integrity sha512-sSFdyCP3G6Ka0CEmN83A2YCMKIieHx0EDaj5IDP4g1pa5ZJ4FJDvpO0WODLxo4LUX4oe52gmSCK7Jw4SBghqxA==
1103911039
11040+ vfile-location@^3.2.0 :
11041+ version "3.2.0"
11042+ resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-3.2.0.tgz#d8e41fbcbd406063669ebf6c33d56ae8721d0f3c"
11043+ integrity sha512-aLEIZKv/oxuCDZ8lkJGhuhztf/BW4M+iHdCwglA/eWc+vtuRFJj8EtgceYFX4LRjOhCAAiNHsKGssC6onJ+jbA==
11044+
1104011045vfile-message@^1.0.0 :
1104111046 version "1.1.1"
1104211047 resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-1.1.1.tgz#5833ae078a1dfa2d96e9647886cd32993ab313e1"
You can’t perform that action at this time.
0 commit comments