From 2ae5cacc6ffef82b32bda4a9b01c9d399d0b4063 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 2 Apr 2013 13:25:21 -0700 Subject: [PATCH 1/4] Un-f project spec --- spec/app/project-spec.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/app/project-spec.coffee b/spec/app/project-spec.coffee index cc3d3879e..c7b420650 100644 --- a/spec/app/project-spec.coffee +++ b/spec/app/project-spec.coffee @@ -188,7 +188,7 @@ describe "Project", -> runs -> expect(paths).not.toContain('ignored/ignored.txt') - fdescribe ".scan(options, callback)", -> + describe ".scan(options, callback)", -> describe "when called with a regex", -> it "calls the callback with all regex matches in all files in the project", -> matches = [] From d64c3e773de9ca33f11c4775259f3a762a6ea62e Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 2 Apr 2013 13:30:39 -0700 Subject: [PATCH 2/4] :lipstick: --- .../lib/commands/select-all-matches-in-project.coffee | 2 +- src/packages/command-panel/lib/preview-list.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/packages/command-panel/lib/commands/select-all-matches-in-project.coffee b/src/packages/command-panel/lib/commands/select-all-matches-in-project.coffee index 20df613a3..6cf583596 100644 --- a/src/packages/command-panel/lib/commands/select-all-matches-in-project.coffee +++ b/src/packages/command-panel/lib/commands/select-all-matches-in-project.coffee @@ -22,4 +22,4 @@ class SelectAllMatchesInProject extends Command )) promise.done -> deferred.resolve(operations) - deferred.promise() \ No newline at end of file + deferred.promise() diff --git a/src/packages/command-panel/lib/preview-list.coffee b/src/packages/command-panel/lib/preview-list.coffee index 49cb95835..58cb0f799 100644 --- a/src/packages/command-panel/lib/preview-list.coffee +++ b/src/packages/command-panel/lib/preview-list.coffee @@ -56,7 +56,7 @@ class PreviewList extends ScrollView pathView.addOperation(operation) @lastRenderedOperationIndex++ break if not renderAll and @prop('scrollHeight') >= startingScrollHeight + @pixelOverdraw and @prop('scrollHeight') > @height() + @pixelOverdraw - + pathViewForPath: (path) -> pathView = @viewsForPath[path] if not pathView From d2f2011ea3ea08fb54a8681f8946942ad91bea42 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 2 Apr 2013 13:50:48 -0700 Subject: [PATCH 3/4] Skip leading space after colon in nak output This was causing a spec to fail since the line text now had a leading space for all results since the separator before the line text is now ': ' instead of just ':'. --- src/app/project.coffee | 6 +++--- src/packages/command-panel/lib/operation.coffee | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/project.coffee b/src/app/project.coffee index 3c10f744a..e2ad125d3 100644 --- a/src/app/project.coffee +++ b/src/app/project.coffee @@ -164,9 +164,9 @@ class Project state = 'readingPath' path = null else - colonIndex = line.indexOf(':') + colonIndex = line.indexOf(': ') matchInfo = line.substring(0, colonIndex) - lineText = line.substring(colonIndex + 1) + lineText = line.substring(colonIndex + 2) readMatches(matchInfo, lineText) readMatches = (matchInfo, lineText) -> @@ -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() diff --git a/src/packages/command-panel/lib/operation.coffee b/src/packages/command-panel/lib/operation.coffee index f9b22973c..af963d8ca 100644 --- a/src/packages/command-panel/lib/operation.coffee +++ b/src/packages/command-panel/lib/operation.coffee @@ -24,9 +24,9 @@ class Operation preview: -> range = @bufferRange - prefix = @lineText[0...range.start.column + 1] - match = @lineText[range.start.column + 1...range.end.column + 1] - suffix = @lineText[range.end.column + 1..] + prefix = @lineText[0...range.start.column] + match = @lineText[range.start.column...range.end.column] + suffix = @lineText[range.end.column..] {prefix, suffix, match, range} From 9b19b4512f39d6b29ccdb414dbce8a11e3f4eef2 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 2 Apr 2013 13:53:49 -0700 Subject: [PATCH 4/4] Use getBufferRange() when previewing This is for the case where the marker may move between construction and previewing. --- src/packages/command-panel/lib/operation.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packages/command-panel/lib/operation.coffee b/src/packages/command-panel/lib/operation.coffee index af963d8ca..3dc17b29e 100644 --- a/src/packages/command-panel/lib/operation.coffee +++ b/src/packages/command-panel/lib/operation.coffee @@ -23,7 +23,7 @@ class Operation @getBufferRange() unless @preserveSelection preview: -> - range = @bufferRange + range = @getBufferRange() prefix = @lineText[0...range.start.column] match = @lineText[range.start.column...range.end.column] suffix = @lineText[range.end.column..]