Skip to content

Commit 267b73a

Browse files
committed
dispatch/gc colorings of inline highlights
1 parent eed601d commit 267b73a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lib/editor/highlights.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ module.exports =
2626

2727
profileLines: (ls) ->
2828
markers = []
29-
watch = @observeLines ls, (ed, {line, count}) =>
29+
watch = @observeLines ls, (ed, {line, count, classes}) =>
3030
m = ed.markBufferRange [[line, 0], [line, 1+Math.round(count*ed.preferredLineLength)]],
3131
invalidate: 'touch'
3232
markers.push m
3333
ed.decorateMarker m,
3434
type: 'highlight'
35-
class: 'ink-profile-line'
35+
class: "ink-profile-line #{classes.join(' ')}"
3636
destroy: =>
3737
watch.dispose()
3838
m.destroy() for m in markers

lib/plots/canopy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export class Pannable extends Etch {
214214

215215
class NodeView extends Etch {
216216
render() {
217-
let {height, width, top, left, onclick, classes, onmouseover, onmouseout} = this.props;
217+
const {height, width, top, left, onclick, classes, onmouseover, onmouseout} = this.props;
218218
return <Clickable onclick={onclick}><div className={`node ${classes.join(' ')}`} {...{onmouseover, onmouseout}} style={{
219219
height: 100*height+'%',
220220
width: 100*width +'%',
@@ -229,8 +229,8 @@ class NodeView extends Etch {
229229
export default class Canopy extends Etch {
230230
update({data, className}) {}
231231
render() {
232-
let nodes = []
233-
let className = this.props.className || ''
232+
const nodes = []
233+
const className = this.props.className || ''
234234
prefor(dims(this.props.data), node => nodes.push(<NodeView {...node} />))
235235
return <div className={"ink-canopy " + className}>
236236
{nodes}

lib/plots/profiler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ function process (view, tree) {
2929

3030
function flatten (tree) {
3131
const cache = {}
32-
prefor(tree, ({path, line, count}) => {
32+
prefor(tree, ({path, line, count, classes}) => {
3333
const key = JSON.stringify([path, line])
3434
let val = cache[key]
35-
if (!val) val = cache[key] = {file: path, line: line-1, count: 0}
35+
if (!val) val = cache[key] = {file: path, line: line-1, count: 0, classes}
3636
val.count += count
3737
})
3838

0 commit comments

Comments
 (0)