Stylize command panel preview

This commit is contained in:
Corey Johnson
2012-07-18 09:22:32 -07:00
parent 86b0fee4f1
commit 52d60df272
4 changed files with 22 additions and 8 deletions

View File

@@ -18,7 +18,12 @@ class Operation
preview: ->
range = @anchorRange.getBufferRange()
@buffer.getTextInRange(range)
line = @buffer.lineForRow(range.start.row)
prefix = line[0...range.start.column]
match = line[range.start.column...range.end.column]
suffix = line[range.end.column..]
{prefix, suffix, match}
destroy: ->
@buffer.release()

View File

@@ -3,7 +3,13 @@
module.exports =
class PreviewItem extends View
@content: (operation) ->
{prefix, suffix, match} = operation.preview()
@li =>
@span operation.getPath(), outlet: "path", class: "path"
@span operation.preview(), outlet: "preview", class: "preview"
@span outlet: "preview", class: "preview", =>
@span prefix
@span match, class: 'match'
@span suffix