diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index 73ff2f50d..8144a4b62 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -1,8 +1,8 @@ ### Prerequisites -* [ ] Can you reproduce the problem in [safe mode](https://atom.io/docs/latest/hacking-atom-debugging#check-if-the-problem-shows-up-in-safe-mode)? -* [ ] Are you running the [latest version of Atom](https://atom.io/docs/latest/hacking-atom-debugging#update-to-the-latest-version)? -* [ ] Did you check the [debugging guide](https://atom.io/docs/latest/hacking-atom-debugging)? +* [ ] Can you reproduce the problem in [safe mode](http://flight-manual.atom.io/hacking-atom/sections/debugging/#check-if-the-problem-shows-up-in-safe-mode)? +* [ ] Are you running the [latest version of Atom](http://flight-manual.atom.io/hacking-atom/sections/debugging/#update-to-the-latest-version)? +* [ ] Did you check the [debugging guide](flight-manual.atom.io/hacking-atom/sections/debugging/)? * [ ] Did you check the [FAQs on Discuss](https://discuss.atom.io/c/faq)? * [ ] Are you reporting to the [correct repository](https://github.com/atom/atom/blob/master/CONTRIBUTING.md#atom-and-packages)? * [ ] Did you [perform a cursory search](https://github.com/issues?q=is%3Aissue+user%3Aatom+-repo%3Aatom%2Felectron) to see if your bug or enhancement is already reported? diff --git a/package.json b/package.json index 8b1a6187a..5a8b87319 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "service-hub": "^0.7.0", "source-map-support": "^0.3.2", "temp": "0.8.1", - "text-buffer": "8.4.2", + "text-buffer": "8.4.3", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.6", "yargs": "^3.23.0" @@ -105,7 +105,7 @@ "open-on-github": "1.0.1", "package-generator": "1.0.0", "settings-view": "0.235.1", - "snippets": "1.0.1", + "snippets": "1.0.2", "spell-check": "0.67.0", "status-bar": "1.2.0", "styleguide": "0.45.2", @@ -141,14 +141,14 @@ "language-ruby": "0.68.3", "language-ruby-on-rails": "0.25.0", "language-sass": "0.46.0", - "language-shellscript": "0.21.0", + "language-shellscript": "0.21.1", "language-source": "0.9.0", "language-sql": "0.20.0", "language-text": "0.7.1", "language-todo": "0.27.0", "language-toml": "0.18.0", "language-xml": "0.34.4", - "language-yaml": "0.25.1" + "language-yaml": "0.25.2" }, "private": true, "scripts": { diff --git a/spec/text-editor-component-spec.js b/spec/text-editor-component-spec.js index 37a9751e1..1d1e4eb9f 100644 --- a/spec/text-editor-component-spec.js +++ b/spec/text-editor-component-spec.js @@ -1840,17 +1840,22 @@ describe('TextEditorComponent', function () { expect(component.lineNodeForScreenRow(2).dataset.screenRow).toBe("2") }) - it('measures block decorations taking into account both top and bottom margins', async function () { + it('measures block decorations taking into account both top and bottom margins of the element and its children', async function () { let [item, blockDecoration] = createBlockDecorationBeforeScreenRow(0, {className: "decoration-1"}) + let child = document.createElement("div") + child.style.height = "7px" + child.style.width = "30px" + child.style.marginBottom = "20px" + item.appendChild(child) atom.styles.addStyleSheet( - 'atom-text-editor .decoration-1 { width: 30px; height: 30px; margin-top: 10px; margin-bottom: 5px; }', + 'atom-text-editor .decoration-1 { width: 30px; margin-top: 10px; }', {context: 'atom-text-editor'} ) await nextAnimationFramePromise() // causes the DOM to update and to retrieve new styles await nextAnimationFramePromise() // applies the changes - expect(component.tileNodesForLines()[0].style.height).toBe(TILE_SIZE * editor.getLineHeightInPixels() + 30 + 10 + 5 + "px") + expect(component.tileNodesForLines()[0].style.height).toBe(TILE_SIZE * editor.getLineHeightInPixels() + 10 + 7 + 20 + "px") expect(component.tileNodesForLines()[0].style.webkitTransform).toBe("translate3d(0px, 0px, 0px)") expect(component.tileNodesForLines()[1].style.height).toBe(TILE_SIZE * editor.getLineHeightInPixels() + "px") expect(component.tileNodesForLines()[1].style.webkitTransform).toBe(`translate3d(0px, ${component.tileNodesForLines()[0].offsetHeight}px, 0px)`) diff --git a/src/block-decorations-component.coffee b/src/block-decorations-component.coffee index 0cfa7974f..35aec3921 100644 --- a/src/block-decorations-component.coffee +++ b/src/block-decorations-component.coffee @@ -26,7 +26,10 @@ class BlockDecorationsComponent for id, blockDecorationState of @oldState.blockDecorations unless @newState.blockDecorations.hasOwnProperty(id) - @blockDecorationNodesById[id].remove() + blockDecorationNode = @blockDecorationNodesById[id] + blockDecorationNode.previousSibling.remove() + blockDecorationNode.nextSibling.remove() + blockDecorationNode.remove() delete @blockDecorationNodesById[id] delete @oldState.blockDecorations[id] @@ -41,19 +44,27 @@ class BlockDecorationsComponent for decorationId, blockDecorationNode of @blockDecorationNodesById style = getComputedStyle(blockDecorationNode) decoration = @newState.blockDecorations[decorationId].decoration - marginBottom = parseInt(style.marginBottom) ? 0 - marginTop = parseInt(style.marginTop) ? 0 - @presenter.setBlockDecorationDimensions( - decoration, - blockDecorationNode.offsetWidth, - blockDecorationNode.offsetHeight + marginTop + marginBottom - ) + topRuler = blockDecorationNode.previousSibling + bottomRuler = blockDecorationNode.nextSibling + + width = blockDecorationNode.offsetWidth + height = bottomRuler.offsetTop - topRuler.offsetTop + @presenter.setBlockDecorationDimensions(decoration, width, height) createAndAppendBlockDecorationNode: (id) -> blockDecorationState = @newState.blockDecorations[id] + blockDecorationClass = "atom--block-decoration-#{id}" + topRuler = document.createElement("div") blockDecorationNode = @views.getView(blockDecorationState.decoration.getProperties().item) - blockDecorationNode.id = "atom--block-decoration-#{id}" + bottomRuler = document.createElement("div") + topRuler.classList.add(blockDecorationClass) + blockDecorationNode.classList.add(blockDecorationClass) + bottomRuler.classList.add(blockDecorationClass) + + @container.appendChild(topRuler) @container.appendChild(blockDecorationNode) + @container.appendChild(bottomRuler) + @blockDecorationNodesById[id] = blockDecorationNode @updateBlockDecorationNode(id) @@ -63,9 +74,13 @@ class BlockDecorationsComponent blockDecorationNode = @blockDecorationNodesById[id] if newBlockDecorationState.isVisible + blockDecorationNode.previousSibling.classList.remove("atom--invisible-block-decoration") blockDecorationNode.classList.remove("atom--invisible-block-decoration") + blockDecorationNode.nextSibling.classList.remove("atom--invisible-block-decoration") else + blockDecorationNode.previousSibling.classList.add("atom--invisible-block-decoration") blockDecorationNode.classList.add("atom--invisible-block-decoration") + blockDecorationNode.nextSibling.classList.add("atom--invisible-block-decoration") if oldBlockDecorationState.screenRow isnt newBlockDecorationState.screenRow blockDecorationNode.dataset.screenRow = newBlockDecorationState.screenRow diff --git a/src/default-directory-provider.coffee b/src/default-directory-provider.coffee index 6b05a582f..ed4e9ba36 100644 --- a/src/default-directory-provider.coffee +++ b/src/default-directory-provider.coffee @@ -16,8 +16,8 @@ class DefaultDirectoryProvider # * `null` if the given URI is not compatibile with this provider. directoryForURISync: (uri) -> normalizedPath = path.normalize(uri) - {protocol} = url.parse(uri) - directoryPath = if protocol? + {host} = url.parse(uri) + directoryPath = if host uri else if not fs.isDirectorySync(normalizedPath) and fs.isDirectorySync(path.dirname(normalizedPath)) path.dirname(normalizedPath) @@ -26,7 +26,7 @@ class DefaultDirectoryProvider # TODO: Stop normalizing the path in pathwatcher's Directory. directory = new Directory(directoryPath) - if protocol? + if host directory.path = directoryPath if fs.isCaseInsensitive() directory.lowerCasePath = directoryPath.toLowerCase() diff --git a/src/lines-tile-component.coffee b/src/lines-tile-component.coffee index defcc0d8a..f4a7313ca 100644 --- a/src/lines-tile-component.coffee +++ b/src/lines-tile-component.coffee @@ -149,7 +149,7 @@ class LinesTileComponent if newLineState.screenRow isnt oldLineState.screenRow insertionPoint.dataset.screenRow = newLineState.screenRow - precedingBlockDecorationsSelector = newLineState.precedingBlockDecorations.map((d) -> "#atom--block-decoration-#{d.id}").join(',') + precedingBlockDecorationsSelector = newLineState.precedingBlockDecorations.map((d) -> ".atom--block-decoration-#{d.id}").join(',') if precedingBlockDecorationsSelector isnt oldLineState.precedingBlockDecorationsSelector insertionPoint.setAttribute("select", precedingBlockDecorationsSelector) @@ -180,7 +180,7 @@ class LinesTileComponent if newLineState.screenRow isnt oldLineState.screenRow insertionPoint.dataset.screenRow = newLineState.screenRow - followingBlockDecorationsSelector = newLineState.followingBlockDecorations.map((d) -> "#atom--block-decoration-#{d.id}").join(',') + followingBlockDecorationsSelector = newLineState.followingBlockDecorations.map((d) -> ".atom--block-decoration-#{d.id}").join(',') if followingBlockDecorationsSelector isnt oldLineState.followingBlockDecorationsSelector insertionPoint.setAttribute("select", followingBlockDecorationsSelector) diff --git a/src/notification-manager.coffee b/src/notification-manager.coffee index 46c781c20..3d8b1895c 100644 --- a/src/notification-manager.coffee +++ b/src/notification-manager.coffee @@ -3,6 +3,9 @@ Notification = require '../src/notification' # Public: A notification manager used to create {Notification}s to be shown # to the user. +# +# An instance of this class is always available as the `atom.notifications` +# global. module.exports = class NotificationManager constructor: -> diff --git a/src/text-editor-element.coffee b/src/text-editor-element.coffee index 2a9b5e262..a0ec1b7fa 100644 --- a/src/text-editor-element.coffee +++ b/src/text-editor-element.coffee @@ -92,7 +92,7 @@ class TextEditorElement extends HTMLElement @emitter.emit("did-change-scroll-left", arguments...) initialize: (model, {@views, @config, @themes, @workspace, @assert, @styles, @grammars}, @autoHeight = true, @scrollPastEnd = true) -> - throw new Error("Must pass a config parameter when initializing TextEditorElements") unless @views? + throw new Error("Must pass a views parameter when initializing TextEditorElements") unless @views? throw new Error("Must pass a config parameter when initializing TextEditorElements") unless @config? throw new Error("Must pass a themes parameter when initializing TextEditorElements") unless @themes? throw new Error("Must pass a workspace parameter when initializing TextEditorElements") unless @workspace?