Comparar commits

...

43 Commits

Autor SHA1 Mensagem Data
Kevin Sawicki 6e8e4a56cf Use String::indexOf instead of String::startsWith
String::startsWith isn't available in the browser process yet.
2014-11-07 13:20:37 -08:00
Kevin Sawicki e53c38f09d Guard against no atom globals 2014-11-07 13:11:00 -08:00
Kevin Sawicki 587b73e3b9 Pass in resourcePath and devMode to Package.loadMetadata 2014-11-07 13:07:21 -08:00
Kevin Sawicki 46efc52a22 ⬆️ language-shellscript@0.10 2014-11-07 12:42:13 -08:00
Kevin Sawicki f78891b600 Fetch draft assets from assets URL
This will include assets in a bad state that should still be deleted
and aren't returned from the main release URL.
2014-11-07 12:07:16 -08:00
Kevin Sawicki 05e3bbde45 ⬆️ settings-view@0.156 2014-11-07 11:54:58 -08:00
Ben Ogle 4dc4a022ab Upgrade find-and-replace to use atom-text-editor 2014-11-07 11:09:03 -08:00
Ben Ogle 226ae374c1 Upgrade bookmarks to work with shadow dom 2014-11-07 11:06:03 -08:00
Kevin Sawicki fbfe1c7224 Fully fetch draft release
Assets in a bad state aren't returned from the releases listing
endpoint.
2014-11-07 10:58:53 -08:00
Kevin Sawicki 53f8ae3055 ⬆️ language-sass@0.25 2014-11-07 10:48:24 -08:00
Ben Ogle 1634b3acfc Upgrade git-diff to use atom-text-editor 2014-11-07 10:46:15 -08:00
Kevin Sawicki 3067323564 ⬆️ language-css@0.22 2014-11-07 10:41:36 -08:00
Kevin Sawicki c410b79af0 ⬆️ language-python@0.23 2014-11-07 10:34:45 -08:00
Ben Ogle f09fc23fdc Merge branch 'master' of github.com:atom/atom 2014-11-07 10:16:16 -08:00
Kevin Sawicki a9262b18c2 Prepare 0.144 2014-11-07 10:14:27 -08:00
Ben Ogle ef129f9491 Add more relevant (but contrived) example in init.coffee.
Closes #4089
2014-11-07 10:02:07 -08:00
Ben Ogle b4d38d14e3 Add padding to panel headings 2014-11-07 09:44:32 -08:00
Ben Ogle 97a21d7bbf Merge pull request #4087 from philipgiuliani/patch-1
📝 Update .workspace class with custom element
2014-11-07 09:34:32 -08:00
Nathan Sobo ab395952a9 Dispose of ::scopedConfigSubscriptions when Editor is destroyed 2014-11-07 10:13:38 -07:00
Nathan Sobo 6e55c80d3c Dispose of ::scopedConfigSubscriptions when DisplayBuffer is destroyed 2014-11-07 10:09:55 -07:00
Philip Giuliani f1079056cf Update .workspace class with custom element
Because of the update with the custom elements, i noticed that `.workspace` hasn't been updated in the `keymap.cson`, but `.editor` has (to `atom-text-editor`).
2014-11-07 09:43:46 +01:00
Ben Ogle b29a61ec87 Update deprecation warning test 2014-11-06 15:19:49 -08:00
Max Brunsfeld 4894849adc ⬆️ atom-keymap for multi-modifier keystroke fix
Signed-off-by: Nathan Sobo <nathan@github.com>
2014-11-06 15:01:34 -08:00
Ben Ogle cf78b01d45 Upgrade find-and-replace to use new APIs 2014-11-06 14:49:13 -08:00
Ben Ogle 1ed927f213 Remove getPath() deprecation in project::scan 2014-11-06 14:49:13 -08:00
Nathan Sobo b978b4f8c7 ⬆️ space-pen for interoperable $.fn.view method
Previously, the SpacePen view was associated with its elements
via $.fn.data, but this only works across a single instance
of jQuery. Now we store a ::spacePenView property as an expando
property directly on elements.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-06 15:28:49 -07:00
Nathan Sobo baea6fcb49 Don’t assume SpacePen views implement ::unsubscribe
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-06 15:28:20 -07:00
Nathan Sobo 7e06e10fcf Don’t require a specific jQuery instance for jasmine jQuery matchers
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-06 15:27:45 -07:00
Nathan Sobo 0bcfa591f6 Always throw exceptions when translating rows on destroyed DisplayBuffer
Previously we only threw exceptions on non-release builds, but we
haven’t seen bundled packages cause issues in a while. Time to see what
third party packages cause problems.

