From 7f8e2aba1b15ced53121b2aadca055be6bca6259 Mon Sep 17 00:00:00 2001 From: Garen Torikian Date: Sun, 31 Mar 2013 00:22:27 -0700 Subject: [PATCH] Stash changes --- src/app/project.coffee | 4 ++-- src/packages/command-panel/lib/command-panel-view.coffee | 1 + src/packages/command-panel/lib/operation.coffee | 2 +- src/packages/command-panel/lib/preview-list.coffee | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/project.coffee b/src/app/project.coffee index 6c5ad78c6..dea39f3c1 100644 --- a/src/app/project.coffee +++ b/src/app/project.coffee @@ -176,7 +176,7 @@ class Project for [column, length] in matchPositions range = new Range([row, column], [row, column + length]) - match = lineText.substr(column + 1, length) + match = lineText.substr(column , length) iterator({path, range, match, lineText}) deferred = $.Deferred() @@ -192,7 +192,7 @@ class Project readPath(line) if state is 'readingPath' readLine(line) if state is 'readingLines' - command = require.resolve 'nak' + command = require.resolve('nak') args = ['--ackmate', regex.source, @getPath()] args.unshift("--addVCSIgnores") if config.get('nak.addVCSIgnores') new BufferedProcess({command, args, stdout, exit}) diff --git a/src/packages/command-panel/lib/command-panel-view.coffee b/src/packages/command-panel/lib/command-panel-view.coffee index 311b5b7f2..7893f1145 100644 --- a/src/packages/command-panel/lib/command-panel-view.coffee +++ b/src/packages/command-panel/lib/command-panel-view.coffee @@ -144,6 +144,7 @@ class CommandPanelView extends View @errorMessages.append $$ -> @li errorMessage for errorMessage in errorMessages else if operationsToPreview?.length + @previewList.show() @previewList.focus() @previewCount.text("#{_.pluralize(operationsToPreview.length, 'match', 'matches')} in #{_.pluralize(@previewList.getPathCount(operationsToPreview), 'file')}").show() else diff --git a/src/packages/command-panel/lib/operation.coffee b/src/packages/command-panel/lib/operation.coffee index c0adac184..af963d8ca 100644 --- a/src/packages/command-panel/lib/operation.coffee +++ b/src/packages/command-panel/lib/operation.coffee @@ -25,7 +25,7 @@ class Operation preview: -> range = @bufferRange prefix = @lineText[0...range.start.column] - match = @lineText[range.start.column + 1...range.end.column] + match = @lineText[range.start.column...range.end.column] suffix = @lineText[range.end.column..] {prefix, suffix, match, range} diff --git a/src/packages/command-panel/lib/preview-list.coffee b/src/packages/command-panel/lib/preview-list.coffee index cf700af2d..101eb99ae 100644 --- a/src/packages/command-panel/lib/preview-list.coffee +++ b/src/packages/command-panel/lib/preview-list.coffee @@ -49,7 +49,7 @@ class PreviewList extends ScrollView populateSingle: (operation) -> @viewsForPath ||= {} - @show() + @lastRenderedOperationIndex ||= 0 @renderOperation(operation) @find('.operation:first').addClass('selected') @@ -67,6 +67,7 @@ class PreviewList extends ScrollView startingScrollHeight = @prop('scrollHeight') pathView = @pathViewForPath(operation.getPath()) pathView.addOperation(operation) + @lastRenderedOperationIndex++ pathViewForPath: (path) -> pathView = @viewsForPath[path]