Rename config setting
MODIFY
lib/find.coffee
lib/find.coffee
@@ -11,9 +11,9 @@ ProjectFindView = require './project-find-view'
ResultsModel = require './project/results-model'
ResultsPaneView = require './project/results-pane'
-# To convert previous (and now unused) config setting "openProjectFindResultsInRightPane"
+# Convert old config setting for backward compatibility.
if atom.config.get('find-and-replace.openProjectFindResultsInRightPane')
- atom.config.set('find-and-replace.openProjectFindResultsDirection', 'right')
+ atom.config.set('find-and-replace.projectSearchResultsPaneSplitDirection', 'right')
atom.config.unset('find-and-replace.openProjectFindResultsInRightPane')
module.exports =

MODIFY
lib/project-find-view.coffee
lib/project-find-view.coffee
@@ -302,7 +302,7 @@ class ProjectFindView extends View
showResultPane: ->
options = {searchAllPanes: true}
- openDirection = atom.config.get('find-and-replace.openProjectFindResultsDirection')
+ openDirection = atom.config.get('find-and-replace.projectSearchResultsPaneSplitDirection')
options.split = openDirection unless openDirection is 'none'
atom.workspace.open(ResultsPaneView.URI, options)

MODIFY
lib/project/match-view.coffee
lib/project/match-view.coffee
@@ -48,7 +48,7 @@ class MatchView extends View
right: 'left'
up: 'down'
down: 'up'
- openDirection = atom.config.get('find-and-replace.openProjectFindResultsDirection')
+ openDirection = atom.config.get('find-and-replace.projectSearchResultsPaneSplitDirection')
options.split = reverseDirections[openDirection] unless openDirection is 'none'
editorPromise = atom.workspace.open(@filePath, options)
editorPromise.then (editor) =>

MODIFY
package.json
package.json
"default": false,
"description": "Focus the editor and select the next match when a file search is executed. If no matches are found, the editor will not be focused."
},
- "openProjectFindResultsDirection": {
+ "projectSearchResultsPaneSplitDirection": {
"type": "string",
"default": "none",
"enum": ["none", "right", "down"],
"title": "Direction to open results pane",
- "description": "When a project-wide search is executed, open the results in a split pane instead of a tab in the same pane."
+ "description": "Direction to split the active pane when showing project search results. If 'none', the results will be shown in the active pane."
},
"closeFindPanelAfterSearch": {
"type": "boolean",

MODIFY
spec/project-find-view-spec.coffee
spec/project-find-view-spec.coffee
@@ -28,7 +28,7 @@ describe 'ProjectFindView', ->
atom.project.setPaths([path.join(__dirname, 'fixtures')])
jasmine.attachToDOM(workspaceElement)
- atom.config.set('find-and-replace.openProjectFindResultsDirection', 'none')
+ atom.config.set('find-and-replace.projectSearchResultsPaneSplitDirection', 'none')
activationPromise = atom.packages.activatePackage("find-and-replace").then (options) ->
mainModule = options.mainModule
mainModule.createViews()
@@ -368,7 +368,7 @@ describe 'ProjectFindView', ->
it "splits when option is right", ->
initialPane = atom.workspace.getActivePane()
- atom.config.set('find-and-replace.openProjectFindResultsDirection', 'right')
+ atom.config.set('find-and-replace.projectSearchResultsPaneSplitDirection', 'right')
projectFindView.findEditor.setText('items')
atom.commands.dispatch(projectFindView[0], 'core:confirm')
@@ -381,7 +381,7 @@ describe 'ProjectFindView', ->
it "splits when option is bottom", ->
initialPane = atom.workspace.getActivePane()
- atom.config.set('find-and-replace.openProjectFindResultsDirection', 'down')
+ atom.config.set('find-and-replace.projectSearchResultsPaneSplitDirection', 'down')
projectFindView.findEditor.setText('items')
atom.commands.dispatch(projectFindView[0], 'core:confirm')
@@ -405,7 +405,7 @@ describe 'ProjectFindView', ->
expect(pane1).toBe initialPane
it "can be duplicated on the right", ->
- atom.config.set('find-and-replace.openProjectFindResultsDirection', 'right')
+ atom.config.set('find-and-replace.projectSearchResultsPaneSplitDirection', 'right')
projectFindView.findEditor.setText('items')
atom.commands.dispatch(projectFindView[0], 'core:confirm')
@@ -430,7 +430,7 @@ describe 'ProjectFindView', ->
expect(resultsPaneView2.querySelector('.preview-count').innerHTML).toEqual resultsPaneView1.querySelector('.preview-count').innerHTML
it "can be duplicated at the bottom", ->
- atom.config.set('find-and-replace.openProjectFindResultsDirection', 'down')
+ atom.config.set('find-and-replace.projectSearchResultsPaneSplitDirection', 'down')
projectFindView.findEditor.setText('items')
atom.commands.dispatch(projectFindView[0], 'core:confirm')
@@ -1452,7 +1452,7 @@ describe 'ProjectFindView', ->
describe "panel opening", ->
describe "when a panel is already open on the right", ->
beforeEach ->
- atom.config.set('find-and-replace.openProjectFindResultsDirection', 'right')
+ atom.config.set('find-and-replace.projectSearchResultsPaneSplitDirection', 'right')
waitsForPromise ->
atom.workspace.open('sample.js')
@@ -1485,7 +1485,7 @@ describe 'ProjectFindView', ->
describe "when a panel is already open at the bottom", ->
beforeEach ->
- atom.config.set('find-and-replace.openProjectFindResultsDirection', 'down')
+ atom.config.set('find-and-replace.projectSearchResultsPaneSplitDirection', 'down')
waitsForPromise ->
atom.workspace.open('sample.js')

MODIFY
spec/results-view-spec.coffee
spec/results-view-spec.coffee
@@ -441,9 +441,9 @@ describe 'ResultsView', ->
runs ->
expect(atom.views.getView(editor)).toHaveFocus()
- describe "when `openProjectFindResultsDirection` option is none", ->
+ describe "when `projectSearchResultsPaneSplitDirection` option is none", ->
beforeEach ->
- atom.config.set('find-and-replace.openProjectFindResultsDirection', 'none')
+ atom.config.set('find-and-replace.projectSearchResultsPaneSplitDirection', 'none')
it "does not specify a pane to split", ->
spyOn(atom.workspace, 'open').andCallThrough()
@@ -451,9 +451,9 @@ describe 'ResultsView', ->
atom.commands.dispatch resultsView.element, 'core:confirm'
expect(atom.workspace.open.mostRecentCall.args[1]).toEqual {}
- describe "when `openProjectFindResultsDirection` option is right", ->
+ describe "when `projectSearchResultsPaneSplitDirection` option is right", ->
beforeEach ->
- atom.config.set('find-and-replace.openProjectFindResultsDirection', 'right')
+ atom.config.set('find-and-replace.projectSearchResultsPaneSplitDirection', 'right')
it "always opens the file in the left pane", ->
spyOn(atom.workspace, 'open').andCallThrough()
@@ -474,9 +474,9 @@ describe 'ResultsView', ->
runs ->
expect(atom.views.getView(editor)).toHaveFocus()
- describe "when `openProjectFindResultsDirection` option is down", ->
+ describe "when `projectSearchResultsPaneSplitDirection` option is down", ->
beforeEach ->
- atom.config.set('find-and-replace.openProjectFindResultsDirection', 'down')
+ atom.config.set('find-and-replace.projectSearchResultsPaneSplitDirection', 'down')
it "always opens the file in the up pane", ->
spyOn(atom.workspace, 'open').andCallThrough()

Rename config setting