Skip to content

Commit 6f9fa72

Browse files
authored
Merge pull request #260 from JunoLab/sp/profilerlines
only show profile lines in ed line range
2 parents d202bdd + 5ddb45f commit 6f9fa72

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/editor/highlights.coffee

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@ module.exports =
2929
v.classList.add('ink-profile-line')
3030
v.classList.add(cl) for cl in classes
3131

32-
v.style.width = count*ed.preferredLineLength*ed.defaultCharWidth + 'px'
32+
# can't use ed.defaultCharWidth here because that sometimes seems to be 0
33+
v.style.width = 0.1 + count*ed.preferredLineLength + 'em'
3334
v
3435

3536
profileLines: (ls) ->
3637
markers = []
3738
watch = @observeLines ls, (ed, {line, count, classes}) =>
39+
if line < 0 || line > ed.getLineCount()
40+
return
3841
m = ed.markBufferRange [[line, 0], [line, 0]],
3942
invalidate: 'never'
4043
markers.push m

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"repository": "https://github.com/JunoLab/atom-ink",
1212
"license": "MIT",
1313
"engines": {
14-
"atom": ">=1.12.0 <2.0.0"
14+
"atom": ">=1.39.0 <2.0.0"
1515
},
1616
"dependencies": {
1717
"ansi_up": "^3.0.0",

0 commit comments

Comments
 (0)