diff --git a/src/packages/command-panel/spec/command-panel-spec.coffee b/src/packages/command-panel/spec/command-panel-spec.coffee index 557b21444..635613912 100644 --- a/src/packages/command-panel/spec/command-panel-spec.coffee +++ b/src/packages/command-panel/spec/command-panel-spec.coffee @@ -299,7 +299,7 @@ describe "CommandPanel", -> expect(commandPanel.previewList).toBeVisible() expect(commandPanel.previewList).toMatchSelector ':focus' previewItem = commandPanel.previewList.find("li:contains(sample.js):first") - expect(previewItem.text()).toBe "sample.js" + expect(previewItem.text()).toBe "sample.js(1)" expect(previewItem.next().find('.preview').text()).toBe "var quicksort = function () {" expect(previewItem.next().find('.preview > .match').text()).toBe "quicksort" diff --git a/src/packages/command-panel/src/preview-list.coffee b/src/packages/command-panel/src/preview-list.coffee index 0fd4541e1..34cbd240c 100644 --- a/src/packages/command-panel/src/preview-list.coffee +++ b/src/packages/command-panel/src/preview-list.coffee @@ -34,7 +34,9 @@ class PreviewList extends ScrollView operation.index = index for operation, index in operations operationsByPath = _.groupBy(operations, (operation) -> operation.getPath()) for path, ops of operationsByPath - @li path, class: 'path' + @li class: 'path', => + @span path + @span "(#{ops.length})", class: 'path-match-number' for operation in ops {prefix, suffix, match, range} = operation.preview() @li 'data-index': operation.index, class: 'operation', => diff --git a/themes/Atom - Dark/command-panel.css b/themes/Atom - Dark/command-panel.css index 116bb2baf..dfc7f225b 100644 --- a/themes/Atom - Dark/command-panel.css +++ b/themes/Atom - Dark/command-panel.css @@ -60,6 +60,11 @@ display: inline-block; } +.command-panel .preview-list .path-match-number { + padding-left: 8px; + color: rgba(255, 255, 255, .3); +} + .command-panel .preview-list .preview { word-break: break-all; } diff --git a/themes/Atom - Light/command-panel.css b/themes/Atom - Light/command-panel.css index f9e15c3af..4bfff1d22 100644 --- a/themes/Atom - Light/command-panel.css +++ b/themes/Atom - Light/command-panel.css @@ -57,6 +57,11 @@ display: inline-block; } +.command-panel .preview-list .path-match-number { + padding-left: 8px; + color: #3D5075; +} + .command-panel .preview-list .preview { word-break: break-all; }