mirror of
https://github.com/atom/atom.git
synced 2026-02-05 12:15:07 -05:00
Merge remote-tracking branch 'origin/master' into vim-core-changes
Conflicts: src/app/text-buffer.coffee
This commit is contained in:
@@ -144,7 +144,7 @@ class AutocompleteView extends SelectList
|
||||
lineRange = [[selectionRange.start.row, 0], [selectionRange.end.row, @editor.lineLengthForBufferRow(selectionRange.end.row)]]
|
||||
[prefix, suffix] = ["", ""]
|
||||
|
||||
@currentBuffer.scanInRange @wordRegex, lineRange, (match, range, {stop}) ->
|
||||
@currentBuffer.scanInRange @wordRegex, lineRange, ({match, range, stop}) ->
|
||||
stop() if range.start.isGreaterThan(selectionRange.end)
|
||||
|
||||
if range.intersectsWith(selectionRange)
|
||||
|
||||
@@ -122,7 +122,7 @@ module.exports =
|
||||
regex = new RegExp("[#{_.escapeRegExp(startPair + endPair)}]", 'g')
|
||||
endPairPosition = null
|
||||
unpairedCount = 0
|
||||
buffer.scanInRange regex, scanRange, (match, range, {stop}) =>
|
||||
buffer.scanInRange regex, scanRange, ({match, range, stop}) =>
|
||||
if match[0] is startPair
|
||||
unpairedCount++
|
||||
else if match[0] is endPair
|
||||
@@ -136,14 +136,13 @@ module.exports =
|
||||
regex = new RegExp("[#{_.escapeRegExp(startPair + endPair)}]", 'g')
|
||||
startPairPosition = null
|
||||
unpairedCount = 0
|
||||
scanner = (match, range, {stop}) =>
|
||||
buffer.backwardsScanInRange regex, scanRange, ({match, range, stop}) =>
|
||||
if match[0] is endPair
|
||||
unpairedCount++
|
||||
else if match[0] is startPair
|
||||
unpairedCount--
|
||||
startPairPosition = range.start
|
||||
stop() if unpairedCount < 0
|
||||
buffer.scanInRange(regex, scanRange, scanner, true)
|
||||
startPairPosition
|
||||
|
||||
updateMatch: (editor) ->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
fs = require 'fs-utils'
|
||||
fsUtils = require 'fs-utils'
|
||||
PEG = require 'pegjs'
|
||||
|
||||
module.exports =
|
||||
@@ -6,7 +6,7 @@ class CommandInterpreter
|
||||
constructor: (@project) ->
|
||||
|
||||
eval: (string, activeEditSession) ->
|
||||
@parser ?= PEG.buildParser(fs.read(require.resolve 'command-panel/lib/commands.pegjs'))
|
||||
@parser ?= PEG.buildParser(fsUtils.read(require.resolve 'command-panel/lib/commands.pegjs'))
|
||||
compositeCommand = @parser.parse(string)
|
||||
@lastRelativeAddress = compositeCommand if compositeCommand.isRelativeAddress()
|
||||
compositeCommand.execute(@project, activeEditSession)
|
||||
|
||||
@@ -120,6 +120,8 @@ class CommandPanelView extends View
|
||||
|
||||
execute: (command=@escapedCommand()) ->
|
||||
@loadingMessage.show()
|
||||
@previewList.hide()
|
||||
@previewHeader.hide()
|
||||
@errorMessages.empty()
|
||||
|
||||
try
|
||||
|
||||
@@ -24,12 +24,12 @@ class RegexAddress extends Address
|
||||
|
||||
rangeToReturn = null
|
||||
scanMethodName = if @isReversed then "backwardsScanInRange" else "scanInRange"
|
||||
buffer[scanMethodName] @regex, rangeToSearch, (match, range) ->
|
||||
buffer[scanMethodName] @regex, rangeToSearch, ({range}) ->
|
||||
rangeToReturn = range
|
||||
|
||||
if not rangeToReturn
|
||||
rangeToSearch = if @isReversed then rangeAfter else rangeBefore
|
||||
buffer[scanMethodName] @regex, rangeToSearch, (match, range) ->
|
||||
buffer[scanMethodName] @regex, rangeToSearch, ({range}) ->
|
||||
rangeToReturn = range
|
||||
|
||||
if not rangeToReturn
|
||||
|
||||
@@ -8,7 +8,7 @@ class SelectAllMatchesInProject extends Command
|
||||
previewOperations: true
|
||||
|
||||
constructor: (pattern) ->
|
||||
@regex = new RegExp(pattern, 'g')
|
||||
@regex = new RegExp(pattern)
|
||||
|
||||
compile: (project, buffer, range) ->
|
||||
deferred = $.Deferred()
|
||||
|
||||
@@ -12,12 +12,12 @@ class SelectAllMatches extends Command
|
||||
compile: (project, buffer, ranges) ->
|
||||
deferred = $.Deferred()
|
||||
operations = []
|
||||
for range in ranges
|
||||
buffer.scanInRange @regex, range, (match, matchRange) ->
|
||||
for scanRange in ranges
|
||||
buffer.scanInRange @regex, scanRange, ({range}) ->
|
||||
operations.push(new Operation(
|
||||
project: project
|
||||
buffer: buffer
|
||||
bufferRange: matchRange
|
||||
bufferRange: range
|
||||
))
|
||||
deferred.resolve(operations)
|
||||
deferred.promise()
|
||||
|
||||
@@ -15,12 +15,12 @@ class Substitution extends Command
|
||||
compile: (project, buffer, ranges) ->
|
||||
deferred = $.Deferred()
|
||||
operations = []
|
||||
for range in ranges
|
||||
buffer.scanInRange @regex, range, (match, matchRange) =>
|
||||
for scanRange in ranges
|
||||
buffer.scanInRange @regex, scanRange, ({range}) =>
|
||||
operations.push(new Operation(
|
||||
project: project
|
||||
buffer: buffer
|
||||
bufferRange: matchRange
|
||||
bufferRange: range
|
||||
newText: @replacementText
|
||||
preserveSelection: true
|
||||
))
|
||||
|
||||
@@ -23,7 +23,7 @@ class Operation
|
||||
@getBufferRange() unless @preserveSelection
|
||||
|
||||
preview: ->
|
||||
range = @getBuffer().getMarkerRange(@getMarker())
|
||||
range = @getBufferRange()
|
||||
line = @getBuffer().lineForRow(range.start.row)
|
||||
prefix = line[0...range.start.column]
|
||||
match = line[range.start.column...range.end.column]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{View} = require 'space-pen'
|
||||
fs = require 'fs-utils'
|
||||
fsUtils = require 'fs-utils'
|
||||
OperationView = require './operation-view'
|
||||
$ = require 'jquery'
|
||||
|
||||
@@ -7,7 +7,7 @@ module.exports =
|
||||
class PathView extends View
|
||||
@content: ({path, previewList} = {}) ->
|
||||
classes = ['path']
|
||||
classes.push('readme') if fs.isReadmePath(path)
|
||||
classes.push('readme') if fsUtils.isReadmePath(path)
|
||||
@li class: classes.join(' '), =>
|
||||
@div outlet: 'pathDetails', class: 'path-details', =>
|
||||
@span class: 'path-name', path
|
||||
@@ -17,9 +17,11 @@ class PathView extends View
|
||||
initialize: ({@previewList}) ->
|
||||
@pathDetails.on 'mousedown', => @toggle(true)
|
||||
@subscribe @previewList, 'command-panel:collapse-result', =>
|
||||
@collapse(true) if @isSelected()
|
||||
if @isSelected()
|
||||
@collapse()
|
||||
@previewList.renderOperations()
|
||||
@subscribe @previewList, 'command-panel:expand-result', =>
|
||||
@expand(true) if @isSelected()
|
||||
@expand() if @isSelected()
|
||||
@subscribe @previewList, 'core:confirm', =>
|
||||
if @hasClass('selected')
|
||||
@toggle(true)
|
||||
@@ -36,30 +38,22 @@ class PathView extends View
|
||||
@previewList.find('.selected').removeClass('selected')
|
||||
@addClass('selected')
|
||||
|
||||
toggle: (animate) ->
|
||||
toggle: ->
|
||||
if @hasClass('is-collapsed')
|
||||
@expand(animate)
|
||||
@expand()
|
||||
else
|
||||
@collapse(animate)
|
||||
@collapse()
|
||||
|
||||
expand: (animate=false) ->
|
||||
if animate
|
||||
@matches.show 100, => @removeClass 'is-collapsed'
|
||||
else
|
||||
@matches.show()
|
||||
@removeClass 'is-collapsed'
|
||||
expand: ->
|
||||
@matches.show()
|
||||
@removeClass 'is-collapsed'
|
||||
|
||||
scrollTo: ->
|
||||
top = @previewList.scrollTop() + @offset().top - @previewList.offset().top
|
||||
bottom = top + @pathDetails.outerHeight()
|
||||
@previewList.scrollTo(top, bottom)
|
||||
|
||||
collapse: (animate=false) ->
|
||||
if animate
|
||||
@matches.hide 100, =>
|
||||
@addClass 'is-collapsed'
|
||||
@setSelected() if @isSelected()
|
||||
else
|
||||
@matches.hide()
|
||||
@addClass 'is-collapsed'
|
||||
@setSelected() if @isSelected()
|
||||
collapse: ->
|
||||
@matches.hide()
|
||||
@addClass 'is-collapsed'
|
||||
@setSelected() if @isSelected()
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
$ = require 'jquery'
|
||||
ScrollView = require 'scroll-view'
|
||||
_ = require 'underscore'
|
||||
fs = require 'fs-utils'
|
||||
PathView = require './path-view'
|
||||
OperationView = require './operation-view'
|
||||
|
||||
@@ -21,8 +20,7 @@ class PreviewList extends ScrollView
|
||||
@on 'core:move-down', => @selectNextOperation(); false
|
||||
@on 'core:move-up', => @selectPreviousOperation(); false
|
||||
@on 'scroll', =>
|
||||
@renderOperations() if @scrollBottom() >= (@prop('scrollHeight'))
|
||||
|
||||
@renderOperations() if @scrollBottom() >= @prop('scrollHeight')
|
||||
@command 'command-panel:collapse-all', => @collapseAllPaths()
|
||||
@command 'command-panel:expand-all', => @expandAllPaths()
|
||||
|
||||
@@ -114,6 +112,8 @@ class PreviewList extends ScrollView
|
||||
@scrollTop(top) if top < @scrollTop()
|
||||
|
||||
scrollToBottom: ->
|
||||
@renderOperations(renderAll: true)
|
||||
|
||||
super()
|
||||
|
||||
@find('.selected').removeClass('selected')
|
||||
|
||||
@@ -43,3 +43,25 @@ describe "Preview List", ->
|
||||
previousOperationCount = previewList.find("li").length
|
||||
previewList.collapseAllPaths()
|
||||
expect(previewList.find("li").length).toBeGreaterThan previousOperationCount
|
||||
|
||||
it "renders more operations when a preview item is collapsed", ->
|
||||
waitsForPromise ->
|
||||
commandPanelView.execute('X x/so/')
|
||||
|
||||
runs ->
|
||||
expect(previewList.prop('scrollHeight')).toBeGreaterThan previewList.height()
|
||||
previousScrollHeight = previewList.prop('scrollHeight')
|
||||
previousOperationCount = previewList.find("li").length
|
||||
previewList.trigger 'command-panel:collapse-result'
|
||||
expect(previewList.find("li").length).toBeGreaterThan previousOperationCount
|
||||
|
||||
it "renders all operations when core:move-to-bottom is triggered", ->
|
||||
waitsForPromise ->
|
||||
commandPanelView.execute('X x/so/')
|
||||
|
||||
runs ->
|
||||
expect(previewList.prop('scrollHeight')).toBeGreaterThan previewList.height()
|
||||
previousScrollHeight = previewList.prop('scrollHeight')
|
||||
previewList.trigger 'core:move-to-bottom'
|
||||
liCount = previewList.getPathCount() + previewList.getOperations().length
|
||||
expect(previewList.find("li").length).toBe liCount
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
SelectList = require 'select-list'
|
||||
_ = require 'underscore'
|
||||
$ = require 'jquery'
|
||||
fs = require 'fs-utils'
|
||||
fsUtils = require 'fs-utils'
|
||||
LoadPathsTask = require './load-paths-task'
|
||||
|
||||
module.exports =
|
||||
@@ -45,22 +45,22 @@ class FuzzyFinderView extends SelectList
|
||||
else if git.isStatusModified(status)
|
||||
@div class: 'status modified'
|
||||
|
||||
ext = fs.extension(path)
|
||||
if fs.isReadmePath(path)
|
||||
ext = fsUtils.extension(path)
|
||||
if fsUtils.isReadmePath(path)
|
||||
typeClass = 'readme-name'
|
||||
else if fs.isCompressedExtension(ext)
|
||||
else if fsUtils.isCompressedExtension(ext)
|
||||
typeClass = 'compressed-name'
|
||||
else if fs.isImageExtension(ext)
|
||||
else if fsUtils.isImageExtension(ext)
|
||||
typeClass = 'image-name'
|
||||
else if fs.isPdfExtension(ext)
|
||||
else if fsUtils.isPdfExtension(ext)
|
||||
typeClass = 'pdf-name'
|
||||
else if fs.isBinaryExtension(ext)
|
||||
else if fsUtils.isBinaryExtension(ext)
|
||||
typeClass = 'binary-name'
|
||||
else
|
||||
typeClass = 'text-name'
|
||||
|
||||
@span fs.base(path), class: "file label #{typeClass}"
|
||||
if folder = project.relativize(fs.directory(path))
|
||||
@span fsUtils.base(path), class: "file label #{typeClass}"
|
||||
if folder = project.relativize(fsUtils.directory(path))
|
||||
@span " - #{folder}/", class: 'directory'
|
||||
|
||||
openPath: (path) ->
|
||||
@@ -76,7 +76,7 @@ class FuzzyFinderView extends SelectList
|
||||
|
||||
confirmed : (path) ->
|
||||
return unless path.length
|
||||
if fs.isFile(path)
|
||||
if fsUtils.isFile(path)
|
||||
@cancel()
|
||||
@openPath(path)
|
||||
else
|
||||
@@ -134,7 +134,7 @@ class FuzzyFinderView extends SelectList
|
||||
|
||||
populateGitStatusPaths: ->
|
||||
paths = []
|
||||
paths.push(path) for path, status of git.statuses when fs.isFile(path)
|
||||
paths.push(path) for path, status of git.statuses when fsUtils.isFile(path)
|
||||
|
||||
@setArray(paths)
|
||||
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
_ = require 'underscore'
|
||||
fs = require 'fs-utils'
|
||||
BufferedProcess = require 'buffered-process'
|
||||
|
||||
module.exports =
|
||||
class LoadPathsTask
|
||||
aborted: false
|
||||
|
||||
constructor: (@callback) ->
|
||||
|
||||
start: ->
|
||||
rootPath = project.getPath()
|
||||
ignoredNames = config.get('fuzzyFinder.ignoredNames') ? []
|
||||
ignoredNames = ignoredNames.concat(config.get('core.ignoredNames') ? [])
|
||||
ignoreGitIgnoredFiles = config.get('core.hideGitIgnoredFiles')
|
||||
|
||||
command = require.resolve 'nak'
|
||||
args = ['--list', rootPath]
|
||||
args.unshift('--addVCSIgnores') if config.get('core.excludeVcsIgnoredPaths')
|
||||
args.unshift('--ignore', ignoredNames.join(',')) if ignoredNames.length > 0
|
||||
args.unshift('--follow')
|
||||
|
||||
paths = []
|
||||
isIgnored = (path) ->
|
||||
path = path.substring(rootPath.length + 1)
|
||||
for segment in path.split('/')
|
||||
return true if _.contains(ignoredNames, segment)
|
||||
ignoreGitIgnoredFiles and git?.isPathIgnored(fs.join(rootPath, path))
|
||||
onFile = (path) ->
|
||||
return if @aborted
|
||||
paths.push(path) unless isIgnored(path)
|
||||
onDirectory = (path) =>
|
||||
not @aborted and not isIgnored(path)
|
||||
onDone = =>
|
||||
@callback(paths) unless @aborted
|
||||
exit = (code) =>
|
||||
if code is 0
|
||||
@callback(paths)
|
||||
else
|
||||
@callback([])
|
||||
stdout = (data) ->
|
||||
paths.push(_.compact(data.split('\n'))...)
|
||||
|
||||
fs.traverseTree(rootPath, onFile, onDirectory, onDone)
|
||||
@process = new BufferedProcess({command, args, stdout, exit})
|
||||
|
||||
abort: ->
|
||||
@aborted = true
|
||||
if @process?
|
||||
@process.kill()
|
||||
@process = null
|
||||
|
||||
@@ -4,7 +4,7 @@ LoadPathsTask = require 'fuzzy-finder/lib/load-paths-task'
|
||||
_ = require 'underscore'
|
||||
$ = require 'jquery'
|
||||
{$$} = require 'space-pen'
|
||||
fs = require 'fs-utils'
|
||||
fsUtils = require 'fs-utils'
|
||||
|
||||
describe 'FuzzyFinder', ->
|
||||
[finderView] = []
|
||||
@@ -43,7 +43,6 @@ describe 'FuzzyFinder', ->
|
||||
it "shows all relative file paths for the current project and selects the first", ->
|
||||
rootView.attachToDom()
|
||||
finderView.maxItems = Infinity
|
||||
jasmine.unspy(window, "setTimeout")
|
||||
rootView.trigger 'fuzzy-finder:toggle-file-finder'
|
||||
paths = null
|
||||
expect(finderView.find(".loading")).toBeVisible()
|
||||
@@ -57,10 +56,21 @@ describe 'FuzzyFinder', ->
|
||||
runs ->
|
||||
expect(finderView.list.children('li').length).toBe paths.length
|
||||
for path in paths
|
||||
expect(finderView.list.find("li:contains(#{fs.base(path)})")).toExist()
|
||||
expect(finderView.list.find("li:contains(#{fsUtils.base(path)})")).toExist()
|
||||
expect(finderView.list.children().first()).toHaveClass 'selected'
|
||||
expect(finderView.find(".loading")).not.toBeVisible()
|
||||
|
||||
it "includes symlinked file paths", ->
|
||||
rootView.attachToDom()
|
||||
finderView.maxItems = Infinity
|
||||
rootView.trigger 'fuzzy-finder:toggle-file-finder'
|
||||
|
||||
waitsFor "all project paths to load", 5000, ->
|
||||
not finderView.reloadProjectPaths
|
||||
|
||||
runs ->
|
||||
expect(finderView.list.find("li:contains(symlink-to-file)")).toExist()
|
||||
|
||||
describe "when root view's project has no path", ->
|
||||
beforeEach ->
|
||||
project.setPath(null)
|
||||
@@ -218,16 +228,16 @@ describe 'FuzzyFinder', ->
|
||||
editor = rootView.getActiveView()
|
||||
originalText = editor.getText()
|
||||
originalPath = editor.getPath()
|
||||
fs.write(originalPath, 'making a change for the better')
|
||||
fsUtils.write(originalPath, 'making a change for the better')
|
||||
git.getPathStatus(originalPath)
|
||||
|
||||
newPath = project.resolve('newsample.js')
|
||||
fs.write(newPath, '')
|
||||
fsUtils.write(newPath, '')
|
||||
git.getPathStatus(newPath)
|
||||
|
||||
afterEach ->
|
||||
fs.write(originalPath, originalText)
|
||||
fs.remove(newPath) if fs.exists(newPath)
|
||||
fsUtils.write(originalPath, originalText)
|
||||
fsUtils.remove(newPath) if fsUtils.exists(newPath)
|
||||
|
||||
it "displays all new and modified paths", ->
|
||||
expect(rootView.find('.fuzzy-finder')).not.toExist()
|
||||
@@ -280,7 +290,6 @@ describe 'FuzzyFinder', ->
|
||||
describe "cached file paths", ->
|
||||
it "caches file paths after first time", ->
|
||||
spyOn(LoadPathsTask.prototype, "start").andCallThrough()
|
||||
jasmine.unspy(window, "setTimeout")
|
||||
rootView.trigger 'fuzzy-finder:toggle-file-finder'
|
||||
|
||||
waitsFor ->
|
||||
@@ -300,7 +309,6 @@ describe 'FuzzyFinder', ->
|
||||
|
||||
it "doesn't cache buffer paths", ->
|
||||
spyOn(project, "getEditSessions").andCallThrough()
|
||||
jasmine.unspy(window, "setTimeout")
|
||||
rootView.trigger 'fuzzy-finder:toggle-buffer-finder'
|
||||
|
||||
waitsFor ->
|
||||
@@ -320,7 +328,6 @@ describe 'FuzzyFinder', ->
|
||||
|
||||
it "busts the cache when the window gains focus", ->
|
||||
spyOn(LoadPathsTask.prototype, "start").andCallThrough()
|
||||
jasmine.unspy(window, "setTimeout")
|
||||
rootView.trigger 'fuzzy-finder:toggle-file-finder'
|
||||
|
||||
waitsFor ->
|
||||
@@ -337,7 +344,6 @@ describe 'FuzzyFinder', ->
|
||||
describe "path ignoring", ->
|
||||
it "ignores paths that match entries in config.fuzzyFinder.ignoredNames", ->
|
||||
config.set("fuzzyFinder.ignoredNames", ["tree-view.js"])
|
||||
jasmine.unspy(window, "setTimeout")
|
||||
rootView.trigger 'fuzzy-finder:toggle-file-finder'
|
||||
finderView.maxItems = Infinity
|
||||
|
||||
@@ -356,7 +362,6 @@ describe 'FuzzyFinder', ->
|
||||
|
||||
it "opens the fuzzy finder window when there are multiple matches", ->
|
||||
editor.setText("sample")
|
||||
jasmine.unspy(window, "setTimeout")
|
||||
rootView.trigger 'fuzzy-finder:find-under-cursor'
|
||||
|
||||
waitsFor ->
|
||||
@@ -368,7 +373,6 @@ describe 'FuzzyFinder', ->
|
||||
|
||||
it "opens a file directly when there is a single match", ->
|
||||
editor.setText("sample.txt")
|
||||
jasmine.unspy(window, "setTimeout")
|
||||
rootView.trigger 'fuzzy-finder:find-under-cursor'
|
||||
|
||||
openedPath = null
|
||||
@@ -386,7 +390,6 @@ describe 'FuzzyFinder', ->
|
||||
editor.setText("moogoogaipan")
|
||||
editor.setCursorBufferPosition([0,5])
|
||||
|
||||
jasmine.unspy(window, "setTimeout")
|
||||
rootView.trigger 'fuzzy-finder:find-under-cursor'
|
||||
|
||||
waitsFor ->
|
||||
@@ -468,11 +471,11 @@ describe 'FuzzyFinder', ->
|
||||
originalText = editor.getText()
|
||||
originalPath = editor.getPath()
|
||||
newPath = project.resolve('newsample.js')
|
||||
fs.write(newPath, '')
|
||||
fsUtils.write(newPath, '')
|
||||
|
||||
afterEach ->
|
||||
fs.write(originalPath, originalText)
|
||||
fs.remove(newPath) if fs.exists(newPath)
|
||||
fsUtils.write(originalPath, originalText)
|
||||
fsUtils.remove(newPath) if fsUtils.exists(newPath)
|
||||
|
||||
describe "when a modified file is shown in the list", ->
|
||||
it "displays the modified icon", ->
|
||||
|
||||
@@ -61,4 +61,4 @@ class GrammarSelector extends SelectList
|
||||
attach: ->
|
||||
super
|
||||
rootView.append(this)
|
||||
@miniEditor.focus()
|
||||
@miniEditor.focus()
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
fs = require 'fs-utils'
|
||||
$ = require 'jquery'
|
||||
ScrollView = require 'scroll-view'
|
||||
{$$$} = require 'space-pen'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Editor = require 'editor'
|
||||
$ = require 'jquery'
|
||||
_ = require 'underscore'
|
||||
fs = require 'fs-utils'
|
||||
fsUtils = require 'fs-utils'
|
||||
|
||||
module.exports =
|
||||
class PackageGeneratorView extends View
|
||||
@@ -24,7 +24,7 @@ class PackageGeneratorView extends View
|
||||
@previouslyFocusedElement = $(':focus')
|
||||
@message.text("Enter package path")
|
||||
placeholderName = "package-name"
|
||||
@miniEditor.setText(fs.join(config.userPackagesDirPath, placeholderName));
|
||||
@miniEditor.setText(fsUtils.join(config.userPackagesDirPath, placeholderName));
|
||||
pathLength = @miniEditor.getText().length
|
||||
@miniEditor.setSelectedBufferRange([[0, pathLength - placeholderName.length], [0, pathLength]])
|
||||
|
||||
@@ -44,11 +44,11 @@ class PackageGeneratorView extends View
|
||||
|
||||
getPackagePath: ->
|
||||
packagePath = @miniEditor.getText()
|
||||
packageName = _.dasherize(fs.base(packagePath))
|
||||
fs.join(fs.directory(packagePath), packageName)
|
||||
packageName = _.dasherize(fsUtils.base(packagePath))
|
||||
fsUtils.join(fsUtils.directory(packagePath), packageName)
|
||||
|
||||
validPackagePath: ->
|
||||
if fs.exists(@getPackagePath())
|
||||
if fsUtils.exists(@getPackagePath())
|
||||
@error.text("Path already exists at '#{@getPackagePath()}'")
|
||||
@error.show()
|
||||
false
|
||||
@@ -56,22 +56,22 @@ class PackageGeneratorView extends View
|
||||
true
|
||||
|
||||
createPackageFiles: ->
|
||||
templatePath = fs.resolveOnLoadPath(fs.join("package-generator", "template"))
|
||||
packageName = fs.base(@getPackagePath())
|
||||
templatePath = fsUtils.resolveOnLoadPath(fsUtils.join("package-generator", "template"))
|
||||
packageName = fsUtils.base(@getPackagePath())
|
||||
|
||||
for path in fs.listTree(templatePath)
|
||||
for path in fsUtils.listTree(templatePath)
|
||||
relativePath = path.replace(templatePath, "")
|
||||
relativePath = relativePath.replace(/^\//, '')
|
||||
relativePath = relativePath.replace(/\.template$/, '')
|
||||
relativePath = @replacePackageNamePlaceholders(relativePath, packageName)
|
||||
|
||||
sourcePath = fs.join(@getPackagePath(), relativePath)
|
||||
if fs.isDirectory(path)
|
||||
fs.makeTree(sourcePath)
|
||||
if fs.isFile(path)
|
||||
fs.makeTree(fs.directory(sourcePath))
|
||||
content = @replacePackageNamePlaceholders(fs.read(path), packageName)
|
||||
fs.write(sourcePath, content)
|
||||
sourcePath = fsUtils.join(@getPackagePath(), relativePath)
|
||||
if fsUtils.isDirectory(path)
|
||||
fsUtils.makeTree(sourcePath)
|
||||
if fsUtils.isFile(path)
|
||||
fsUtils.makeTree(fsUtils.directory(sourcePath))
|
||||
content = @replacePackageNamePlaceholders(fsUtils.read(path), packageName)
|
||||
fsUtils.write(sourcePath, content)
|
||||
|
||||
replacePackageNamePlaceholders: (string, packageName) ->
|
||||
placeholderRegex = /__(?:(package-name)|([pP]ackageName)|(package_name))__/g
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
RootView = require 'root-view'
|
||||
fs = require 'fs-utils'
|
||||
fsUtils = require 'fs-utils'
|
||||
|
||||
describe 'Package Generator', ->
|
||||
[packageGenerator] = []
|
||||
@@ -35,21 +35,21 @@ describe 'Package Generator', ->
|
||||
|
||||
packageName = "sweet-package-dude"
|
||||
packagePath = "/tmp/atom-packages/#{packageName}"
|
||||
fs.remove(packagePath) if fs.exists(packagePath)
|
||||
fsUtils.remove(packagePath) if fsUtils.exists(packagePath)
|
||||
|
||||
afterEach ->
|
||||
fs.remove(packagePath) if fs.exists(packagePath)
|
||||
fsUtils.remove(packagePath) if fsUtils.exists(packagePath)
|
||||
|
||||
it "forces the package's name to be lowercase with dashes", ->
|
||||
packageName = "CamelCaseIsForTheBirds"
|
||||
packagePath = fs.join(fs.directory(packagePath), packageName)
|
||||
packagePath = fsUtils.join(fsUtils.directory(packagePath), packageName)
|
||||
rootView.trigger("package-generator:generate")
|
||||
packageGeneratorView = rootView.find(".package-generator").view()
|
||||
packageGeneratorView.miniEditor.setText(packagePath)
|
||||
packageGeneratorView.trigger "core:confirm"
|
||||
|
||||
expect(packagePath).not.toExistOnDisk()
|
||||
expect(fs.join(fs.directory(packagePath), "camel-case-is-for-the-birds")).toExistOnDisk()
|
||||
expect(fsUtils.join(fsUtils.directory(packagePath), "camel-case-is-for-the-birds")).toExistOnDisk()
|
||||
|
||||
it "correctly lays out the package files and closes the package generator view", ->
|
||||
rootView.attachToDom()
|
||||
@@ -77,16 +77,16 @@ describe 'Package Generator', ->
|
||||
packageGeneratorView.miniEditor.setText(packagePath)
|
||||
packageGeneratorView.trigger "core:confirm"
|
||||
|
||||
lines = fs.read("#{packagePath}/package.cson").split("\n")
|
||||
lines = fsUtils.read("#{packagePath}/package.cson").split("\n")
|
||||
expect(lines[0]).toBe "'main': 'lib\/#{packageName}'"
|
||||
|
||||
lines = fs.read("#{packagePath}/lib/#{packageName}.coffee").split("\n")
|
||||
lines = fsUtils.read("#{packagePath}/lib/#{packageName}.coffee").split("\n")
|
||||
expect(lines[0]).toBe "SweetPackageDudeView = require 'sweet-package-dude/lib/sweet-package-dude-view'"
|
||||
expect(lines[3]).toBe " sweetPackageDudeView: null"
|
||||
|
||||
it "displays an error when the package path already exists", ->
|
||||
rootView.attachToDom()
|
||||
fs.makeTree(packagePath)
|
||||
fsUtils.makeTree(packagePath)
|
||||
rootView.trigger("package-generator:generate")
|
||||
packageGeneratorView = rootView.find(".package-generator").view()
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
PEG = require 'pegjs'
|
||||
fs = require 'fs-utils'
|
||||
grammarSrc = fs.read(require.resolve('./snippet-body.pegjs'))
|
||||
fsUtils = require 'fs-utils'
|
||||
grammarSrc = fsUtils.read(require.resolve('./snippet-body.pegjs'))
|
||||
module.exports = PEG.buildParser(grammarSrc, trackLineAndColumn: true)
|
||||
|
||||
@@ -3,7 +3,6 @@ RootView = require 'root-view'
|
||||
Buffer = require 'text-buffer'
|
||||
Editor = require 'editor'
|
||||
_ = require 'underscore'
|
||||
fs = require 'fs-utils'
|
||||
Package = require 'package'
|
||||
|
||||
describe "Snippets extension", ->
|
||||
|
||||
@@ -9,12 +9,6 @@ module.exports =
|
||||
]
|
||||
|
||||
activate: ->
|
||||
syntax.on 'grammars-loaded.spell-check', => @subscribeToEditors()
|
||||
|
||||
deactivate: ->
|
||||
syntax.off '.spell-check'
|
||||
|
||||
subscribeToEditors: ->
|
||||
rootView.eachEditor (editor) ->
|
||||
if editor.attached and not editor.mini
|
||||
editor.underlayer.append(new SpellCheckView(editor))
|
||||
|
||||
@@ -10,7 +10,6 @@ describe "Spell check", ->
|
||||
rootView.open('sample.js')
|
||||
config.set('spell-check.grammars', [])
|
||||
atom.activatePackage('spell-check', immediate: true)
|
||||
syntax.trigger 'grammars-loaded'
|
||||
rootView.attachToDom()
|
||||
editor = rootView.getActiveView()
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ $ = require 'jquery'
|
||||
_ = require 'underscore'
|
||||
RootView = require 'root-view'
|
||||
StatusBar = require 'status-bar/lib/status-bar-view'
|
||||
fs = require 'fs-utils'
|
||||
fsUtils = require 'fs-utils'
|
||||
|
||||
describe "StatusBar", ->
|
||||
[editor, statusBar, buffer] = []
|
||||
@@ -57,7 +57,7 @@ describe "StatusBar", ->
|
||||
describe "when the buffer content has changed from the content on disk", ->
|
||||
it "disables the buffer modified indicator on save", ->
|
||||
path = "/tmp/atom-whitespace.txt"
|
||||
fs.write(path, "")
|
||||
fsUtils.write(path, "")
|
||||
rootView.open(path)
|
||||
expect(statusBar.bufferModified.text()).toBe ''
|
||||
editor.insertText("\n")
|
||||
@@ -107,12 +107,12 @@ describe "StatusBar", ->
|
||||
|
||||
describe "git branch label", ->
|
||||
beforeEach ->
|
||||
fs.remove('/tmp/.git') if fs.isDirectory('/tmp/.git')
|
||||
fsUtils.remove('/tmp/.git') if fsUtils.isDirectory('/tmp/.git')
|
||||
rootView.attachToDom()
|
||||
|
||||
it "displays the current branch for files in repositories", ->
|
||||
path = require.resolve('fixtures/git/master.git/HEAD')
|
||||
project.setPath(fs.resolveOnLoadPath('fixtures/git/master.git'))
|
||||
project.setPath(fsUtils.resolveOnLoadPath('fixtures/git/master.git'))
|
||||
rootView.open(path)
|
||||
expect(statusBar.branchArea).toBeVisible()
|
||||
expect(statusBar.branchLabel.text()).toBe 'master'
|
||||
@@ -128,22 +128,22 @@ describe "StatusBar", ->
|
||||
|
||||
beforeEach ->
|
||||
path = require.resolve('fixtures/git/working-dir/file.txt')
|
||||
newPath = fs.join(fs.resolveOnLoadPath('fixtures/git/working-dir'), 'new.txt')
|
||||
fs.write(newPath, "I'm new here")
|
||||
ignoredPath = fs.join(fs.resolveOnLoadPath('fixtures/git/working-dir'), 'ignored.txt')
|
||||
fs.write(ignoredPath, 'ignored.txt')
|
||||
newPath = fsUtils.join(fsUtils.resolveOnLoadPath('fixtures/git/working-dir'), 'new.txt')
|
||||
fsUtils.write(newPath, "I'm new here")
|
||||
ignoredPath = fsUtils.join(fsUtils.resolveOnLoadPath('fixtures/git/working-dir'), 'ignored.txt')
|
||||
fsUtils.write(ignoredPath, 'ignored.txt')
|
||||
git.getPathStatus(path)
|
||||
git.getPathStatus(newPath)
|
||||
originalPathText = fs.read(path)
|
||||
originalPathText = fsUtils.read(path)
|
||||
rootView.attachToDom()
|
||||
|
||||
afterEach ->
|
||||
fs.write(path, originalPathText)
|
||||
fs.remove(newPath) if fs.exists(newPath)
|
||||
fs.remove(ignoredPath) if fs.exists(ignoredPath)
|
||||
fsUtils.write(path, originalPathText)
|
||||
fsUtils.remove(newPath) if fsUtils.exists(newPath)
|
||||
fsUtils.remove(ignoredPath) if fsUtils.exists(ignoredPath)
|
||||
|
||||
it "displays the modified icon for a changed file", ->
|
||||
fs.write(path, "i've changed for the worse")
|
||||
fsUtils.write(path, "i've changed for the worse")
|
||||
git.getPathStatus(path)
|
||||
rootView.open(path)
|
||||
expect(statusBar.gitStatusIcon).toHaveClass('modified-status-icon')
|
||||
@@ -161,16 +161,16 @@ describe "StatusBar", ->
|
||||
expect(statusBar.gitStatusIcon).toHaveClass('ignored-status-icon')
|
||||
|
||||
it "updates when a status-changed event occurs", ->
|
||||
fs.write(path, "i've changed for the worse")
|
||||
fsUtils.write(path, "i've changed for the worse")
|
||||
git.getPathStatus(path)
|
||||
rootView.open(path)
|
||||
expect(statusBar.gitStatusIcon).toHaveClass('modified-status-icon')
|
||||
fs.write(path, originalPathText)
|
||||
fsUtils.write(path, originalPathText)
|
||||
git.getPathStatus(path)
|
||||
expect(statusBar.gitStatusIcon).not.toHaveClass('modified-status-icon')
|
||||
|
||||
it "displays the diff stat for modified files", ->
|
||||
fs.write(path, "i've changed for the worse")
|
||||
fsUtils.write(path, "i've changed for the worse")
|
||||
git.getPathStatus(path)
|
||||
rootView.open(path)
|
||||
expect(statusBar.gitStatusIcon).toHaveText('+1,-1')
|
||||
@@ -183,7 +183,6 @@ describe "StatusBar", ->
|
||||
beforeEach ->
|
||||
atom.activatePackage('text.tmbundle', sync: true)
|
||||
atom.activatePackage('javascript.tmbundle', sync: true)
|
||||
syntax.trigger 'grammars-loaded'
|
||||
|
||||
it "displays the name of the current grammar", ->
|
||||
expect(statusBar.find('.grammar-name').text()).toBe 'JavaScript'
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
ctags = require 'ctags'
|
||||
fs = require 'fs-utils'
|
||||
fsUtils = require 'fs-utils'
|
||||
|
||||
module.exports =
|
||||
getTagsFile: (path) ->
|
||||
tagsFile = fs.join(path, "tags")
|
||||
return tagsFile if fs.isFile(tagsFile)
|
||||
tagsFile = fsUtils.join(path, "tags")
|
||||
return tagsFile if fsUtils.isFile(tagsFile)
|
||||
|
||||
tagsFile = fs.join(path, "TAGS")
|
||||
return tagsFile if fs.isFile(tagsFile)
|
||||
tagsFile = fsUtils.join(path, "TAGS")
|
||||
return tagsFile if fsUtils.isFile(tagsFile)
|
||||
|
||||
loadTags: (path) ->
|
||||
tagsFile = @getTagsFile(path)
|
||||
|
||||
@@ -3,7 +3,7 @@ SelectList = require 'select-list'
|
||||
TagGenerator = require './tag-generator'
|
||||
TagReader = require './tag-reader'
|
||||
Point = require 'point'
|
||||
fs = require 'fs-utils'
|
||||
fsUtils = require 'fs-utils'
|
||||
$ = require 'jquery'
|
||||
|
||||
module.exports =
|
||||
@@ -30,7 +30,7 @@ class SymbolsView extends SelectList
|
||||
if position
|
||||
text = "Line #{position.row + 1}"
|
||||
else
|
||||
text = fs.base(file)
|
||||
text = fsUtils.base(file)
|
||||
@div text, class: 'right function-details'
|
||||
|
||||
toggleFileSymbols: ->
|
||||
@@ -75,7 +75,7 @@ class SymbolsView extends SelectList
|
||||
setTimeout (=> @cancel()), 2000
|
||||
|
||||
confirmed : (tag) ->
|
||||
if tag.file and not fs.isFile(project.resolve(tag.file))
|
||||
if tag.file and not fsUtils.isFile(project.resolve(tag.file))
|
||||
@setError('Selected file does not exist')
|
||||
setTimeout((=> @setError()), 2000)
|
||||
else
|
||||
@@ -104,8 +104,8 @@ class SymbolsView extends SelectList
|
||||
pattern = $.trim(tag.pattern?.replace(/(^^\/\^)|(\$\/$)/g, '')) # Remove leading /^ and trailing $/
|
||||
return unless pattern
|
||||
file = project.resolve(tag.file)
|
||||
return unless fs.isFile(file)
|
||||
for line, index in fs.read(file).split('\n')
|
||||
return unless fsUtils.isFile(file)
|
||||
for line, index in fsUtils.read(file).split('\n')
|
||||
return new Point(index, 0) if pattern is $.trim(line)
|
||||
|
||||
goToDeclaration: ->
|
||||
@@ -123,7 +123,7 @@ class SymbolsView extends SelectList
|
||||
continue unless position
|
||||
tags.push
|
||||
file: match.file
|
||||
name: fs.base(match.file)
|
||||
name: fsUtils.base(match.file)
|
||||
position: position
|
||||
@miniEditor.show()
|
||||
@setArray(tags)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Point = require 'point'
|
||||
$ = require 'jquery'
|
||||
BufferedProcess = require 'buffered-process'
|
||||
fs = require 'fs-utils'
|
||||
fsUtils = require 'fs-utils'
|
||||
|
||||
module.exports =
|
||||
class TagGenerator
|
||||
@@ -18,7 +18,7 @@ class TagGenerator
|
||||
generate: ->
|
||||
deferred = $.Deferred()
|
||||
tags = []
|
||||
command = fs.resolveOnLoadPath('ctags')
|
||||
command = fsUtils.resolveOnLoadPath('ctags')
|
||||
args = ['--fields=+KS', '-nf', '-', @path]
|
||||
stdout = (lines) =>
|
||||
for line in lines.split('\n')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
fs = require 'fs-utils'
|
||||
fsUtils = require 'fs-utils'
|
||||
$ = require 'jquery'
|
||||
LoadTagsTask = require './load-tags-task'
|
||||
ctags = require 'ctags'
|
||||
@@ -7,7 +7,7 @@ module.exports =
|
||||
|
||||
getTagsFile: (project) ->
|
||||
tagsFile = project.resolve("tags") or project.resolve("TAGS")
|
||||
return tagsFile if fs.isFile(tagsFile)
|
||||
return tagsFile if fsUtils.isFile(tagsFile)
|
||||
|
||||
find: (editor) ->
|
||||
word = editor.getTextInRange(editor.getCursor().getCurrentWordBufferRange())
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
RootView = require 'root-view'
|
||||
SymbolsView = require 'symbols-view/lib/symbols-view'
|
||||
TagGenerator = require 'symbols-view/lib/tag-generator'
|
||||
fs = require 'fs-utils'
|
||||
fsUtils = require 'fs-utils'
|
||||
|
||||
describe "SymbolsView", ->
|
||||
[symbolsView, setArraySpy] = []
|
||||
@@ -162,11 +162,11 @@ describe "SymbolsView", ->
|
||||
|
||||
beforeEach ->
|
||||
renamedPath = project.resolve("tagged-duplicate-renamed.js")
|
||||
fs.remove(renamedPath) if fs.exists(renamedPath)
|
||||
fs.move(project.resolve("tagged-duplicate.js"), renamedPath)
|
||||
fsUtils.remove(renamedPath) if fsUtils.exists(renamedPath)
|
||||
fsUtils.move(project.resolve("tagged-duplicate.js"), renamedPath)
|
||||
|
||||
afterEach ->
|
||||
fs.move(renamedPath, project.resolve("tagged-duplicate.js"))
|
||||
fsUtils.move(renamedPath, project.resolve("tagged-duplicate.js"))
|
||||
|
||||
it "doesn't display the tag", ->
|
||||
rootView.open("tagged.js")
|
||||
@@ -205,11 +205,11 @@ describe "SymbolsView", ->
|
||||
|
||||
beforeEach ->
|
||||
renamedPath = project.resolve("tagged-renamed.js")
|
||||
fs.remove(renamedPath) if fs.exists(renamedPath)
|
||||
fs.move(project.resolve("tagged.js"), renamedPath)
|
||||
fsUtils.remove(renamedPath) if fsUtils.exists(renamedPath)
|
||||
fsUtils.move(project.resolve("tagged.js"), renamedPath)
|
||||
|
||||
afterEach ->
|
||||
fs.move(renamedPath, project.resolve("tagged.js"))
|
||||
fsUtils.move(renamedPath, project.resolve("tagged.js"))
|
||||
|
||||
it "doesn't open the editor", ->
|
||||
rootView.trigger "symbols-view:toggle-project-symbols"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
$ = require 'jquery'
|
||||
{View} = require 'space-pen'
|
||||
fs = require 'fs-utils'
|
||||
fsUtils = require 'fs-utils'
|
||||
|
||||
module.exports =
|
||||
class TabView extends View
|
||||
@@ -46,7 +46,7 @@ class TabView extends View
|
||||
if fileNameText?
|
||||
duplicates = @editor.getEditSessions().filter (session) -> fileNameText is session.buffer.getBaseName()
|
||||
if duplicates.length > 1
|
||||
directory = fs.base(fs.directory(@editSession.getPath()))
|
||||
directory = fsUtils.base(fsUtils.directory(@editSession.getPath()))
|
||||
fileNameText = "#{fileNameText} - #{directory}" if directory
|
||||
else
|
||||
fileNameText = 'untitled'
|
||||
|
||||
@@ -4,7 +4,6 @@ RootView = require 'root-view'
|
||||
Pane = require 'pane'
|
||||
PaneContainer = require 'pane-container'
|
||||
TabBarView = require 'tabs/lib/tab-bar-view'
|
||||
fs = require 'fs-utils'
|
||||
{View} = require 'space-pen'
|
||||
|
||||
describe "Tabs package main", ->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{View} = require 'space-pen'
|
||||
Editor = require 'editor'
|
||||
fs = require 'fs-utils'
|
||||
fsUtils = require 'fs-utils'
|
||||
$ = require 'jquery'
|
||||
|
||||
module.exports =
|
||||
@@ -21,8 +21,8 @@ class Dialog extends View
|
||||
@miniEditor.setText(path)
|
||||
|
||||
if select
|
||||
extension = fs.extension(path)
|
||||
baseName = fs.base(path)
|
||||
extension = fsUtils.extension(path)
|
||||
baseName = fsUtils.base(path)
|
||||
if baseName is extension
|
||||
selectionEnd = path.length
|
||||
else
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{View} = require 'space-pen'
|
||||
$ = require 'jquery'
|
||||
Git = require 'git'
|
||||
fs = require 'fs-utils'
|
||||
fsUtils = require 'fs-utils'
|
||||
|
||||
module.exports =
|
||||
class FileView extends View
|
||||
@@ -17,16 +17,16 @@ class FileView extends View
|
||||
if @file.symlink
|
||||
@fileName.addClass('symlink-icon')
|
||||
else
|
||||
extension = fs.extension(@getPath())
|
||||
if fs.isReadmePath(@getPath())
|
||||
extension = fsUtils.extension(@getPath())
|
||||
if fsUtils.isReadmePath(@getPath())
|
||||
@fileName.addClass('readme-icon')
|
||||
else if fs.isCompressedExtension(extension)
|
||||
else if fsUtils.isCompressedExtension(extension)
|
||||
@fileName.addClass('compressed-icon')
|
||||
else if fs.isImageExtension(extension)
|
||||
else if fsUtils.isImageExtension(extension)
|
||||
@fileName.addClass('image-icon')
|
||||
else if fs.isPdfExtension(extension)
|
||||
else if fsUtils.isPdfExtension(extension)
|
||||
@fileName.addClass('pdf-icon')
|
||||
else if fs.isBinaryExtension(extension)
|
||||
else if fsUtils.isBinaryExtension(extension)
|
||||
@fileName.addClass('binary-icon')
|
||||
else
|
||||
@fileName.addClass('text-icon')
|
||||
|
||||
@@ -4,7 +4,7 @@ Directory = require 'directory'
|
||||
DirectoryView = require './directory-view'
|
||||
FileView = require './file-view'
|
||||
Dialog = require './dialog'
|
||||
fs = require 'fs-utils'
|
||||
fsUtils = require 'fs-utils'
|
||||
$ = require 'jquery'
|
||||
_ = require 'underscore'
|
||||
|
||||
@@ -230,14 +230,14 @@ class TreeView extends ScrollView
|
||||
dialog.close()
|
||||
return
|
||||
|
||||
if fs.exists(newPath)
|
||||
if fsUtils.exists(newPath)
|
||||
dialog.showError("Error: #{newPath} already exists. Try a different path.")
|
||||
return
|
||||
|
||||
directoryPath = fs.directory(newPath)
|
||||
directoryPath = fsUtils.directory(newPath)
|
||||
try
|
||||
fs.makeTree(directoryPath) unless fs.exists(directoryPath)
|
||||
fs.move(oldPath, newPath)
|
||||
fsUtils.makeTree(directoryPath) unless fsUtils.exists(directoryPath)
|
||||
fsUtils.move(oldPath, newPath)
|
||||
dialog.close()
|
||||
catch e
|
||||
dialog.showError("Error: #{e.message} Try a different path.")
|
||||
@@ -254,13 +254,13 @@ class TreeView extends ScrollView
|
||||
"You are deleting #{entry.getPath()}",
|
||||
"Move to Trash", (=> $native.moveToTrash(entry.getPath())),
|
||||
"Cancel", null
|
||||
"Delete", (=> fs.remove(entry.getPath()))
|
||||
"Delete", (=> fsUtils.remove(entry.getPath()))
|
||||
)
|
||||
|
||||
add: ->
|
||||
selectedEntry = @selectedEntry() or @root
|
||||
selectedPath = selectedEntry.getPath()
|
||||
directoryPath = if fs.isFile(selectedPath) then fs.directory(selectedPath) else selectedPath
|
||||
directoryPath = if fsUtils.isFile(selectedPath) then fsUtils.directory(selectedPath) else selectedPath
|
||||
relativeDirectoryPath = project.relativize(directoryPath)
|
||||
relativeDirectoryPath += '/' if relativeDirectoryPath.length > 0
|
||||
|
||||
@@ -274,16 +274,16 @@ class TreeView extends ScrollView
|
||||
endsWithDirectorySeparator = /\/$/.test(relativePath)
|
||||
path = project.resolve(relativePath)
|
||||
try
|
||||
if fs.exists(path)
|
||||
pathType = if fs.isFile(path) then "file" else "directory"
|
||||
if fsUtils.exists(path)
|
||||
pathType = if fsUtils.isFile(path) then "file" else "directory"
|
||||
dialog.showError("Error: A #{pathType} already exists at path '#{path}'. Try a different path.")
|
||||
else if endsWithDirectorySeparator
|
||||
fs.makeTree(path)
|
||||
fsUtils.makeTree(path)
|
||||
dialog.cancel()
|
||||
@entryForPath(path).buildEntries()
|
||||
@selectEntryForPath(path)
|
||||
else
|
||||
fs.write(path, "")
|
||||
fsUtils.write(path, "")
|
||||
rootView.open(path)
|
||||
dialog.close()
|
||||
catch e
|
||||
|
||||
@@ -4,7 +4,7 @@ _ = require 'underscore'
|
||||
TreeView = require 'tree-view/lib/tree-view'
|
||||
RootView = require 'root-view'
|
||||
Directory = require 'directory'
|
||||
fs = require 'fs-utils'
|
||||
fsUtils = require 'fs-utils'
|
||||
|
||||
describe "TreeView", ->
|
||||
[treeView, sampleJs, sampleTxt] = []
|
||||
@@ -259,20 +259,20 @@ describe "TreeView", ->
|
||||
|
||||
sampleJs.trigger clickEvent(originalEvent: { detail: 1 })
|
||||
expect(sampleJs).toHaveClass 'selected'
|
||||
expect(rootView.getActiveView().getPath()).toBe fs.resolveOnLoadPath('fixtures/tree-view/tree-view.js')
|
||||
expect(rootView.getActiveView().getPath()).toBe fsUtils.resolveOnLoadPath('fixtures/tree-view/tree-view.js')
|
||||
expect(rootView.getActiveView().isFocused).toBeFalsy()
|
||||
|
||||
sampleTxt.trigger clickEvent(originalEvent: { detail: 1 })
|
||||
expect(sampleTxt).toHaveClass 'selected'
|
||||
expect(treeView.find('.selected').length).toBe 1
|
||||
expect(rootView.getActiveView().getPath()).toBe fs.resolveOnLoadPath('fixtures/tree-view/tree-view.txt')
|
||||
expect(rootView.getActiveView().getPath()).toBe fsUtils.resolveOnLoadPath('fixtures/tree-view/tree-view.txt')
|
||||
expect(rootView.getActiveView().isFocused).toBeFalsy()
|
||||
|
||||
describe "when a file is double-clicked", ->
|
||||
it "selects the file and opens it in the active editor on the first click, then changes focus to the active editor on the second", ->
|
||||
sampleJs.trigger clickEvent(originalEvent: { detail: 1 })
|
||||
expect(sampleJs).toHaveClass 'selected'
|
||||
expect(rootView.getActiveView().getPath()).toBe fs.resolveOnLoadPath('fixtures/tree-view/tree-view.js')
|
||||
expect(rootView.getActiveView().getPath()).toBe fsUtils.resolveOnLoadPath('fixtures/tree-view/tree-view.js')
|
||||
expect(rootView.getActiveView().isFocused).toBeFalsy()
|
||||
|
||||
sampleJs.trigger clickEvent(originalEvent: { detail: 2 })
|
||||
@@ -568,7 +568,7 @@ describe "TreeView", ->
|
||||
it "opens the file in the editor and focuses it", ->
|
||||
treeView.root.find('.file:contains(tree-view.js)').click()
|
||||
treeView.root.trigger 'tree-view:open-selected-entry'
|
||||
expect(rootView.getActiveView().getPath()).toBe fs.resolveOnLoadPath('fixtures/tree-view/tree-view.js')
|
||||
expect(rootView.getActiveView().getPath()).toBe fsUtils.resolveOnLoadPath('fixtures/tree-view/tree-view.js')
|
||||
expect(rootView.getActiveView().isFocused).toBeTruthy()
|
||||
|
||||
describe "when a directory is selected", ->
|
||||
@@ -593,14 +593,14 @@ describe "TreeView", ->
|
||||
beforeEach ->
|
||||
atom.deactivatePackage('tree-view')
|
||||
|
||||
rootDirPath = fs.join(fs.absolute("/tmp"), "atom-tests")
|
||||
fs.remove(rootDirPath) if fs.exists(rootDirPath)
|
||||
rootDirPath = fsUtils.join(fsUtils.absolute("/tmp"), "atom-tests")
|
||||
fsUtils.remove(rootDirPath) if fsUtils.exists(rootDirPath)
|
||||
|
||||
dirPath = fs.join(rootDirPath, "test-dir")
|
||||
filePath = fs.join(dirPath, "test-file.txt")
|
||||
fs.makeDirectory(rootDirPath)
|
||||
fs.makeDirectory(dirPath)
|
||||
fs.write(filePath, "doesn't matter")
|
||||
dirPath = fsUtils.join(rootDirPath, "test-dir")
|
||||
filePath = fsUtils.join(dirPath, "test-file.txt")
|
||||
fsUtils.makeDirectory(rootDirPath)
|
||||
fsUtils.makeDirectory(dirPath)
|
||||
fsUtils.write(filePath, "doesn't matter")
|
||||
|
||||
project.setPath(rootDirPath)
|
||||
|
||||
@@ -612,7 +612,7 @@ describe "TreeView", ->
|
||||
fileView = treeView.find('.file:contains(test-file.txt)').view()
|
||||
|
||||
afterEach ->
|
||||
fs.remove(rootDirPath) if fs.exists(rootDirPath)
|
||||
fsUtils.remove(rootDirPath) if fsUtils.exists(rootDirPath)
|
||||
|
||||
describe "tree-view:add", ->
|
||||
addDialog = null
|
||||
@@ -638,16 +638,16 @@ describe "TreeView", ->
|
||||
|
||||
dirView.directory.trigger 'contents-changed'
|
||||
expect(directoryChangeHandler).toHaveBeenCalled()
|
||||
expect(treeView.find('.selected').text()).toBe fs.base(filePath)
|
||||
expect(treeView.find('.selected').text()).toBe fsUtils.base(filePath)
|
||||
|
||||
describe "when the path without a trailing '/' is changed and confirmed", ->
|
||||
describe "when no file exists at that location", ->
|
||||
it "add a file, closes the dialog and selects the file in the tree-view", ->
|
||||
newPath = fs.join(dirPath, "new-test-file.txt")
|
||||
addDialog.miniEditor.insertText(fs.base(newPath))
|
||||
newPath = fsUtils.join(dirPath, "new-test-file.txt")
|
||||
addDialog.miniEditor.insertText(fsUtils.base(newPath))
|
||||
addDialog.trigger 'core:confirm'
|
||||
expect(fs.exists(newPath)).toBeTruthy()
|
||||
expect(fs.isFile(newPath)).toBeTruthy()
|
||||
expect(fsUtils.exists(newPath)).toBeTruthy()
|
||||
expect(fsUtils.isFile(newPath)).toBeTruthy()
|
||||
expect(addDialog.parent()).not.toExist()
|
||||
expect(rootView.getActiveView().getPath()).toBe newPath
|
||||
|
||||
@@ -655,13 +655,13 @@ describe "TreeView", ->
|
||||
dirView.entries.find("> .file").length > 1
|
||||
|
||||
runs ->
|
||||
expect(treeView.find('.selected').text()).toBe fs.base(newPath)
|
||||
expect(treeView.find('.selected').text()).toBe fsUtils.base(newPath)
|
||||
|
||||
describe "when a file already exists at that location", ->
|
||||
it "shows an error message and does not close the dialog", ->
|
||||
newPath = fs.join(dirPath, "new-test-file.txt")
|
||||
fs.write(newPath, '')
|
||||
addDialog.miniEditor.insertText(fs.base(newPath))
|
||||
newPath = fsUtils.join(dirPath, "new-test-file.txt")
|
||||
fsUtils.write(newPath, '')
|
||||
addDialog.miniEditor.insertText(fsUtils.base(newPath))
|
||||
addDialog.trigger 'core:confirm'
|
||||
|
||||
expect(addDialog.prompt.text()).toContain 'Error'
|
||||
@@ -673,11 +673,11 @@ describe "TreeView", ->
|
||||
describe "when no file or directory exists at the given path", ->
|
||||
it "adds a directory and closes the dialog", ->
|
||||
treeView.attachToDom()
|
||||
newPath = fs.join(dirPath, "new/dir")
|
||||
newPath = fsUtils.join(dirPath, "new/dir")
|
||||
addDialog.miniEditor.insertText("new/dir/")
|
||||
addDialog.trigger 'core:confirm'
|
||||
expect(fs.exists(newPath)).toBeTruthy()
|
||||
expect(fs.isDirectory(newPath)).toBeTruthy()
|
||||
expect(fsUtils.exists(newPath)).toBeTruthy()
|
||||
expect(fsUtils.isDirectory(newPath)).toBeTruthy()
|
||||
expect(addDialog.parent()).not.toExist()
|
||||
expect(rootView.getActiveView().getPath()).not.toBe newPath
|
||||
expect(treeView.find(".tree-view")).toMatchSelector(':focus')
|
||||
@@ -686,11 +686,11 @@ describe "TreeView", ->
|
||||
|
||||
it "selects the created directory", ->
|
||||
treeView.attachToDom()
|
||||
newPath = fs.join(dirPath, "new2/")
|
||||
newPath = fsUtils.join(dirPath, "new2/")
|
||||
addDialog.miniEditor.insertText("new2/")
|
||||
addDialog.trigger 'core:confirm'
|
||||
expect(fs.exists(newPath)).toBeTruthy()
|
||||
expect(fs.isDirectory(newPath)).toBeTruthy()
|
||||
expect(fsUtils.exists(newPath)).toBeTruthy()
|
||||
expect(fsUtils.isDirectory(newPath)).toBeTruthy()
|
||||
expect(addDialog.parent()).not.toExist()
|
||||
expect(rootView.getActiveView().getPath()).not.toBe newPath
|
||||
expect(treeView.find(".tree-view")).toMatchSelector(':focus')
|
||||
@@ -699,8 +699,8 @@ describe "TreeView", ->
|
||||
|
||||
describe "when a file or directory already exists at the given path", ->
|
||||
it "shows an error message and does not close the dialog", ->
|
||||
newPath = fs.join(dirPath, "new-dir")
|
||||
fs.makeDirectory(newPath)
|
||||
newPath = fsUtils.join(dirPath, "new-dir")
|
||||
fsUtils.makeDirectory(newPath)
|
||||
addDialog.miniEditor.insertText("new-dir/")
|
||||
addDialog.trigger 'core:confirm'
|
||||
|
||||
@@ -770,24 +770,24 @@ describe "TreeView", ->
|
||||
waits 50 # The move specs cause too many false positives because of their async nature, so wait a little bit before we cleanup
|
||||
|
||||
it "opens a move dialog with the file's current path (excluding extension) populated", ->
|
||||
extension = fs.extension(filePath)
|
||||
fileNameWithoutExtension = fs.base(filePath, extension)
|
||||
extension = fsUtils.extension(filePath)
|
||||
fileNameWithoutExtension = fsUtils.base(filePath, extension)
|
||||
expect(moveDialog).toExist()
|
||||
expect(moveDialog.prompt.text()).toBe "Enter the new path for the file."
|
||||
expect(moveDialog.miniEditor.getText()).toBe(project.relativize(filePath))
|
||||
expect(moveDialog.miniEditor.getSelectedText()).toBe fs.base(fileNameWithoutExtension)
|
||||
expect(moveDialog.miniEditor.getSelectedText()).toBe fsUtils.base(fileNameWithoutExtension)
|
||||
expect(moveDialog.miniEditor.isFocused).toBeTruthy()
|
||||
|
||||
describe "when the path is changed and confirmed", ->
|
||||
describe "when all the directories along the new path exist", ->
|
||||
it "moves the file, updates the tree view, and closes the dialog", ->
|
||||
newPath = fs.join(rootDirPath, 'renamed-test-file.txt')
|
||||
newPath = fsUtils.join(rootDirPath, 'renamed-test-file.txt')
|
||||
moveDialog.miniEditor.setText(newPath)
|
||||
|
||||
moveDialog.trigger 'core:confirm'
|
||||
|
||||
expect(fs.exists(newPath)).toBeTruthy()
|
||||
expect(fs.exists(filePath)).toBeFalsy()
|
||||
expect(fsUtils.exists(newPath)).toBeTruthy()
|
||||
expect(fsUtils.exists(filePath)).toBeFalsy()
|
||||
expect(moveDialog.parent()).not.toExist()
|
||||
|
||||
waitsFor "tree view to update", ->
|
||||
@@ -800,7 +800,7 @@ describe "TreeView", ->
|
||||
|
||||
describe "when the directories along the new path don't exist", ->
|
||||
it "creates the target directory before moving the file", ->
|
||||
newPath = fs.join(rootDirPath, 'new/directory', 'renamed-test-file.txt')
|
||||
newPath = fsUtils.join(rootDirPath, 'new/directory', 'renamed-test-file.txt')
|
||||
moveDialog.miniEditor.setText(newPath)
|
||||
|
||||
moveDialog.trigger 'core:confirm'
|
||||
@@ -809,14 +809,14 @@ describe "TreeView", ->
|
||||
treeView.root.find('> .entries > .directory:contains(new)').length > 0
|
||||
|
||||
runs ->
|
||||
expect(fs.exists(newPath)).toBeTruthy()
|
||||
expect(fs.exists(filePath)).toBeFalsy()
|
||||
expect(fsUtils.exists(newPath)).toBeTruthy()
|
||||
expect(fsUtils.exists(filePath)).toBeFalsy()
|
||||
|
||||
describe "when a file or directory already exists at the target path", ->
|
||||
it "shows an error message and does not close the dialog", ->
|
||||
runs ->
|
||||
fs.write(fs.join(rootDirPath, 'target.txt'), '')
|
||||
newPath = fs.join(rootDirPath, 'target.txt')
|
||||
fsUtils.write(fsUtils.join(rootDirPath, 'target.txt'), '')
|
||||
newPath = fsUtils.join(rootDirPath, 'target.txt')
|
||||
moveDialog.miniEditor.setText(newPath)
|
||||
|
||||
moveDialog.trigger 'core:confirm'
|
||||
@@ -844,8 +844,8 @@ describe "TreeView", ->
|
||||
[dotFilePath, dotFileView, moveDialog] = []
|
||||
|
||||
beforeEach ->
|
||||
dotFilePath = fs.join(dirPath, ".dotfile")
|
||||
fs.write(dotFilePath, "dot")
|
||||
dotFilePath = fsUtils.join(dirPath, ".dotfile")
|
||||
fsUtils.write(dotFilePath, "dot")
|
||||
dirView.collapse()
|
||||
dirView.expand()
|
||||
dotFileView = treeView.find('.file:contains(.dotfile)').view()
|
||||
@@ -875,22 +875,22 @@ describe "TreeView", ->
|
||||
temporaryFilePath = null
|
||||
|
||||
beforeEach ->
|
||||
temporaryFilePath = fs.join(fs.resolveOnLoadPath('fixtures/tree-view'), 'temporary')
|
||||
if fs.exists(temporaryFilePath)
|
||||
fs.remove(temporaryFilePath)
|
||||
temporaryFilePath = fsUtils.join(fsUtils.resolveOnLoadPath('fixtures/tree-view'), 'temporary')
|
||||
if fsUtils.exists(temporaryFilePath)
|
||||
fsUtils.remove(temporaryFilePath)
|
||||
waits(20)
|
||||
|
||||
afterEach ->
|
||||
fs.remove(temporaryFilePath) if fs.exists(temporaryFilePath)
|
||||
fsUtils.remove(temporaryFilePath) if fsUtils.exists(temporaryFilePath)
|
||||
|
||||
describe "when a file is added or removed in an expanded directory", ->
|
||||
it "updates the directory view to display the directory's new contents", ->
|
||||
entriesCountBefore = null
|
||||
|
||||
runs ->
|
||||
expect(fs.exists(temporaryFilePath)).toBeFalsy()
|
||||
expect(fsUtils.exists(temporaryFilePath)).toBeFalsy()
|
||||
entriesCountBefore = treeView.root.entries.find('.entry').length
|
||||
fs.write temporaryFilePath, 'hi'
|
||||
fsUtils.write temporaryFilePath, 'hi'
|
||||
|
||||
waitsFor "directory view contens to refresh", ->
|
||||
treeView.root.entries.find('.entry').length == entriesCountBefore + 1
|
||||
@@ -898,7 +898,7 @@ describe "TreeView", ->
|
||||
runs ->
|
||||
expect(treeView.root.entries.find('.entry').length).toBe entriesCountBefore + 1
|
||||
expect(treeView.root.entries.find('.file:contains(temporary)')).toExist()
|
||||
fs.remove(temporaryFilePath)
|
||||
fsUtils.remove(temporaryFilePath)
|
||||
|
||||
waitsFor "directory view contens to refresh", ->
|
||||
treeView.root.entries.find('.entry').length == entriesCountBefore
|
||||
@@ -907,12 +907,12 @@ describe "TreeView", ->
|
||||
[ignoreFile] = []
|
||||
|
||||
beforeEach ->
|
||||
ignoreFile = fs.join(fs.resolveOnLoadPath('fixtures/tree-view'), '.gitignore')
|
||||
fs.write(ignoreFile, 'tree-view.js')
|
||||
ignoreFile = fsUtils.join(fsUtils.resolveOnLoadPath('fixtures/tree-view'), '.gitignore')
|
||||
fsUtils.write(ignoreFile, 'tree-view.js')
|
||||
config.set "core.hideGitIgnoredFiles", false
|
||||
|
||||
afterEach ->
|
||||
fs.remove(ignoreFile) if fs.exists(ignoreFile)
|
||||
fsUtils.remove(ignoreFile) if fsUtils.exists(ignoreFile)
|
||||
|
||||
it "hides git-ignored files if the option is set, but otherwise shows them", ->
|
||||
expect(treeView.find('.file:contains(tree-view.js)').length).toBe 1
|
||||
@@ -930,30 +930,30 @@ describe "TreeView", ->
|
||||
|
||||
beforeEach ->
|
||||
config.set "core.hideGitIgnoredFiles", false
|
||||
ignoreFile = fs.join(fs.resolveOnLoadPath('fixtures/tree-view'), '.gitignore')
|
||||
fs.write(ignoreFile, 'tree-view.js')
|
||||
ignoreFile = fsUtils.join(fsUtils.resolveOnLoadPath('fixtures/tree-view'), '.gitignore')
|
||||
fsUtils.write(ignoreFile, 'tree-view.js')
|
||||
git.getPathStatus(ignoreFile)
|
||||
|
||||
newFile = fs.join(fs.resolveOnLoadPath('fixtures/tree-view/dir2'), 'new2')
|
||||
fs.write(newFile, '')
|
||||
newFile = fsUtils.join(fsUtils.resolveOnLoadPath('fixtures/tree-view/dir2'), 'new2')
|
||||
fsUtils.write(newFile, '')
|
||||
git.getPathStatus(newFile)
|
||||
|
||||
modifiedFile = fs.join(fs.resolveOnLoadPath('fixtures/tree-view/dir1'), 'file1')
|
||||
originalFileContent = fs.read(modifiedFile)
|
||||
fs.write modifiedFile, 'ch ch changes'
|
||||
modifiedFile = fsUtils.join(fsUtils.resolveOnLoadPath('fixtures/tree-view/dir1'), 'file1')
|
||||
originalFileContent = fsUtils.read(modifiedFile)
|
||||
fsUtils.write modifiedFile, 'ch ch changes'
|
||||
git.getPathStatus(modifiedFile)
|
||||
|
||||
treeView.updateRoot()
|
||||
treeView.root.entries.find('.directory:contains(dir1)').view().expand()
|
||||
treeView.root.entries.find('.directory:contains(dir2)').view().expand()
|
||||
|
||||
afterEach ->
|
||||
fs.remove(ignoreFile) if fs.exists(ignoreFile)
|
||||
fs.remove(newFile) if fs.exists(newFile)
|
||||
fs.write modifiedFile, originalFileContent
|
||||
fsUtils.remove(ignoreFile) if fsUtils.exists(ignoreFile)
|
||||
fsUtils.remove(newFile) if fsUtils.exists(newFile)
|
||||
fsUtils.write modifiedFile, originalFileContent
|
||||
|
||||
describe "when a file is modified", ->
|
||||
it "adds a custom style", ->
|
||||
treeView.root.entries.find('.directory:contains(dir1)').view().expand()
|
||||
expect(treeView.find('.file:contains(file1)')).toHaveClass 'modified'
|
||||
|
||||
describe "when a directory if modified", ->
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports =
|
||||
whitespaceBeforeSave: (buffer) ->
|
||||
buffer.on 'will-be-saved', ->
|
||||
buffer.transact ->
|
||||
buffer.scan /[ \t]+$/g, (match, range, { replace }) -> replace('')
|
||||
buffer.scan /[ \t]+$/g, ({replace}) -> replace('')
|
||||
|
||||
if config.get('whitespace.ensureSingleTrailingNewline')
|
||||
if buffer.getLastLine() is ''
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
RootView = require 'root-view'
|
||||
fs = require 'fs-utils'
|
||||
fsUtils = require 'fs-utils'
|
||||
|
||||
describe "Whitespace", ->
|
||||
[editor, path] = []
|
||||
|
||||
beforeEach ->
|
||||
path = "/tmp/atom-whitespace.txt"
|
||||
fs.write(path, "")
|
||||
fsUtils.write(path, "")
|
||||
window.rootView = new RootView
|
||||
rootView.open(path)
|
||||
|
||||
@@ -16,10 +16,10 @@ describe "Whitespace", ->
|
||||
editor = rootView.getActiveView()
|
||||
|
||||
afterEach ->
|
||||
fs.remove(path) if fs.exists(path)
|
||||
fsUtils.remove(path) if fsUtils.exists(path)
|
||||
|
||||
it "strips trailing whitespace before an editor saves a buffer", ->
|
||||
spyOn(fs, 'write')
|
||||
spyOn(fsUtils, 'write')
|
||||
|
||||
config.set("whitespace.ensureSingleTrailingNewline", false)
|
||||
config.update()
|
||||
@@ -79,4 +79,3 @@ describe "Whitespace", ->
|
||||
editor.insertText "no trailing newline"
|
||||
editor.getBuffer().save()
|
||||
expect(editor.getText()).toBe "no trailing newline"
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@ module.exports =
|
||||
class WrapGuideView extends View
|
||||
@activate: ->
|
||||
rootView.eachEditor (editor) ->
|
||||
editor.underlayer.append(new WrapGuideView(editor)) if editor.attached
|
||||
if editor.attached and editor.getPane()
|
||||
editor.underlayer.append(new WrapGuideView(editor))
|
||||
|
||||
@content: ->
|
||||
@div class: 'wrap-guide'
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
RootView = require 'root-view'
|
||||
Editor = require 'editor'
|
||||
|
||||
describe "WrapGuide", ->
|
||||
[editor, wrapGuide] = []
|
||||
@@ -62,3 +63,8 @@ describe "WrapGuide", ->
|
||||
editor.width(10)
|
||||
wrapGuide.updateGuide()
|
||||
expect(wrapGuide).toBeHidden()
|
||||
|
||||
it "only attaches to editors that are part of a pane", ->
|
||||
editor2 = new Editor(mini: true)
|
||||
editor.overlayer.append(editor2)
|
||||
expect(editor2.find('.wrap-guide').length).toBe 0
|
||||
|
||||
Reference in New Issue
Block a user