PreviewItem displays matched text

This commit is contained in:
Corey Johnson
2012-07-17 20:12:57 -07:00
parent bd9cbde54c
commit a5032e3811
3 changed files with 19 additions and 3 deletions

View File

@@ -17,7 +17,8 @@ class Operation
editSession.addSelectionForBufferRange(@getBufferRange()) unless @preserveSelection
preview: ->
"sad :-("
range = @anchorRange.getBufferRange()
@buffer.textInRange(range)
destroy: ->
@buffer.release()

View File

@@ -4,5 +4,6 @@ module.exports =
class PreviewItem extends View
@content: (operation) ->
@li =>
@span operation.getPath()
@span operation.preview()
@span operation.getPath(), outlet: "path", class: "path"
@span outlet: "preview", class: "preview", ->
operation.preview()

View File

@@ -11,6 +11,20 @@
overflow: auto;
}
.command-panel .preview-list .path{
padding-left: 1em;
color: red;
}
.command-panel .preview-list .preview {
padding-left: 1em;
color: green;
}
.command-panel .preview-list .preview .match{
font-weight: bold;
}
.command-panel .prompt-and-editor {
display: -webkit-box;
}