Refs #3192
2014-11-06 12:56:01 -07:00
Ben Ogle f2532b1a35 Upgrade metrics to reduce the noise a bit 2014-11-06 11:46:12 -08:00
Nathan Sobo e0f8d6f365 Fix disappearing editor when folding all
Also: simplify the editor stylesheet a bit. Still some more to do but
fixing this issue is more important.
2014-11-06 12:36:14 -07:00
Ben Ogle 50c705fea4 Remove unnecessary code
cc @nathansobo as you meant to remove this originally
2014-11-06 10:16:11 -08:00
Max Brunsfeld 8bfea240ea Merge pull request #4071 from atom/mb-editor-grouped-undo
Add grouped undo for all text editor commands
2014-11-06 10:13:04 -08:00
Max Brunsfeld 4099828525 ⬆️ text-buffer@3.6.0 2014-11-06 09:55:31 -08:00
Max Brunsfeld 26983adbdf Reduce ambiguity in config description 2014-11-06 09:42:20 -08:00
Kevin Sawicki ede703453a ⬆️ settings-view@0.155 2014-11-06 09:38:36 -08:00
Max Brunsfeld d97c81bf6a Make undo grouping interval configurable 2014-11-06 09:25:10 -08:00
Kevin Sawicki bd76242851 Prepare 0.143 2014-11-06 09:03:35 -08:00
Max Brunsfeld d85c07e7e2 Don't wrap undo/redo calls in transactions 2014-11-05 16:59:06 -08:00
Max Brunsfeld 4077e791c9 Update signature of calls to TextBuffer::transact 2014-11-05 15:58:13 -08:00
Max Brunsfeld e7eef89fa5 Remove TextEditor::withGroupingInterval
Just use ::transact
2014-11-05 15:58:13 -08:00
Max Brunsfeld 5437236304 Use undo grouping in editor command listeners 2014-11-05 15:58:13 -08:00
Max Brunsfeld b7aa421e4e Add TextEditor::withGroupingInterval
This method temporarily instructs the editor to apply undo grouping with
a given interval. This way, undo grouping can be made optional without
adding optional arguments to every buffer manipulation method.
2014-11-05 15:58:12 -08:00
19 arquivos alterados com 233 adições e 202 exclusões
+16 -4
Ver Arquivo
@@ -123,10 +123,22 @@ getAtomDraftRelease = (callback) ->
logError('Fetching atom/atom releases failed', error, releases)
callback(error)
else
for release in releases when release.draft
callback(null, release)
return
callback(new Error('No draft release in atom/atom repo'))
[firstDraft] = releases.filter ({draft}) -> draft
if firstDraft?
options =
uri: firstDraft.assets_url
method: 'GET'
headers: defaultHeaders
json: true
request options, (error, response, assets=[]) ->
if error? or response.statusCode isnt 200
logError('Fetching draft release assets failed', error, assets)
callback(error ? new Error(response.statusCode))
else
firstDraft.assets = assets
callback(null, firstDraft)
else
callback(new Error('No draft release in atom/atom repo'))
deleteRelease = (release) ->
options =
+4 -7
Ver Arquivo
@@ -4,11 +4,8 @@
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to make opened Markdown files always be soft wrapped:
# An example hack to log to the console when each text editor is saved.
#
# path = require 'path'
#
# atom.workspaceView.eachEditorView (editorView) ->
# editor = editorView.getEditor()
# if path.extname(editor.getPath()) is '.md'
# editor.setSoftWrapped(true)
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
# console.log "Saved! #{editor.getPath()}"
+1 -1
Ver Arquivo
@@ -12,7 +12,7 @@
# 'atom-text-editor':
# 'enter': 'editor:newline'
#
# '.workspace':
# 'atom-workspace':
# 'ctrl-shift-p': 'core:move-up'
# 'ctrl-p': 'core:move-down'
#
+13 -13
Ver Arquivo
@@ -1,7 +1,7 @@
{
"name": "atom",
"productName": "Atom",
"version": "0.142.0",
"version": "0.144.0",
"description": "A hackable text editor for the 21st Century.",
"main": "./src/browser/main.js",
"repository": {
@@ -20,7 +20,7 @@
"atomShellVersion": "0.19.1",
"dependencies": {
"async": "0.2.6",
"atom-keymap": "^2.2.1",
"atom-keymap": "^2.2.2",
"bootstrap": "git+https://github.com/atom/bootstrap.git#6af81906189f1747fd6c93479e3d998ebe041372",
"clear-cut": "0.4.0",
"coffee-script": "1.7.0",
@@ -56,9 +56,9 @@
"season": "^1.0.2",
"semver": "2.2.1",
"serializable": "^1",
"space-pen": "3.8.0",
"space-pen": "3.8.1",
"temp": "0.7.0",
"text-buffer": "^3.5.1",
"text-buffer": "^3.6.0",
"theorist": "^1.0.2",
"underscore-plus": "^1.6.1",
"vm-compatibility-layer": "0.1.0"
@@ -77,16 +77,16 @@
"autoflow": "0.18.0",
"autosave": "0.18.0",
"background-tips": "0.17.0",
"bookmarks": "0.28.0",
"bookmarks": "0.30.0",
"bracket-matcher": "0.62.0",
"command-palette": "0.27.0",
"deprecation-cop": "0.11.0",
"dev-live-reload": "0.35.0",
"encoding-selector": "0.5.0",
"exception-reporting": "0.20.0",
"find-and-replace": "0.143.0",
"find-and-replace": "0.145.0",
"fuzzy-finder": "0.60.0",
"git-diff": "0.42.0",
"git-diff": "0.43.0",
"go-to-line": "0.26.0",
"grammar-selector": "0.37.0",
"image-view": "0.40.0",
@@ -94,11 +94,11 @@
"keybinding-resolver": "0.20.0",
"link": "0.26.0",
"markdown-preview": "0.109.0",
"metrics": "0.37.0",
"metrics": "0.38.0",
"open-on-github": "0.30.0",
"package-generator": "0.32.0",
"release-notes": "0.36.0",
"settings-view": "0.154.0",
"settings-view": "0.156.0",
"snippets": "0.56.0",
"spell-check": "0.43.0",
"status-bar": "0.46.0",
@@ -113,7 +113,7 @@
"wrap-guide": "0.23.0",
"language-c": "0.30.0",
"language-coffee-script": "0.37.0",
"language-css": "0.21.0",
"language-css": "0.22.0",
"language-gfm": "0.53.0",
"language-git": "0.9.0",
"language-go": "0.19.0",
@@ -129,11 +129,11 @@
"language-perl": "0.9.0",
"language-php": "0.18.0",
"language-property-list": "0.7.0",
"language-python": "0.22.0",
"language-python": "0.23.0",
"language-ruby": "0.41.0",
"language-ruby-on-rails": "0.18.0",
"language-sass": "0.24.0",
"language-shellscript": "0.9.0",
"language-sass": "0.25.0",
"language-shellscript": "0.10.0",
"language-source": "0.8.0",
"language-sql": "0.11.0",
"language-text": "0.6.0",
+25
Ver Arquivo
@@ -1924,6 +1924,31 @@ describe "TextEditorComponent", ->
expect(nextAnimationFrame).toBe noAnimationFrame
expect(editor.lineTextForBufferRow(0)).toBe 'var quicksort = function () {'
it "groups events that occur close together in time into single undo entries", ->
currentTime = 0
spyOn(Date, 'now').andCallFake -> currentTime
atom.config.set('editor.undoGroupingInterval', 100)
editor.setText("")
componentNode.dispatchEvent(buildTextInputEvent(data: 'x', target: inputNode))
currentTime += 99
componentNode.dispatchEvent(buildTextInputEvent(data: 'y', target: inputNode))
currentTime += 99
componentNode.dispatchEvent(new CustomEvent('editor:duplicate-lines', bubbles: true, cancelable: true))
currentTime += 100
componentNode.dispatchEvent(new CustomEvent('editor:duplicate-lines', bubbles: true, cancelable: true))
expect(editor.getText()).toBe "xy\nxy\nxy"
componentNode.dispatchEvent(new CustomEvent('core:undo', bubbles: true, cancelable: true))
expect(editor.getText()).toBe "xy\nxy"
componentNode.dispatchEvent(new CustomEvent('core:undo', bubbles: true, cancelable: true))
expect(editor.getText()).toBe ""
describe "when IME composition is used to insert international characters", ->
inputNode = null
+5
Ver Arquivo
@@ -105,6 +105,11 @@ module.exports =
scrollPastEnd:
type: 'boolean'
default: false
undoGroupingInterval:
type: 'integer'
default: 500
minimum: 0
description: 'Time interval in milliseconds within which operations will be grouped together in the undo history'
useHardwareAcceleration:
type: 'boolean'
default: true
+3 -4
Ver Arquivo
@@ -735,9 +735,7 @@ class DisplayBuffer extends Model
#
# Returns a {Point}.
screenPositionForBufferPosition: (bufferPosition, options) ->
# TODO: Expand this exception to cover all versions once we burn it in on non-release builds
if @isDestroyed() and not atom.isReleasedVersion()
throw new Error("This TextEditor has been destroyed")
throw new Error("This TextEditor has been destroyed") if @isDestroyed()
{ row, column } = @buffer.clipPosition(bufferPosition)
[startScreenRow, endScreenRow] = @rowMap.screenRowRangeForBufferRow(row)
@@ -1077,8 +1075,9 @@ class DisplayBuffer extends Model
destroyed: ->
marker.unsubscribe() for id, marker of @markers
@tokenizedBuffer.destroy()
@scopedConfigSubscriptions.dispose()
@unsubscribe()
@tokenizedBuffer.destroy()
logLines: (start=0, end=@getLastRow()) ->
for row in [start..end]
+2 -2
Ver Arquivo
@@ -228,7 +228,7 @@ class PackageManager
packages = []
for packagePath in @getAvailablePackagePaths()
name = path.basename(packagePath)
metadata = @getLoadedPackage(name)?.metadata ? Package.loadMetadata(packagePath, true)
metadata = @getLoadedPackage(name)?.metadata ? Package.loadMetadata(packagePath, {ignoreErrors: true, @resourcePath, @devMode})
packages.push(metadata)
packages
@@ -252,7 +252,7 @@ class PackageManager
@packageDependencies
hasAtomEngine: (packagePath) ->
metadata = Package.loadMetadata(packagePath, true)
metadata = Package.loadMetadata(packagePath, ignoreErrors: true)
metadata?.engines?.atom?
unobserveDisabledPackages: ->
+10 -7
Ver Arquivo
@@ -26,16 +26,19 @@ class Package
@stylesheetsDir: 'stylesheets'
@isBundledPackagePath: (packagePath) ->
if atom.packages.devMode
return false unless atom.packages.resourcePath.startsWith("#{process.resourcesPath}#{path.sep}")
@isBundledPackagePath: (packagePath, resourcePath, devMode) ->
resourcePath ?= atom?.packages.resourcePath
devMode ?= atom?.packages.devMode
@resourcePathWithTrailingSlash ?= "#{atom.packages.resourcePath}#{path.sep}"
packagePath?.startsWith(@resourcePathWithTrailingSlash)
if devMode
return false unless resourcePath.indexOf("#{process.resourcesPath}#{path.sep}") is 0
@loadMetadata: (packagePath, ignoreErrors=false) ->
@resourcePathWithTrailingSlash ?= "#{resourcePath}#{path.sep}"
packagePath?.indexOf(@resourcePathWithTrailingSlash) is 0
@loadMetadata: (packagePath, {ignoreErrors, devMode, resourcePath}={}) ->
packageName = path.basename(packagePath)
if @isBundledPackagePath(packagePath)
if @isBundledPackagePath(packagePath, resourcePath, devMode)
metadata = packagesCache[packageName]?.metadata
unless metadata?
if metadataPath = CSON.resolve(path.join(packagePath, 'package'))
+2 -8
Ver Arquivo
@@ -119,7 +119,7 @@ class PaneView extends View
deprecate 'Please return a Disposable object from your ::onDidChangeTitle method!' unless disposable?.dispose?
@activeItemDisposables.add(disposable) if disposable?.dispose?
else if item.on?
deprecate '::on methods for items are no longer supported. If you would like your item to support title change behavior, please implement a ::onDidChangeTitle() method.'
deprecate 'If you would like your pane item to support title change behavior, please implement a ::onDidChangeTitle() method. ::on methods for items are no longer supported. If not, ignore this message.'
disposable = item.on('title-changed', @activeItemTitleChanged)
@activeItemDisposables.add(disposable) if disposable?.dispose?
@@ -128,16 +128,10 @@ class PaneView extends View
deprecate 'Please return a Disposable object from your ::onDidChangeModified method!' unless disposable?.dispose?
@activeItemDisposables.add(disposable) if disposable?.dispose?
else if item.on?
deprecate '::on methods for items are no longer supported. If you would like your item to support modified behavior, please implement a ::onDidChangeModified() method.'
deprecate 'If you would like your pane item to support modified behavior, please implement a ::onDidChangeModified() method. If not, ignore this message. ::on methods for items are no longer supported.'
item.on('modified-status-changed', @activeItemModifiedChanged)
@activeItemDisposables.add(disposable) if disposable?.dispose?
view = @model.getView(item).__spacePenView
otherView.hide() for otherView in @itemViews.children().not(view).views()
@itemViews.append(view) unless view.parent().is(@itemViews)
view.show() if @attached
view.focus() if @hasFocus()
@trigger 'pane:active-item-changed', [item]
onItemAdded: ({item, index}) =>
+2 -1
Ver Arquivo
@@ -196,7 +196,8 @@ class Project extends Model
excludeVcsIgnores: atom.config.get('core.excludeVcsIgnoredPaths')
exclusions: atom.config.get('core.ignoredNames')
task = Task.once require.resolve('./scan-handler'), @getPath(), regex.source, searchOptions, ->
# TODO: need to support all paths in @getPaths()
task = Task.once require.resolve('./scan-handler'), @getPaths()[0], regex.source, searchOptions, ->
deferred.resolve()
task.on 'scan:result-found', (result) =>
+1 -1
Ver Arquivo
@@ -7,7 +7,7 @@ Subscriber.includeInto(SpacePen.View)
jQuery = SpacePen.jQuery
JQueryCleanData = jQuery.cleanData
jQuery.cleanData = (elements) ->
jQuery(element).view()?.unsubscribe() for element in elements
jQuery(element).view()?.unsubscribe?() for element in elements
JQueryCleanData(elements)
SpacePenCallRemoveHooks = SpacePen.callRemoveHooks
+3 -1
Ver Arquivo
@@ -457,7 +457,9 @@ TextEditorComponent = React.createClass
selectedLength = inputNode.selectionEnd - inputNode.selectionStart
editor.selectLeft() if selectedLength is 1
inputNode.value = event.data if editor.insertText(event.data)
insertedRange = editor.transact atom.config.get('editor.undoGroupingInterval'), ->
editor.insertText(event.data)
inputNode.value = event.data if insertedRange
onVerticalScroll: (scrollTop) ->
{editor} = @props
+112 -98
Ver Arquivo
@@ -134,115 +134,129 @@ class TextEditorElement extends HTMLElement
hasFocus: ->
this is document.activeElement or @contains(document.activeElement)
stopCommandEventPropagation = (commandListeners) ->
stopEventPropagation = (commandListeners) ->
newCommandListeners = {}
for commandName, commandListener of commandListeners
do (commandListener) ->
newCommandListeners[commandName] = (event) ->
event.stopPropagation()
commandListener.call(this, event)
commandListener.call(@getModel(), event)
newCommandListeners
atom.commands.add 'atom-text-editor', stopCommandEventPropagation(
'core:move-left': -> @getModel().moveLeft()
'core:move-right': -> @getModel().moveRight()
'core:select-left': -> @getModel().selectLeft()
'core:select-right': -> @getModel().selectRight()
'core:select-all': -> @getModel().selectAll()
'core:backspace': -> @getModel().backspace()
'core:delete': -> @getModel().delete()
'core:undo': -> @getModel().undo()
'core:redo': -> @getModel().redo()
'core:cut': -> @getModel().cutSelectedText()
'core:copy': -> @getModel().copySelectedText()
'core:paste': -> @getModel().pasteText()
'editor:move-to-previous-word': -> @getModel().moveToPreviousWord()
'editor:select-word': -> @getModel().selectWordsContainingCursors()
'editor:consolidate-selections': (event) -> event.abortKeyBinding() unless @getModel().consolidateSelections()
'editor:delete-to-beginning-of-word': -> @getModel().deleteToBeginningOfWord()
'editor:delete-to-beginning-of-line': -> @getModel().deleteToBeginningOfLine()
'editor:delete-to-end-of-line': -> @getModel().deleteToEndOfLine()
'editor:delete-to-end-of-word': -> @getModel().deleteToEndOfWord()
'editor:delete-line': -> @getModel().deleteLine()
'editor:cut-to-end-of-line': -> @getModel().cutToEndOfLine()
'editor:move-to-beginning-of-next-paragraph': -> @getModel().moveToBeginningOfNextParagraph()
'editor:move-to-beginning-of-previous-paragraph': -> @getModel().moveToBeginningOfPreviousParagraph()
'editor:move-to-beginning-of-screen-line': -> @getModel().moveToBeginningOfScreenLine()
'editor:move-to-beginning-of-line': -> @getModel().moveToBeginningOfLine()
'editor:move-to-end-of-screen-line': -> @getModel().moveToEndOfScreenLine()
'editor:move-to-end-of-line': -> @getModel().moveToEndOfLine()
'editor:move-to-first-character-of-line': -> @getModel().moveToFirstCharacterOfLine()
'editor:move-to-beginning-of-word': -> @getModel().moveToBeginningOfWord()
'editor:move-to-end-of-word': -> @getModel().moveToEndOfWord()
'editor:move-to-beginning-of-next-word': -> @getModel().moveToBeginningOfNextWord()
'editor:move-to-previous-word-boundary': -> @getModel().moveToPreviousWordBoundary()
'editor:move-to-next-word-boundary': -> @getModel().moveToNextWordBoundary()
'editor:select-to-beginning-of-next-paragraph': -> @getModel().selectToBeginningOfNextParagraph()
'editor:select-to-beginning-of-previous-paragraph': -> @getModel().selectToBeginningOfPreviousParagraph()
'editor:select-to-end-of-line': -> @getModel().selectToEndOfLine()
'editor:select-to-beginning-of-line': -> @getModel().selectToBeginningOfLine()
'editor:select-to-end-of-word': -> @getModel().selectToEndOfWord()
'editor:select-to-beginning-of-word': -> @getModel().selectToBeginningOfWord()
'editor:select-to-beginning-of-next-word': -> @getModel().selectToBeginningOfNextWord()
'editor:select-to-next-word-boundary': -> @getModel().selectToNextWordBoundary()
'editor:select-to-previous-word-boundary': -> @getModel().selectToPreviousWordBoundary()
'editor:select-to-first-character-of-line': -> @getModel().selectToFirstCharacterOfLine()
'editor:select-line': -> @getModel().selectLinesContainingCursors()
'editor:transpose': -> @getModel().transpose()
'editor:upper-case': -> @getModel().upperCase()
'editor:lower-case': -> @getModel().lowerCase()
stopEventPropagationAndGroupUndo = (commandListeners) ->
newCommandListeners = {}
for commandName, commandListener of commandListeners
do (commandListener) ->
newCommandListeners[commandName] = (event) ->
event.stopPropagation()
model = @getModel()
model.transact atom.config.get('editor.undoGroupingInterval'), ->
commandListener.call(model, event)
newCommandListeners
atom.commands.add 'atom-text-editor', stopEventPropagation(
'core:undo': -> @undo()
'core:redo': -> @redo()
)
atom.commands.add 'atom-text-editor:not(.mini)', stopCommandEventPropagation(
'core:move-up': -> @getModel().moveUp()
'core:move-down': -> @getModel().moveDown()
'core:move-to-top': -> @getModel().moveToTop()
'core:move-to-bottom': -> @getModel().moveToBottom()
'core:page-up': -> @getModel().pageUp()
'core:page-down': -> @getModel().pageDown()
'core:select-up': -> @getModel().selectUp()
'core:select-down': -> @getModel().selectDown()
'core:select-to-top': -> @getModel().selectToTop()
'core:select-to-bottom': -> @getModel().selectToBottom()
'core:select-page-up': -> @getModel().selectPageUp()
'core:select-page-down': -> @getModel().selectPageDown()
'editor:indent': -> @getModel().indent()
'editor:auto-indent': -> @getModel().autoIndentSelectedRows()
'editor:indent-selected-rows': -> @getModel().indentSelectedRows()
'editor:outdent-selected-rows': -> @getModel().outdentSelectedRows()
'editor:newline': -> @getModel().insertNewline()
'editor:newline-below': -> @getModel().insertNewlineBelow()
'editor:newline-above': -> @getModel().insertNewlineAbove()
'editor:add-selection-below': -> @getModel().addSelectionBelow()
'editor:add-selection-above': -> @getModel().addSelectionAbove()
'editor:split-selections-into-lines': -> @getModel().splitSelectionsIntoLines()
'editor:toggle-soft-tabs': -> @getModel().toggleSoftTabs()
'editor:toggle-soft-wrap': -> @getModel().toggleSoftWrapped()
'editor:fold-all': -> @getModel().foldAll()
'editor:unfold-all': -> @getModel().unfoldAll()
'editor:fold-current-row': -> @getModel().foldCurrentRow()
'editor:unfold-current-row': -> @getModel().unfoldCurrentRow()
'editor:fold-selection': -> @getModel().foldSelectedLines()
'editor:fold-at-indent-level-1': -> @getModel().foldAllAtIndentLevel(0)
'editor:fold-at-indent-level-2': -> @getModel().foldAllAtIndentLevel(1)
'editor:fold-at-indent-level-3': -> @getModel().foldAllAtIndentLevel(2)
'editor:fold-at-indent-level-4': -> @getModel().foldAllAtIndentLevel(3)
'editor:fold-at-indent-level-5': -> @getModel().foldAllAtIndentLevel(4)
'editor:fold-at-indent-level-6': -> @getModel().foldAllAtIndentLevel(5)
'editor:fold-at-indent-level-7': -> @getModel().foldAllAtIndentLevel(6)
'editor:fold-at-indent-level-8': -> @getModel().foldAllAtIndentLevel(7)
'editor:fold-at-indent-level-9': -> @getModel().foldAllAtIndentLevel(8)
'editor:toggle-line-comments': -> @getModel().toggleLineCommentsInSelection()
'editor:log-cursor-scope': -> @getModel().logCursorScope()
'editor:checkout-head-revision': -> atom.project.getRepositories()[0]?.checkoutHeadForEditor(@getModel())
'editor:copy-path': -> @getModel().copyPathToClipboard()
'editor:move-line-up': -> @getModel().moveLineUp()
'editor:move-line-down': -> @getModel().moveLineDown()
'editor:duplicate-lines': -> @getModel().duplicateLines()
'editor:join-lines': -> @getModel().joinLines()
atom.commands.add 'atom-text-editor', stopEventPropagationAndGroupUndo(
'core:move-left': -> @moveLeft()
'core:move-right': -> @moveRight()
'core:select-left': -> @selectLeft()
'core:select-right': -> @selectRight()
'core:select-all': -> @selectAll()
'core:backspace': -> @backspace()
'core:delete': -> @delete()
'core:cut': -> @cutSelectedText()
'core:copy': -> @copySelectedText()
'core:paste': -> @pasteText()
'editor:move-to-previous-word': -> @moveToPreviousWord()
'editor:select-word': -> @selectWordsContainingCursors()
'editor:consolidate-selections': (event) -> event.abortKeyBinding() unless @consolidateSelections()
'editor:delete-to-beginning-of-word': -> @deleteToBeginningOfWord()
'editor:delete-to-beginning-of-line': -> @deleteToBeginningOfLine()
'editor:delete-to-end-of-line': -> @deleteToEndOfLine()
'editor:delete-to-end-of-word': -> @deleteToEndOfWord()
'editor:delete-line': -> @deleteLine()
'editor:cut-to-end-of-line': -> @cutToEndOfLine()
'editor:move-to-beginning-of-next-paragraph': -> @moveToBeginningOfNextParagraph()
'editor:move-to-beginning-of-previous-paragraph': -> @moveToBeginningOfPreviousParagraph()
'editor:move-to-beginning-of-screen-line': -> @moveToBeginningOfScreenLine()
'editor:move-to-beginning-of-line': -> @moveToBeginningOfLine()
'editor:move-to-end-of-screen-line': -> @moveToEndOfScreenLine()
'editor:move-to-end-of-line': -> @moveToEndOfLine()
'editor:move-to-first-character-of-line': -> @moveToFirstCharacterOfLine()
'editor:move-to-beginning-of-word': -> @moveToBeginningOfWord()
'editor:move-to-end-of-word': -> @moveToEndOfWord()
'editor:move-to-beginning-of-next-word': -> @moveToBeginningOfNextWord()
'editor:move-to-previous-word-boundary': -> @moveToPreviousWordBoundary()
'editor:move-to-next-word-boundary': -> @moveToNextWordBoundary()
'editor:select-to-beginning-of-next-paragraph': -> @selectToBeginningOfNextParagraph()
'editor:select-to-beginning-of-previous-paragraph': -> @selectToBeginningOfPreviousParagraph()
'editor:select-to-end-of-line': -> @selectToEndOfLine()
'editor:select-to-beginning-of-line': -> @selectToBeginningOfLine()
'editor:select-to-end-of-word': -> @selectToEndOfWord()
'editor:select-to-beginning-of-word': -> @selectToBeginningOfWord()
'editor:select-to-beginning-of-next-word': -> @selectToBeginningOfNextWord()
'editor:select-to-next-word-boundary': -> @selectToNextWordBoundary()
'editor:select-to-previous-word-boundary': -> @selectToPreviousWordBoundary()
'editor:select-to-first-character-of-line': -> @selectToFirstCharacterOfLine()
'editor:select-line': -> @selectLinesContainingCursors()
'editor:transpose': -> @transpose()
'editor:upper-case': -> @upperCase()
'editor:lower-case': -> @lowerCase()
)
atom.commands.add 'atom-text-editor:not(.mini)', stopEventPropagationAndGroupUndo(
'core:move-up': -> @moveUp()
'core:move-down': -> @moveDown()
'core:move-to-top': -> @moveToTop()
'core:move-to-bottom': -> @moveToBottom()
'core:page-up': -> @pageUp()
'core:page-down': -> @pageDown()
'core:select-up': -> @selectUp()
'core:select-down': -> @selectDown()
'core:select-to-top': -> @selectToTop()
'core:select-to-bottom': -> @selectToBottom()
'core:select-page-up': -> @selectPageUp()
'core:select-page-down': -> @selectPageDown()
'editor:indent': -> @indent()
'editor:auto-indent': -> @autoIndentSelectedRows()
'editor:indent-selected-rows': -> @indentSelectedRows()
'editor:outdent-selected-rows': -> @outdentSelectedRows()
'editor:newline': -> @insertNewline()
'editor:newline-below': -> @insertNewlineBelow()
'editor:newline-above': -> @insertNewlineAbove()
'editor:add-selection-below': -> @addSelectionBelow()
'editor:add-selection-above': -> @addSelectionAbove()
'editor:split-selections-into-lines': -> @splitSelectionsIntoLines()
'editor:toggle-soft-tabs': -> @toggleSoftTabs()
'editor:toggle-soft-wrap': -> @toggleSoftWrapped()
'editor:fold-all': -> @foldAll()
'editor:unfold-all': -> @unfoldAll()
'editor:fold-current-row': -> @foldCurrentRow()
'editor:unfold-current-row': -> @unfoldCurrentRow()
'editor:fold-selection': -> @foldSelectedLines()
'editor:fold-at-indent-level-1': -> @foldAllAtIndentLevel(0)
'editor:fold-at-indent-level-2': -> @foldAllAtIndentLevel(1)
'editor:fold-at-indent-level-3': -> @foldAllAtIndentLevel(2)
'editor:fold-at-indent-level-4': -> @foldAllAtIndentLevel(3)
'editor:fold-at-indent-level-5': -> @foldAllAtIndentLevel(4)
'editor:fold-at-indent-level-6': -> @foldAllAtIndentLevel(5)
'editor:fold-at-indent-level-7': -> @foldAllAtIndentLevel(6)
'editor:fold-at-indent-level-8': -> @foldAllAtIndentLevel(7)
'editor:fold-at-indent-level-9': -> @foldAllAtIndentLevel(8)
'editor:toggle-line-comments': -> @toggleLineCommentsInSelection()
'editor:log-cursor-scope': -> @logCursorScope()
'editor:checkout-head-revision': -> atom.project.getRepositories()[0]?.checkoutHeadForEditor(this)
'editor:copy-path': -> @copyPathToClipboard()
'editor:move-line-up': -> @moveLineUp()
'editor:move-line-down': -> @moveLineDown()
'editor:duplicate-lines': -> @duplicateLines()
'editor:join-lines': -> @joinLines()
'editor:toggle-indent-guide': -> atom.config.set('editor.showIndentGuide', not atom.config.get('editor.showIndentGuide'))
'editor:toggle-line-numbers': -> atom.config.set('editor.showLineNumbers', not atom.config.get('editor.showLineNumbers'))
'editor:scroll-to-cursor': -> @getModel().scrollToCursorPosition()
'editor:scroll-to-cursor': -> @scrollToCursorPosition()
)
module.exports = TextEditorElement = document.registerElement 'atom-text-editor', prototype: TextEditorElement.prototype
+10 -2
Ver Arquivo
@@ -175,6 +175,7 @@ class TextEditor extends Model
destroyed: ->
@unsubscribe()
@scopedConfigSubscriptions.dispose()
selection.destroy() for selection in @getSelections()
@buffer.release()
@displayBuffer.destroy()
@@ -1096,8 +1097,10 @@ class TextEditor extends Model
# abort the transaction, call {::abortTransaction} to terminate the function's
# execution and revert any changes performed up to the abortion.
#
# * `groupingInterval` (optional) This is the sames as the `groupingInterval`
# parameter in {::beginTransaction}
# * `fn` A {Function} to call inside the transaction.
transact: (fn) -> @buffer.transact(fn)
transact: (groupingInterval, fn) -> @buffer.transact(groupingInterval, fn)
# Extended: Start an open-ended transaction.
#
@@ -1105,7 +1108,12 @@ class TextEditor extends Model
# transaction. If you nest calls to transactions, only the outermost
# transaction is considered. You must match every begin with a matching
# commit, but a single call to abort will cancel all nested transactions.
beginTransaction: -> @buffer.beginTransaction()
#
# * `groupingInterval` (optional) The {Number} of milliseconds for which this
# transaction should be considered 'groupable' after it begins. If a transaction
# with a positive `groupingInterval` is committed while the previous transaction is
# still 'groupable', the two transactions are merged with respect to undo and redo.
beginTransaction: (groupingInterval) -> @buffer.beginTransaction(groupingInterval)
# Extended: Commit an open-ended transaction started with {::beginTransaction}
# and push it to the undo stack.
+1 -1
Ver Arquivo
@@ -315,7 +315,7 @@ class Workspace extends Model
when 'editor-created'
deprecate("Use Workspace::onDidAddTextEditor or Workspace::observeTextEditors instead.")
when 'uri-opened'
deprecate("Use Workspace::onDidAddPaneItem instead.")
deprecate("Use Workspace::onDidOpen or Workspace::onDidAddPaneItem instead. https://atom.io/docs/api/latest/Workspace#instance-onDidOpen")
else
deprecate("Subscribing via ::on is deprecated. Use documented event subscription methods instead.")
+1
Ver Arquivo
@@ -25,6 +25,7 @@
.panel-heading {
margin: 0;
padding: @component-padding;
border-radius: 0;
+21 -51
Ver Arquivo
@@ -28,6 +28,13 @@
z-index: 4;
pointer-events: none;
box-sizing: border-box;
position: absolute;
border-left: 1px solid;
opacity: 0;
}
.is-focused .cursor {
opacity: 1;
}
.cursors.blink-off .cursor {
@@ -44,6 +51,7 @@
overflow-x: auto;
overflow-y: hidden;
z-index: 3;
cursor: default;
.scrollbar-content {
height: 15px;
@@ -51,7 +59,16 @@
}
.vertical-scrollbar {
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 15px;
overflow-x: hidden;
overflow-y: auto;
z-index: 3;
cursor: default;
}
.scrollbar-corner {
@@ -64,11 +81,9 @@
.scroll-view {
overflow: hidden;
z-index: 0;
}
.scroll-view-content {
-webkit-flex: 1;
min-width: 0;
position: relative;
width: 100%;
}
.gutter {
@@ -175,7 +190,7 @@
opacity: 1;
}
atom-text-editor::shadow.is-blurred .line.cursor-line {
.editor.is-blurred .line.cursor-line {
background: rgba(0, 0, 0, 0);
}
@@ -189,31 +204,7 @@ atom-text-editor::shadow.is-blurred .line.cursor-line {
box-shadow: inset 1px 0;
}
.vertical-scrollbar,
.horizontal-scrollbar {
cursor: default;
}
.vertical-scrollbar {
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 15px;
overflow-y: auto;
z-index: 3;
}
.scroll-view {
overflow-x: auto;
overflow-y: hidden;
-webkit-flex: 1;
min-width: 0;
position: relative;
}
atom-text-editor::shadow.soft-wrap .scroll-view {
.editor.soft-wrap .scroll-view {
overflow-x: hidden;
}
@@ -241,27 +232,6 @@ atom-text-editor::shadow.soft-wrap .scroll-view {
vertical-align: top;
}
.cursor {
position: absolute;
border-left: 1px solid;
}
.cursor {
visibility: hidden;
}
.is-focused .cursor {
visibility: visible;
}
.is-focused .cursor.blink-off {
visibility: hidden;
}
.cursor.hidden-cursor {
display: none;
}
.hidden-input {
padding: 0;
border: 0;
+1 -1
Ver Arquivo
@@ -141,7 +141,7 @@ jasmine.JQuery.matchersClass = {};
if (this.actual instanceof HTMLElement) {
this.actual = jQuery(this.actual);
}
if (this.actual instanceof jQuery) {
if (this.actual && this.actual.jquery) {
var result = jQueryMatchers[methodName].apply(this, arguments);
this.actual = jasmine.JQuery.elementToString(this.actual);
return result;