Merge branch 'master' of github.com:atom/atom

This commit is contained in:
Aerijo 2019-02-05 12:00:49 +10:00
commit cb27305550
33 changed files with 534 additions and 275 deletions

View File

@ -4,7 +4,7 @@
[![Dependency Status](https://david-dm.org/atom/atom.svg)](https://david-dm.org/atom/atom)
[![Join the Atom Community on Slack](https://atom-slack.herokuapp.com/badge.svg)](https://atom-slack.herokuapp.com)
Atom is a hackable text editor for the 21st century, built on [Electron](https://github.com/atom/electron), and based on everything we love about our favorite editors. We designed it to be deeply customizable, but still approachable using the default configuration.
Atom is a hackable text editor for the 21st century, built on [Electron](https://github.com/electron/electron), and based on everything we love about our favorite editors. We designed it to be deeply customizable, but still approachable using the default configuration.
![Atom](https://user-images.githubusercontent.com/378023/49132477-f4b77680-f31f-11e8-8357-ac6491761c6c.png)

5
apm/package-lock.json generated
View File

@ -21,7 +21,6 @@
"node-gyp": "3.4.0",
"npm": "6.2.0",
"open": "0.0.5",
"plist": "git+https://github.com/nathansobo/node-plist.git#bd3a93387f1d4b2cff819b200870d35465796e77",
"q": "~0.9.7",
"read": "~1.0.5",
"request": "^2.87.0",
@ -3974,7 +3973,7 @@
},
"plist": {
"version": "git+https://github.com/nathansobo/node-plist.git#bd3a93387f1d4b2cff819b200870d35465796e77",
"from": "git+https://github.com/nathansobo/node-plist.git",
"from": "git+https://github.com/nathansobo/node-plist.git#bd3a93387f1d4b2cff819b200870d35465796e77",
"requires": {
"xmlbuilder": "0.4.x",
"xmldom": "0.1.x"
@ -4500,7 +4499,7 @@
},
"xmlbuilder": {
"version": "0.4.3",
"resolved": "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-0.4.3.tgz",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-0.4.3.tgz",
"integrity": "sha1-xGFLp04K0ZbmCcknLNnh3bKKilg="
},
"xmldom": {

View File

@ -0,0 +1,44 @@
# Decoration ordering
## Status
Accepted
## Summary
Order block decoration items in the DOM in a deterministic and controllable way.
## Motivation
When multiple block decorations are created at the same screen line, they are inserted into the DOM in an order determined by the sequence of their creation; from oldest to newest when `position` is set to `"before"`, from newest to oldest when `position` is set to `"after"`. While this is deterministic, it is limited: it isn't possible to insert decorations within a sequence of existing ones, and it's difficult to control the order of decorations when creating and destroying and moving markers around an editor.
We hit the need for this in [atom/github#1913](https://github.com/atom/github/pull/1913) when we have a block decoration for multiple consecutive collapsed file patches.
## Explanation
[TextEditor::decorateMarker()](https://atom.io/docs/api/v1.34.0/TextEditor#instance-decorateMarker) accepts an additional `order` parameter in its `decorationParams` argument when `type` is "block". When multiple block or overlay decorations occur at the same screen line, they are ordered within the DOM in increasing "order" value.
Block decorations with the same `order` property are rendered in the order they were created, oldest to newest. Block decorations with no `order` property are rendered after those with one, in the order in which they were created, oldest to newest.
## Drawbacks
This is a breaking change for co-located block decorations created with an "after" position - they'll now appear in the reverse order.
When multiple packages create block decorations at the same screen line, they'll need to coordinate their `order` values to have expected behavior. There may not even be a clear, universal answer about how block decorations from distinct packages _should_ be ordered.
This adds another situational parameter to `TextEditor::decorationMarker()`, which already has complicated arguments.
## Rationale and alternatives
Originally I wanted to address the package coordination problem with a similar approach to [the way context menu items are ordered](https://github.com/atom/atom/pull/16661), by allowing individual decorations to specify constraints: "before this block," "after this block," "next to this block" and so forth. I ultimately chose to write up the simpler proposal because:
* Block decoration collisions among packages seem much less likely than context menu collisions.
* Constraint satisfaction problems are complex. There would be a relatively high chance of introducing bugs and performance regressions.
* The order number approach is similar to the APIs already offered to order status bar tiles and custom gutters.
The alternative to having an explicit API for this is at all is to create and destroy decorations to achieve the desired order. That's possible, but requires a great deal of bookkeeping on the package's side to accomplish, especially as decorations are added and removed and text is edited.
## Unresolved questions
- Should overlay decorations respect an `order` parameter in a similar fashion?
- Should screen column effect decoration ordering at all?

203
package-lock.json generated
View File

@ -5,15 +5,15 @@
"requires": true,
"dependencies": {
"@atom/nsfw": {
"version": "1.0.18",
"resolved": "https://registry.npmjs.org/@atom/nsfw/-/nsfw-1.0.18.tgz",
"integrity": "sha512-YceKV9a3X62mh4Q78Nyi8aTRaoVGdpeJBHogL8gxU17iBhEpYvxGgMfTe02j1hH2taFT4barkZ5RdZkGKIsJ/w==",
"version": "1.0.20",
"resolved": "https://registry.npmjs.org/@atom/nsfw/-/nsfw-1.0.20.tgz",
"integrity": "sha512-g/7g0xeqoqhnpb28GZr0I6h8q6sKzS83ic+e+40cD5GoEx8Gpo2MzlvrHvrkONGxckxnSmtcIGlon7YoT/UV3Q==",
"requires": {
"fs-extra": "^0.26.5",
"fs-extra": "^7.0.0",
"lodash.isinteger": "^4.0.4",
"lodash.isundefined": "^3.0.1",
"nan": "^2.0.0",
"promisify-node": "^0.3.0"
"nan": "^2.10.0",
"promisify-node": "^0.5.0"
}
},
"@atom/source-map-support": {
@ -157,7 +157,7 @@
"apparatus": {
"version": "0.0.10",
"resolved": "https://registry.npmjs.org/apparatus/-/apparatus-0.0.10.tgz",
"integrity": "sha1-gep1Z3Ktp3hj21TO7oICwQm9yj4=",
"integrity": "sha512-KLy/ugo33KZA7nugtQ7O0E1c8kQ52N3IvD/XgIh4w/Nr28ypfkwDfA67F1ev4N1m5D+BOk1+b2dEJDfpj/VvZg==",
"requires": {
"sylvester": ">= 0.0.8"
}
@ -348,7 +348,7 @@
"atom-pathspec": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/atom-pathspec/-/atom-pathspec-0.0.0.tgz",
"integrity": "sha1-Z6q6+VAZsK/Y4xWLLNexjXN2Q/E="
"integrity": "sha512-7UMEHdTtBV5sJONT0uMeQ6M8JFdfMQy/14rxuP6OuoFfSiDjxyZHuorIbv8gqhRB3FQMMLPzqONoFJE2cpHiCg=="
},
"atom-select-list": {
"version": "0.7.2",
@ -1082,8 +1082,8 @@
"integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE="
},
"bookmarks": {
"version": "https://www.atom.io/api/packages/bookmarks/versions/0.45.1/tarball",
"integrity": "sha512-BcKY7ujoJoQ6x0C0CPeV4e9cw0cqwjlKvCVh3T6XeDwZQ1Na8KMrjPHWp8dO7B1cnGFN1LCWWQGWqGH624Ymkw==",
"version": "https://www.atom.io/api/packages/bookmarks/versions/0.46.0/tarball",
"integrity": "sha512-ZgYwD3Diq6nkagxuorWuKXyUBMJUZjjK1ePEYUUEzh155QcD/H1k66RZ/SfO5HrWZ4fPN+j6ux/qoXcnD77Ntg==",
"requires": {
"atom-select-list": "^0.7.0"
}
@ -1157,14 +1157,6 @@
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz",
"integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg="
},
"cached-run-in-this-context": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/cached-run-in-this-context/-/cached-run-in-this-context-0.5.0.tgz",
"integrity": "sha512-FdtDP0u8WjetQ95nLz9vI06efJTFrmtmk5ZT6FECpyTKi9aakNLMHyMH21WRbGYyWlbmB/QlRoB/g1lcEpyjMw==",
"requires": {
"nan": "^2.10.0"
}
},
"camelcase": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz",
@ -1283,11 +1275,6 @@
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz",
"integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE="
},
"circular-json": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.5.7.tgz",
"integrity": "sha512-/pXoV1JA847qRKPrHbBK6YIBGFF8GOP4wzSgUOA7q0ew0vAv0iJswP+2/nZQ9uzA3Azi7eTrg9L2yzXc/7ZMIA=="
},
"classnames": {
"version": "2.2.6",
"resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.6.tgz",
@ -1588,9 +1575,9 @@
}
},
"date-format": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/date-format/-/date-format-1.2.0.tgz",
"integrity": "sha1-YV6CjiM90aubua4JUODOzPpuytg="
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/date-format/-/date-format-2.0.0.tgz",
"integrity": "sha512-M6UqVvZVgFYqZL1SfHsRGIQSz3ZL+qgbsV5Lp1Vj61LZVYuEwcMXYay7DRDtYs2HQQBK5hQtQ0fD9aEJ89V0LA=="
},
"debug": {
"version": "2.6.9",
@ -2169,8 +2156,8 @@
}
},
"find-and-replace": {
"version": "https://www.atom.io/api/packages/find-and-replace/versions/0.216.0/tarball",
"integrity": "sha512-VYt22i/fQf85rnfHnrL9uVriWGKtYljNq2BnPnvEm1yrkaklz10b0Sr2sIZ0WuQFO5q8N5NFbc9d/GPZuALwaA==",
"version": "https://www.atom.io/api/packages/find-and-replace/versions/0.218.0/tarball",
"integrity": "sha512-c77OpEcgce8cfPgjPQStEvK016AVmNMUfKIuCYgzYbjTik2lCSU+QAEG3q6MitIzqoFiSW6WW3FL502HFyZwKg==",
"requires": {
"binary-search": "^1.3.3",
"element-resize-detector": "^1.1.10",
@ -2216,6 +2203,11 @@
}
}
},
"flatted": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.0.tgz",
"integrity": "sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg=="
},
"flatten": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.2.tgz",
@ -2330,25 +2322,13 @@
"integrity": "sha1-a+Dem+mYzhavivwkSXue6bfM2a0="
},
"fs-extra": {
"version": "0.26.7",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.26.7.tgz",
"integrity": "sha1-muH92UiXeY7at20JGM9C0MMYT6k=",
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.0.tgz",
"integrity": "sha512-EglNDLRpmaTWiD/qraZn6HREAEAHJcJOmxNEYwq6xeMKnVMAy3GUcFB+wXt2C6k4CNvB/mP1y/U3dzvKKj5OtQ==",
"requires": {
"graceful-fs": "^4.1.2",
"jsonfile": "^2.1.0",
"klaw": "^1.0.0",
"path-is-absolute": "^1.0.0",
"rimraf": "^2.2.8"
},
"dependencies": {
"jsonfile": {
"version": "2.4.0",
"resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz",
"integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=",
"requires": {
"graceful-fs": "^4.1.6"
}
}
"jsonfile": "^4.0.0",
"universalify": "^0.1.0"
}
},
"fs-minipass": {
@ -2360,9 +2340,9 @@
}
},
"fs-plus": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/fs-plus/-/fs-plus-3.0.2.tgz",
"integrity": "sha1-a19Sp3EolMTd6f2PgfqMYN8EHz0=",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/fs-plus/-/fs-plus-3.1.1.tgz",
"integrity": "sha512-Se2PJdOWXqos1qVTkvqqjb0CSnfBnwwD+pq+z4ksT+e97mEShod/hrNg0TRCCsXPbJzcIq+NuzQhigunMWMJUA==",
"requires": {
"async": "^1.5.2",
"mkdirp": "^0.5.1",
@ -2372,7 +2352,7 @@
"dependencies": {
"async": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
"resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz",
"integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo="
}
}
@ -2421,8 +2401,8 @@
"integrity": "sha1-gy9kifvodnaUWVmckUpnDsIpR+4="
},
"fuzzy-finder": {
"version": "https://www.atom.io/api/packages/fuzzy-finder/versions/1.8.2/tarball",
"integrity": "sha512-wg3uX5fPtVItOByflO+vsQKHAqn3aSgutYM+xO3lEKQov9DuMdtMzMgbf/Tlam0YwjV+Qz/JV10LluJuliP03A==",
"version": "https://www.atom.io/api/packages/fuzzy-finder/versions/1.9.0/tarball",
"integrity": "sha512-YJTPPMZLQmDiUa6eoONhHF7sOvAPQqrXNFLfPGAUItDUoJxvJBwkPcxh+ryCHLlO8MuoJdDvAKHsU0mGzb/JeQ==",
"requires": {
"async": "0.2.6",
"atom-select-list": "^0.7.0",
@ -3152,14 +3132,6 @@
"is-buffer": "^1.1.5"
}
},
"klaw": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz",
"integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=",
"requires": {
"graceful-fs": "^4.1.9"
}
},
"language-c": {
"version": "https://www.atom.io/api/packages/language-c/versions/0.60.14/tarball",
"integrity": "sha512-jGFMc9vNutvBflFdoUXWJqxBFdMFG7n13PxS8z+SB8H0taZStq55JixDaQ0i/qu7ay4K5BCJ7y/PHdL13vjouQ==",
@ -3173,8 +3145,8 @@
"integrity": "sha512-HJfBRKbzOYGlEVQNnnRtx0BgiZ9pHlUioHUtG9pFV65EgO4jm4Q5cPHLDvBj+zEy0cm28eYgEYFjfacyBaZElg=="
},
"language-coffee-script": {
"version": "https://www.atom.io/api/packages/language-coffee-script/versions/0.49.3/tarball",
"integrity": "sha512-2xXcSiiRySd0qE4lhsOTqMwcKlBVKc/0ru9HHGJSeTdp/On9iNrkcM1+asDYa/QmvppgAILC2/0xUS6+B/cnqQ=="
"version": "https://www.atom.io/api/packages/language-coffee-script/versions/0.50.0/tarball",
"integrity": "sha512-Sp3b1i8wsd+AELphP2f52mli4C3YjicGC8ps21g48V3SrTZoM7tLE7lkcEdKddYlTqo0fBixTKN2R/iL6GcEVw=="
},
"language-csharp": {
"version": "https://www.atom.io/api/packages/language-csharp/versions/1.1.0/tarball",
@ -3604,21 +3576,21 @@
"integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE="
},
"log4js": {
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/log4js/-/log4js-3.0.5.tgz",
"integrity": "sha512-IX5c3G/7fuTtdr0JjOT2OIR12aTESVhsH6cEsijloYwKgcPRlO6DgOU72v0UFhWcoV1HN6+M3dwT89qVPLXm0w==",
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/log4js/-/log4js-4.0.0.tgz",
"integrity": "sha512-XlxZfcFAvQjnjCJBIV/EpsPmrVC12n+TxNUKgrmQh6eeA+9X+6UqvaRNV8t6dpMtXszl1LAQimB4pqyp2Gsgfw==",
"requires": {
"circular-json": "^0.5.5",
"date-format": "^1.2.0",
"date-format": "^2.0.0",
"debug": "^3.1.0",
"flatted": "^2.0.0",
"rfdc": "^1.1.2",
"streamroller": "0.7.0"
"streamroller": "^1.0.1"
},
"dependencies": {
"debug": {
"version": "3.2.5",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.5.tgz",
"integrity": "sha512-D61LaDQPQkxJ5AUM2mbSJRbPkNs/TmdmOeLAi1hgDkpDfIfetSrjmWhccwtuResSwMbACjx/xXQofvM9CE/aeg==",
"version": "3.2.6",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
"integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
"requires": {
"ms": "^2.1.1"
}
@ -4270,9 +4242,9 @@
"integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME="
},
"pathwatcher": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/pathwatcher/-/pathwatcher-8.0.1.tgz",
"integrity": "sha1-UaLOKgHbbDLYZ/ZYXvKEvmvQo64=",
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/pathwatcher/-/pathwatcher-8.0.2.tgz",
"integrity": "sha512-zuP+fLmB2IB6z89ikcehA+vG/ITx3Cmhaj3DJrBgnbdss6dwPolSq7cDBjgZ78Vl+SXmG7CHGIOM5mqdT9h7BQ==",
"requires": {
"async": "~0.2.10",
"emissary": "^1.3.2",
@ -4280,19 +4252,19 @@
"fs-plus": "^3.0.0",
"grim": "^2.0.1",
"iconv-lite": "~0.4.4",
"nan": "2.x",
"nan": "^2.10.0",
"underscore-plus": "~1.x"
},
"dependencies": {
"async": {
"version": "0.2.10",
"resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz",
"resolved": "http://registry.npmjs.org/async/-/async-0.2.10.tgz",
"integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E="
},
"grim": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/grim/-/grim-2.0.2.tgz",
"integrity": "sha1-52CinKe4NDsMH/r2ziDyGkbuiu0=",
"integrity": "sha512-Qj7hTJRfd87E/gUgfvM0YIH/g2UA2SV6niv6BYXk1o6w4mhgv+QyYM1EjOJQljvzgEj4SqSsRWldXIeKHz3e3Q==",
"requires": {
"event-kit": "^2.0.0"
}
@ -4411,11 +4383,12 @@
}
},
"promisify-node": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/promisify-node/-/promisify-node-0.3.0.tgz",
"integrity": "sha1-tLVaz5D6p9K4uQyjlomQhsAwYM8=",
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/promisify-node/-/promisify-node-0.5.0.tgz",
"integrity": "sha512-GR2E4qgCoKFTprhULqP2OP3bl8kHo16XtnqtkHH6be7tPW1yL6rXd15nl3oV2sLTFv1+j6tqoF69VVpFtJ/j+A==",
"requires": {
"nodegit-promise": "~4.0.0"
"nodegit-promise": "^4.0.0",
"object-assign": "^4.1.1"
}
},
"prop-types": {
@ -4955,8 +4928,8 @@
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="
},
"settings-view": {
"version": "https://www.atom.io/api/packages/settings-view/versions/0.258.0/tarball",
"integrity": "sha512-X2avkVC51tM8yGxyQDXF9DZUbxTOhuJPZbgZJaXkebo+Yj/aq4AUkc+AQFOHzWs+PWctyIzCem4PyRq8XIoQ+A==",
"version": "https://www.atom.io/api/packages/settings-view/versions/0.259.0/tarball",
"integrity": "sha512-jNQuTozGf1uQtS4Y4hlUT15STnmnKlAWzzJOIe+ts2S/SdrGHZwxhNykJFzM8gC8j4N3Kjb8CkgmbCDzZ98aEw==",
"requires": {
"async": "~0.2.9",
"dompurify": "^1.0.2",
@ -5140,22 +5113,22 @@
"integrity": "sha1-enzShHDMbToc/m1miG9rxDDTrIc="
},
"spell-check": {
"version": "https://www.atom.io/api/packages/spell-check/versions/0.74.2/tarball",
"integrity": "sha512-WhwhDF4nznhQuwnRemZbXODI6aqax2HlHudfLEjbhzkRGjEbfssRK82lRRvCK9LmQh3fAqCqbmELU40NEODJ8Q==",
"version": "https://www.atom.io/api/packages/spell-check/versions/0.74.3/tarball",
"integrity": "sha512-QYy0xpSKp8OSZjlvq7fOjrf/NdG4BncHvn9AmO/vcuJvWAoiwEWhqqB+BSA6uSrxOxJeJhbDJSxOrvm4YXs1xQ==",
"requires": {
"atom-pathspec": "^0.0.0",
"atom-select-list": "^0.7.0",
"multi-integer-range": "^2.0.0",
"natural": "^0.4.0",
"spellchecker": "^3.4.4",
"spellchecker": "^3.5.1",
"spelling-manager": "^1.1.0",
"underscore-plus": "^1"
}
},
"spellchecker": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/spellchecker/-/spellchecker-3.5.0.tgz",
"integrity": "sha512-Xa7XnRulYhh5N/XENeL2O8/875XhLBjos7Bemv0rfcgV6ojNYMSrXscUZUGJwniX2t67eY+lNUJeptD1bMauHQ==",
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/spellchecker/-/spellchecker-3.5.1.tgz",
"integrity": "sha512-R1qUBsDZzio+7MFZN6/AtPUe5NGvnc0wywckuXAlp9akASaYSFqKuI5O8p3rSiA+yKP31qC7Iijjoygmzkh6xw==",
"requires": {
"any-promise": "^1.3.0",
"nan": "^2.10.0"
@ -5164,7 +5137,7 @@
"spelling-manager": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/spelling-manager/-/spelling-manager-1.1.0.tgz",
"integrity": "sha1-UZmGdZUpHgVjlExuL70ao02X3TQ=",
"integrity": "sha512-PpTP6XUZflCWO9YZO3wBSGAmqrUP6BFwSdmVFS6WBT9rFYg3ysmrIfyD1KnaVcnW6wuIKf+FDwefvU8PsD8Smg==",
"requires": {
"natural": "0.5.0",
"xregexp": "^3.2.0"
@ -5254,24 +5227,38 @@
}
},
"streamroller": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/streamroller/-/streamroller-0.7.0.tgz",
"integrity": "sha1-odG3z4PTmvsNYwSaWsv5NJO99ks=",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/streamroller/-/streamroller-1.0.1.tgz",
"integrity": "sha512-FKL2mEB0A+XTIWSOlBHm2DvdsER5cGraqrUufO0lFMfsVY+Gpb3TC29Z+6/l0Urbb7vtm6m9zJOQBVl6fEkZBA==",
"requires": {
"date-format": "^1.2.0",
"async": "^2.6.1",
"date-format": "^2.0.0",
"debug": "^3.1.0",
"mkdirp": "^0.5.1",
"readable-stream": "^2.3.0"
"fs-extra": "^7.0.0",
"lodash": "^4.17.10"
},
"dependencies": {
"async": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz",
"integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==",
"requires": {
"lodash": "^4.17.10"
}
},
"debug": {
"version": "3.2.5",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.5.tgz",
"integrity": "sha512-D61LaDQPQkxJ5AUM2mbSJRbPkNs/TmdmOeLAi1hgDkpDfIfetSrjmWhccwtuResSwMbACjx/xXQofvM9CE/aeg==",
"version": "3.2.6",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
"integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
"requires": {
"ms": "^2.1.1"
}
},
"lodash": {
"version": "4.17.11",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
"integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg=="
},
"ms": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
@ -5343,9 +5330,9 @@
}
},
"superstring": {
"version": "2.3.4",
"resolved": "https://registry.npmjs.org/superstring/-/superstring-2.3.4.tgz",
"integrity": "sha512-DcNkTCdB9F3FMZRdURSALsHi+7DWqFCI0cH+Eg8mwBg+kxQs6GeB3LrGUvCI5bEB6Dtlu2ox8UYN0onPN4JeZQ==",
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/superstring/-/superstring-2.3.6.tgz",
"integrity": "sha512-kDTXCXArhHL1lRk2zBW7ByRJByqVwoLK3E3jlf8+LcwQLZgSMs9dwrDHDpBdoOm89kstSBSrGcW8OJqNkxjWrQ==",
"requires": {
"nan": "^2.10.0"
}
@ -5479,21 +5466,21 @@
}
},
"text-buffer": {
"version": "13.15.1",
"resolved": "https://registry.npmjs.org/text-buffer/-/text-buffer-13.15.1.tgz",
"integrity": "sha512-LZx7EKhVwjo50Y9ZF6WDP2S4zLUcHAagHZhn6HzHjr0SxyWtm95HG7ApSzgLGvIzCZEoTzMYt62scUdesfzYuw==",
"version": "13.15.3",
"resolved": "https://registry.npmjs.org/text-buffer/-/text-buffer-13.15.3.tgz",
"integrity": "sha512-H2fz/N15g0fBP7R33FUFLnIyND+Lji/xmuvHg9rKgmfCh7NAVxiFIvnZTabuBhL9InqPrtV5t4hkUy+r3dNXMg==",
"requires": {
"delegato": "^1.0.0",
"diff": "^2.2.1",
"emissary": "^1.0.0",
"event-kit": "^2.4.0",
"fs-admin": "^0.1.4",
"fs-admin": "^0.1.7",
"fs-plus": "^3.0.0",
"grim": "^2.0.2",
"mkdirp": "^0.5.1",
"pathwatcher": "8.0.1",
"pathwatcher": "8.0.2",
"serializable": "^1.0.3",
"superstring": "2.3.4",
"superstring": "2.3.6",
"underscore-plus": "^1.0.0"
},
"dependencies": {
@ -5748,7 +5735,7 @@
},
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
},
"prebuild-install": {

View File

@ -12,9 +12,9 @@
"url": "https://github.com/atom/atom/issues"
},
"license": "MIT",
"electronVersion": "2.0.16",
"electronVersion": "3.0.14",
"dependencies": {
"@atom/nsfw": "1.0.18",
"@atom/nsfw": "^1.0.20",
"@atom/source-map-support": "^0.3.4",
"@atom/watcher": "1.0.8",
"about": "file:packages/about",
@ -37,9 +37,8 @@
"background-tips": "https://www.atom.io/api/packages/background-tips/versions/0.28.0/tarball",
"base16-tomorrow-dark-theme": "file:packages/base16-tomorrow-dark-theme",
"base16-tomorrow-light-theme": "file:packages/base16-tomorrow-light-theme",
"bookmarks": "https://www.atom.io/api/packages/bookmarks/versions/0.45.1/tarball",
"bookmarks": "https://www.atom.io/api/packages/bookmarks/versions/0.46.0/tarball",
"bracket-matcher": "https://www.atom.io/api/packages/bracket-matcher/versions/0.90.4/tarball",
"cached-run-in-this-context": "0.5.0",
"chai": "3.5.0",
"chart.js": "^2.3.0",
"clear-cut": "^2.0.2",
@ -55,15 +54,15 @@
"etch": "^0.12.6",
"event-kit": "^2.5.3",
"exception-reporting": "file:packages/exception-reporting",
"find-and-replace": "https://www.atom.io/api/packages/find-and-replace/versions/0.216.0/tarball",
"find-and-replace": "https://www.atom.io/api/packages/find-and-replace/versions/0.218.0/tarball",
"find-parent-dir": "^0.3.0",
"first-mate": "7.1.3",
"focus-trap": "2.4.5",
"fs-admin": "^0.1.7",
"fs-plus": "^3.0.1",
"fs-plus": "^3.1.1",
"fstream": "0.1.24",
"fuzzaldrin": "^2.1",
"fuzzy-finder": "https://www.atom.io/api/packages/fuzzy-finder/versions/1.8.2/tarball",
"fuzzy-finder": "https://www.atom.io/api/packages/fuzzy-finder/versions/1.9.0/tarball",
"git-diff": "file:packages/git-diff",
"git-utils": "5.2.1",
"github": "https://www.atom.io/api/packages/github/versions/0.24.0/tarball",
@ -80,7 +79,7 @@
"keybinding-resolver": "https://www.atom.io/api/packages/keybinding-resolver/versions/0.38.4/tarball",
"language-c": "https://www.atom.io/api/packages/language-c/versions/0.60.14/tarball",
"language-clojure": "https://www.atom.io/api/packages/language-clojure/versions/0.22.7/tarball",
"language-coffee-script": "https://www.atom.io/api/packages/language-coffee-script/versions/0.49.3/tarball",
"language-coffee-script": "https://www.atom.io/api/packages/language-coffee-script/versions/0.50.0/tarball",
"language-csharp": "https://www.atom.io/api/packages/language-csharp/versions/1.1.0/tarball",
"language-css": "https://www.atom.io/api/packages/language-css/versions/0.43.0/tarball",
"language-gfm": "https://www.atom.io/api/packages/language-gfm/versions/0.90.6/tarball",
@ -133,7 +132,7 @@
"one-light-ui": "file:packages/one-light-ui",
"open-on-github": "https://www.atom.io/api/packages/open-on-github/versions/1.3.1/tarball",
"package-generator": "https://www.atom.io/api/packages/package-generator/versions/1.3.0/tarball",
"pathwatcher": "8.0.1",
"pathwatcher": "8.0.2",
"postcss": "5.2.4",
"postcss-selector-parser": "2.2.1",
"property-accessors": "^1.1.3",
@ -145,18 +144,18 @@
"season": "^6.0.2",
"semver": "^4.3.3",
"service-hub": "^0.7.4",
"settings-view": "https://www.atom.io/api/packages/settings-view/versions/0.258.0/tarball",
"settings-view": "https://www.atom.io/api/packages/settings-view/versions/0.259.0/tarball",
"sinon": "1.17.4",
"snippets": "https://www.atom.io/api/packages/snippets/versions/1.4.0/tarball",
"solarized-dark-syntax": "file:packages/solarized-dark-syntax",
"solarized-light-syntax": "file:packages/solarized-light-syntax",
"spell-check": "https://www.atom.io/api/packages/spell-check/versions/0.74.2/tarball",
"spell-check": "https://www.atom.io/api/packages/spell-check/versions/0.74.3/tarball",
"status-bar": "https://www.atom.io/api/packages/status-bar/versions/1.8.17/tarball",
"styleguide": "https://www.atom.io/api/packages/styleguide/versions/0.49.12/tarball",
"symbols-view": "https://www.atom.io/api/packages/symbols-view/versions/0.118.2/tarball",
"tabs": "https://www.atom.io/api/packages/tabs/versions/0.110.0/tarball",
"temp": "^0.8.3",
"text-buffer": "13.15.1",
"text-buffer": "13.15.3",
"timecop": "https://www.atom.io/api/packages/timecop/versions/0.36.2/tarball",
"tree-sitter": "0.13.23",
"tree-sitter-css": "^0.13.7",
@ -193,7 +192,7 @@
"autoflow": "file:./packages/autoflow",
"autosave": "0.24.6",
"background-tips": "0.28.0",
"bookmarks": "0.45.1",
"bookmarks": "0.46.0",
"bracket-matcher": "0.90.4",
"command-palette": "0.43.5",
"dalek": "file:./packages/dalek",
@ -201,8 +200,8 @@
"dev-live-reload": "file:./packages/dev-live-reload",
"encoding-selector": "0.23.9",
"exception-reporting": "file:./packages/exception-reporting",
"find-and-replace": "0.216.0",
"fuzzy-finder": "1.8.2",
"find-and-replace": "0.218.0",
"fuzzy-finder": "1.9.0",
"github": "0.24.0",
"git-diff": "file:./packages/git-diff",
"go-to-line": "file:./packages/go-to-line",
@ -217,9 +216,9 @@
"notifications": "0.70.6",
"open-on-github": "1.3.1",
"package-generator": "1.3.0",
"settings-view": "0.258.0",
"settings-view": "0.259.0",
"snippets": "1.4.0",
"spell-check": "0.74.2",
"spell-check": "0.74.3",
"status-bar": "1.8.17",
"styleguide": "0.49.12",
"symbols-view": "0.118.2",
@ -232,7 +231,7 @@
"wrap-guide": "0.41.0",
"language-c": "0.60.14",
"language-clojure": "0.22.7",
"language-coffee-script": "0.49.3",
"language-coffee-script": "0.50.0",
"language-csharp": "1.1.0",
"language-css": "0.43.0",
"language-gfm": "0.90.6",

View File

@ -55,9 +55,6 @@
.section-container {
max-width: @ui-size*60;
}
.sub-section {
margin: @ui-padding*3 0;
}
.section,
.section:first-child,
@ -85,6 +82,10 @@
// Cards ------------------------------
.sub-section:not(.collapsed) .package-container {
padding-bottom: @component-padding*3;
}
.package-card {
padding: @ui-padding;
.meta-controls .status-indicator {

View File

@ -55,9 +55,6 @@
.section-container {
max-width: @ui-size*60;
}
.sub-section {
margin: @ui-padding*3 0;
}
.section,
.section:first-child,
@ -85,6 +82,10 @@
// Cards ------------------------------
.sub-section:not(.collapsed) .package-container {
padding-bottom: @component-padding*3;
}
.package-card {
padding: @ui-padding;
.meta-controls .status-indicator {

View File

@ -34,6 +34,8 @@
<string>AtomApplication</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<key>NSRequiresAquaSystemAppearance</key>
<string>NO</string>
<key>SUScheduledCheckInterval</key>
<string>3600</string>
<key>CFBundleURLTypes</key>

View File

@ -42,7 +42,6 @@ module.exports = function (packagedAppPath) {
requiredModuleRelativePath === path.join('..', 'src', 'electron-shims.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'atom-keymap', 'lib', 'command-event.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'babel-core', 'index.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'cached-run-in-this-context', 'lib', 'main.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'debug', 'node.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'git-utils', 'src', 'git.js') ||
requiredModuleRelativePath === path.join('..', 'node_modules', 'glob', 'glob.js') ||
@ -97,22 +96,36 @@ module.exports = function (packagedAppPath) {
{env: Object.assign({}, process.env, {ELECTRON_RUN_AS_NODE: 1})}
)
const generatedStartupBlobPath = path.join(CONFIG.buildOutputPath, 'snapshot_blob.bin')
console.log(`Generating startup blob at "${generatedStartupBlobPath}"`)
childProcess.execFileSync(
path.join(CONFIG.repositoryRootPath, 'script', 'node_modules', 'electron-mksnapshot', 'bin', 'mksnapshot'),
['--no-use_ic', snapshotScriptPath, '--startup_blob', generatedStartupBlobPath]
console.log('Generating startup blob with mksnapshot')
childProcess.spawnSync(
process.execPath, [
path.join(CONFIG.repositoryRootPath, 'script', 'node_modules', 'electron-mksnapshot', 'mksnapshot.js'),
snapshotScriptPath,
'--output_dir',
CONFIG.buildOutputPath
]
)
let startupBlobDestinationPath
if (process.platform === 'darwin') {
startupBlobDestinationPath = `${packagedAppPath}/Contents/Frameworks/Electron Framework.framework/Resources/snapshot_blob.bin`
startupBlobDestinationPath = `${packagedAppPath}/Contents/Frameworks/Electron Framework.framework/Resources`
} else {
startupBlobDestinationPath = path.join(packagedAppPath, 'snapshot_blob.bin')
startupBlobDestinationPath = packagedAppPath
}
console.log(`Moving generated startup blob into "${startupBlobDestinationPath}"`)
fs.unlinkSync(startupBlobDestinationPath)
fs.renameSync(generatedStartupBlobPath, startupBlobDestinationPath)
const snapshotBinaries = ['v8_context_snapshot.bin', 'snapshot_blob.bin']
for (let snapshotBinary of snapshotBinaries) {
const destinationPath = path.join(startupBlobDestinationPath, snapshotBinary)
console.log(`Moving generated startup blob into "${destinationPath}"`)
try {
fs.unlinkSync(destinationPath)
} catch (err) {
// Doesn't matter if the file doesn't exist already
if (!err.code || err.code !== 'ENOENT') {
throw err
}
}
fs.renameSync(path.join(CONFIG.buildOutputPath, snapshotBinary), destinationPath)
}
})
}

View File

@ -1691,50 +1691,72 @@
"integrity": "sha1-YMf4e9YrzGqJT6jM1q+3gjok90I="
},
"electron-chromedriver": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/electron-chromedriver/-/electron-chromedriver-2.0.0.tgz",
"integrity": "sha512-kERk/Wzhc9RzW9jUKXA5kJc4m8BlL6c9p5QH+CrIlst0saeqZL1Up7vzD4ZOnuBDpAVBBYJ4jhkAKIssf8ZlXg==",
"version": "3.0.0-beta.1",
"resolved": "https://registry.npmjs.org/electron-chromedriver/-/electron-chromedriver-3.0.0-beta.1.tgz",
"integrity": "sha512-S8KuOWqTISSfeVccrh1XjqR5tARdkAbF93azz8TvuNJTKoIw7V54mLKoyhi2Hj5UvKuPLcrHmfa4B9Uh45A5lA==",
"requires": {
"electron-download": "^4.1.0",
"extract-zip": "^1.6.5"
}
},
"electron-download": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/electron-download/-/electron-download-4.1.0.tgz",
"integrity": "sha1-v5MsdG8vh//MCdHdRy8v9rkYeEU=",
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/electron-download/-/electron-download-4.1.1.tgz",
"integrity": "sha512-FjEWG9Jb/ppK/2zToP+U5dds114fM1ZOJqMAR4aXXL5CvyPE9fiqBK/9YcwC9poIFQTEJk/EM/zyRwziziRZrg==",
"requires": {
"debug": "^2.2.0",
"debug": "^3.0.0",
"env-paths": "^1.0.0",
"fs-extra": "^2.0.0",
"fs-extra": "^4.0.1",
"minimist": "^1.2.0",
"nugget": "^2.0.0",
"nugget": "^2.0.1",
"path-exists": "^3.0.0",
"rc": "^1.1.2",
"semver": "^5.3.0",
"sumchecker": "^2.0.1"
"rc": "^1.2.1",
"semver": "^5.4.1",
"sumchecker": "^2.0.2"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
}
},
"fs-extra": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.1.2.tgz",
"integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=",
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz",
"integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==",
"requires": {
"graceful-fs": "^4.1.2",
"jsonfile": "^2.1.0"
"jsonfile": "^4.0.0",
"universalify": "^0.1.0"
}
},
"jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
"requires": {
"graceful-fs": "^4.1.6"
}
},
"path-exists": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
"integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU="
},
"semver": {
"version": "5.5.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz",
"integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw=="
}
}
},
"electron-link": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/electron-link/-/electron-link-0.3.2.tgz",
"integrity": "sha512-V7QmtujzWgvrW5BI2CKmIRF+q+pkrFO5Lecd8TpibbBz+FfW5WQ4kCN0sZjNaUOMtGGroCib721OqIDEynjwgA==",
"version": "0.3.3",
"resolved": "https://registry.npmjs.org/electron-link/-/electron-link-0.3.3.tgz",
"integrity": "sha512-dxFY3o3E9kBkOyfaY66PWabK1AL5Re8qmy2Abz2/VhVkp2KtvUn6BZODTm9XpC0REgWxlQfRyHlNTlXRBPrWCQ==",
"requires": {
"ast-util": "^0.6.0",
"encoding-down": "~5.0.0",
@ -1752,9 +1774,9 @@
"integrity": "sha512-UY7+9DPzlJ9VM8eY0b2TUZcZvF+1pO0hzMtAyjBYKhOmnvRlqYNYnWdtsMj0V16CGaMlpL0G1jnLbLo4AyotuQ=="
},
"core-js": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.1.tgz",
"integrity": "sha512-L72mmmEayPJBejKIWe2pYtGis5r0tQ5NaJekdhyXgeMQTpJoBsH0NL4ElY2LfSoV15xeQWKQ+XTTOZdyero5Xg=="
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.3.tgz",
"integrity": "sha512-l00tmFFZOBHtYhN4Cz7k32VM7vTn3rE2ANjQDxdEN6zmXZ/xq1jQuutnmHvMG1ZJ7xd72+TA5YpUK8wz3rWsfQ=="
},
"esprima": {
"version": "4.0.1",
@ -1788,12 +1810,13 @@
}
},
"electron-mksnapshot": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/electron-mksnapshot/-/electron-mksnapshot-2.0.0.tgz",
"integrity": "sha512-OoZwZJNKgHP+DwhCGVTJEuDSeb478hOzAbHeg7dKGCHDbKKmUWmjGc+pEjxGutpqQ3Mn8hCdLzdx2c/lAJcTLA==",
"version": "3.0.10",
"resolved": "https://registry.npmjs.org/electron-mksnapshot/-/electron-mksnapshot-3.0.10.tgz",
"integrity": "sha512-Toy6sAC3t9tgvq1kUYsx+4TRNPDj7Bzoo+1gx5FD8Q0YCS+tq+ter62Ot6dBXCKG9SwoaGBz84b++MgO0VobYw==",
"requires": {
"electron-download": "^4.1.0",
"extract-zip": "^1.6.5"
"extract-zip": "^1.6.5",
"temp": "^0.8.3"
}
},
"electron-osx-sign": {
@ -4723,9 +4746,9 @@
"integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw="
},
"node-abi": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.5.1.tgz",
"integrity": "sha512-oDbFc7vCFx0RWWCweTer3hFm1u+e60N5FtGnmRV6QqvgATGFH/XRR6vqWIeBVosCYCqt6YdIr2L0exLZuEdVcQ==",
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.7.0.tgz",
"integrity": "sha512-egTtvNoZLMjwxkL/5iiJKYKZgn2im0zP+G+PncMxICYGiD3aZtXUvEsDmu0pF8gpASvLZyD8v53qi1/ELaRZpg==",
"requires": {
"semver": "^5.4.1"
},
@ -10309,6 +10332,11 @@
"unist-util-is": "^2.1.1"
}
},
"universalify": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg=="
},
"unset-value": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz",

View File

@ -9,9 +9,9 @@
"coffeelint": "1.15.7",
"colors": "1.1.2",
"donna": "1.0.16",
"electron-chromedriver": "~2.0",
"electron-link": "0.3.2",
"electron-mksnapshot": "~2.0",
"electron-chromedriver": "~3.0.0-beta.1",
"electron-link": "0.3.3",
"electron-mksnapshot": "~3.0.10",
"electron-packager": "7.3.0",
"electron-winstaller": "2.6.4",
"fs-admin": "^0.1.5",

View File

@ -669,6 +669,28 @@ describe('AtomEnvironment', () => {
expect(atom.workspace.getTextEditors().map(e => e.getPath())).toEqual([pathToOpen])
expect(atom.project.getPaths()).toEqual([])
})
it('may be required to be an existing directory', async () => {
spyOn(atom.notifications, 'addWarning')
const nonExistent = path.join(__dirname, 'no')
const existingFile = __filename
const existingDir = path.join(__dirname, 'fixtures')
await atom.openLocations([
{pathToOpen: nonExistent, mustBeDirectory: true},
{pathToOpen: existingFile, mustBeDirectory: true},
{pathToOpen: existingDir, mustBeDirectory: true}
])
expect(atom.workspace.getTextEditors()).toEqual([])
expect(atom.project.getPaths()).toEqual([existingDir])
expect(atom.notifications.addWarning).toHaveBeenCalledWith(
'Unable to open project folders',
{description: `The directories \`${nonExistent}\` and \`${existingFile}\` do not exist.`}
)
})
})
describe('when the opened path is handled by a registered directory provider', () => {
@ -720,6 +742,27 @@ describe('AtomEnvironment', () => {
expect(atom.project.getPaths()).toEqual([])
})
it('includes missing mandatory project folders in computation of initial state key', async () => {
const existingDir = path.join(__dirname, 'fixtures')
const missingDir = path.join(__dirname, 'no')
atom.loadState.andCallFake(function (key) {
if (key === `${existingDir}:${missingDir}`) {
return Promise.resolve(state)
} else {
return Promise.resolve(null)
}
})
await atom.openLocations([
{pathToOpen: existingDir},
{pathToOpen: missingDir, mustBeDirectory: true}
])
expect(atom.attemptRestoreProjectStateForPaths).toHaveBeenCalledWith(state, [existingDir], [])
expect(atom.project.getPaths(), [existingDir])
})
it('opens the specified files', async () => {
await atom.openLocations([{pathToOpen: __dirname}, {pathToOpen: __filename}])
expect(atom.attemptRestoreProjectStateForPaths).toHaveBeenCalledWith(state, [__dirname], [__filename])

View File

@ -1,6 +1,7 @@
DecorationManager = require '../src/decoration-manager'
TextEditor = require '../src/text-editor'
# Tests crash the renderer process on Electron 3.0, disabling for now.
describe "DecorationManager", ->
[decorationManager, buffer, editor, markerLayer1, markerLayer2] = []
@ -64,7 +65,9 @@ describe "DecorationManager", ->
{oldProperties, newProperties} = updatedSpy.mostRecentCall.args[0]
expect(oldProperties).toEqual decorationProperties
expect(newProperties).toEqual {type: 'line-number', gutterName: 'line-number', class: 'two'}
expect(newProperties.type).toBe 'line-number'
expect(newProperties.gutterName).toBe 'line-number'
expect(newProperties.class).toBe 'two'
describe "::getDecorations(properties)", ->
it "returns decorations matching the given optional properties", ->

View File

@ -1,3 +1,3 @@
'use 6to6';
module.exports = async function* hello() {}
export default 42;

View File

@ -1,5 +1,6 @@
const TextEditor = require('../src/text-editor')
// Tests crash the renderer process on Electron 3.0, disabling for now.
describe('Selection', () => {
let buffer, editor, selection

View File

@ -47,7 +47,6 @@ describe('StyleManager', () => {
atom-text-editor::shadow .class-1, atom-text-editor::shadow .class-2 { color: red }
atom-text-editor::shadow > .class-3 { color: yellow }
atom-text-editor .class-4 { color: blue }
another-element::shadow .class-5 { color: white }
atom-text-editor[data-grammar*=\"js\"]::shadow .class-6 { color: green; }
atom-text-editor[mini].is-focused::shadow .class-7 { color: green; }
`)
@ -55,7 +54,6 @@ describe('StyleManager', () => {
'atom-text-editor.editor .class-1, atom-text-editor.editor .class-2',
'atom-text-editor.editor > .class-3',
'atom-text-editor .class-4',
'another-element::shadow .class-5',
'atom-text-editor[data-grammar*=\"js\"].editor .class-6',
'atom-text-editor[mini].is-focused.editor .class-7'
])
@ -102,13 +100,6 @@ describe('StyleManager', () => {
])
})
it('does not transform CSS rules with invalid syntax', () => {
styleManager.addStyleSheet("atom-text-editor::shadow .class-1 { font-family: inval'id }")
expect(Array.from(styleManager.getStyleElements()[0].sheet.cssRules).map((r) => r.selectorText)).toEqual([
'atom-text-editor::shadow .class-1'
])
})
it('does not throw exceptions on rules with no selectors', () => {
styleManager.addStyleSheet('@media screen {font-size: 10px}', {context: 'atom-text-editor'})
})

View File

@ -2638,7 +2638,71 @@ describe('TextEditorComponent', () => {
expect(editor.getCursorScreenPosition()).toEqual([0, 0])
})
function createBlockDecorationAtScreenRow(editor, screenRow, {height, margin, marginTop, marginBottom, position, invalidate}) {
it('uses the order property to control the order of block decorations at the same screen row', async () => {
const editor = buildEditor({autoHeight: false})
const {component, element} = buildComponent({editor})
element.style.height = 10 * component.getLineHeight() + horizontalScrollbarHeight + 'px'
await component.getNextUpdatePromise()
// Order parameters that differ from creation order; that collide; and that are not provided.
const [beforeItems, beforeDecorations] = [30, 20, undefined, 20, 10, undefined].map(order => {
return createBlockDecorationAtScreenRow(editor, 2, {height: 10, position: 'before', order})
}).reduce((lists, result) => {
lists[0].push(result.item)
lists[1].push(result.decoration)
return lists
}, [[], []])
const [afterItems, afterDecorations] = [undefined, 1, 6, undefined, 6, 2].map(order => {
return createBlockDecorationAtScreenRow(editor, 2, {height: 10, position: 'after', order})
}).reduce((lists, result) => {
lists[0].push(result.item)
lists[1].push(result.decoration)
return lists
}, [[], []])
await component.getNextUpdatePromise()
expect(beforeItems[4].previousSibling).toBe(lineNodeForScreenRow(component, 1))
expect(beforeItems[4].nextSibling).toBe(beforeItems[1])
expect(beforeItems[1].nextSibling).toBe(beforeItems[3])
expect(beforeItems[3].nextSibling).toBe(beforeItems[0])
expect(beforeItems[0].nextSibling).toBe(beforeItems[2])
expect(beforeItems[2].nextSibling).toBe(beforeItems[5])
expect(beforeItems[5].nextSibling).toBe(lineNodeForScreenRow(component, 2))
expect(afterItems[1].previousSibling).toBe(lineNodeForScreenRow(component, 2))
expect(afterItems[1].nextSibling).toBe(afterItems[5])
expect(afterItems[5].nextSibling).toBe(afterItems[2])
expect(afterItems[2].nextSibling).toBe(afterItems[4])
expect(afterItems[4].nextSibling).toBe(afterItems[0])
expect(afterItems[0].nextSibling).toBe(afterItems[3])
// Create a decoration somewhere else and move it to the same screen row as the existing decorations
const {item: later, decoration} = createBlockDecorationAtScreenRow(editor, 4, {height: 20, position: 'after', order: 3})
await component.getNextUpdatePromise()
expect(later.previousSibling).toBe(lineNodeForScreenRow(component, 4))
expect(later.nextSibling).toBe(lineNodeForScreenRow(component, 5))
decoration.getMarker().setHeadScreenPosition([2, 0])
await component.getNextUpdatePromise()
expect(later.previousSibling).toBe(afterItems[5])
expect(later.nextSibling).toBe(afterItems[2])
// Move a decoration away from its screen row and ensure the rest maintain their order
beforeDecorations[3].getMarker().setHeadScreenPosition([5, 0])
await component.getNextUpdatePromise()
expect(beforeItems[3].previousSibling).toBe(lineNodeForScreenRow(component, 4))
expect(beforeItems[3].nextSibling).toBe(lineNodeForScreenRow(component, 5))
expect(beforeItems[4].previousSibling).toBe(lineNodeForScreenRow(component, 1))
expect(beforeItems[4].nextSibling).toBe(beforeItems[1])
expect(beforeItems[1].nextSibling).toBe(beforeItems[0])
expect(beforeItems[0].nextSibling).toBe(beforeItems[2])
expect(beforeItems[2].nextSibling).toBe(beforeItems[5])
expect(beforeItems[5].nextSibling).toBe(lineNodeForScreenRow(component, 2))
});
function createBlockDecorationAtScreenRow(editor, screenRow, {height, margin, marginTop, marginBottom, position, order, invalidate}) {
const marker = editor.markScreenPosition([screenRow, 0], {invalidate: invalidate || 'never'})
const item = document.createElement('div')
item.style.height = height + 'px'
@ -2646,7 +2710,7 @@ describe('TextEditorComponent', () => {
if (marginTop != null) item.style.marginTop = marginTop + 'px'
if (marginBottom != null) item.style.marginBottom = marginBottom + 'px'
item.style.width = 30 + 'px'
const decoration = editor.decorateMarker(marker, {type: 'block', item, position})
const decoration = editor.decorateMarker(marker, {type: 'block', item, position, order})
return {item, decoration, marker}
}

View File

@ -6861,7 +6861,7 @@ describe('TextEditor', () => {
const marker = editor.markBufferRange([[2, 4], [6, 8]])
const decoration = editor.decorateMarker(marker, {type: 'highlight', class: 'foo'})
expect(editor.decorationsStateForScreenRowRange(0, 5)[decoration.id]).toEqual({
properties: {type: 'highlight', class: 'foo'},
properties: {id: decoration.id, order: Infinity, type: 'highlight', class: 'foo'},
screenRange: marker.getScreenRange(),
bufferRange: marker.getBufferRange(),
rangeIsReversed: false

View File

@ -6,6 +6,7 @@ const _ = require('underscore-plus')
const dedent = require('dedent')
const {it, fit, ffit, fffit, beforeEach, afterEach} = require('./async-spec-helpers')
// Tests crash the renderer process on Electron 3.0, disabling for now.
describe('TextMateLanguageMode', () => {
let languageMode, buffer, config

View File

@ -251,9 +251,9 @@ h2 {
it('returns a disposable allowing styles applied by the given path to be removed', function () {
const cssPath = require.resolve('./fixtures/css.css')
expect(getComputedStyle(document.body).fontWeight).not.toBe('bold')
expect(getComputedStyle(document.body).fontWeight).not.toBe('700')
const disposable = atom.themes.requireStylesheet(cssPath)
expect(getComputedStyle(document.body).fontWeight).toBe('bold')
expect(getComputedStyle(document.body).fontWeight).toBe('700')
let styleElementRemovedHandler
atom.styles.onDidRemoveStyleElement(styleElementRemovedHandler = jasmine.createSpy('styleElementRemovedHandler'))

View File

@ -2086,7 +2086,7 @@ describe('Workspace', () => {
})
runs(() => {
fs.rename(path.join(projectPath, 'git.git'), path.join(projectPath, '.git'))
fs.renameSync(path.join(projectPath, 'git.git'), path.join(projectPath, '.git'))
ignoredPath = path.join(projectPath, 'ignored.txt')
fs.writeFileSync(ignoredPath, 'this match should not be included')
})

View File

@ -1364,6 +1364,7 @@ or use Pane::saveItemAs for programmatic saving.`)
const needsProjectPaths = this.project && this.project.getPaths().length === 0
const foldersToAddToProject = new Set()
const fileLocationsToOpen = []
const missingFolders = []
// Asynchronously fetch stat information about each requested path to open.
const locationStats = await Promise.all(
@ -1387,8 +1388,13 @@ or use Pane::saveItemAs for programmatic saving.`)
// Directory: add as a project folder
foldersToAddToProject.add(this.project.getDirectoryForProjectPath(pathToOpen).getPath())
} else if (stats.isFile()) {
// File: add as a file location
fileLocationsToOpen.push(location)
if (location.mustBeDirectory) {
// File: no longer a directory
missingFolders.push(location)
} else {
// File: add as a file location
fileLocationsToOpen.push(location)
}
}
} else {
// Path does not exist
@ -1397,6 +1403,9 @@ or use Pane::saveItemAs for programmatic saving.`)
if (directory) {
// Found: add as a project folder
foldersToAddToProject.add(directory.getPath())
} else if (location.mustBeDirectory) {
// Not found and must be a directory: add to missing list and use to derive state key
missingFolders.push(location)
} else {
// Not found: open as a new file
fileLocationsToOpen.push(location)
@ -1407,8 +1416,12 @@ or use Pane::saveItemAs for programmatic saving.`)
}
let restoredState = false
if (foldersToAddToProject.size > 0) {
const state = await this.loadState(this.getStateKey(Array.from(foldersToAddToProject)))
if (foldersToAddToProject.size > 0 || missingFolders.length > 0) {
// Include missing folders in the state key so that sessions restored with no-longer-present project root folders
// don't lose data.
const foldersForStateKey = Array.from(foldersToAddToProject)
.concat(missingFolders.map(location => location.pathToOpen))
const state = await this.loadState(this.getStateKey(Array.from(foldersForStateKey)))
// only restore state if this is the first path added to the project
if (state && needsProjectPaths) {
@ -1430,6 +1443,33 @@ or use Pane::saveItemAs for programmatic saving.`)
await Promise.all(fileOpenPromises)
}
if (missingFolders.length > 0) {
let message = 'Unable to open project folder'
if (missingFolders.length > 1) {
message += 's'
}
let description = 'The '
if (missingFolders.length === 1) {
description += 'directory `'
description += missingFolders[0].pathToOpen
description += '` does not exist.'
} else if (missingFolders.length === 2) {
description += `directories \`${missingFolders[0].pathToOpen}\` `
description += `and \`${missingFolders[1].pathToOpen}\` do not exist.`
} else {
description += 'directories '
description += (missingFolders
.slice(0, -1)
.map(location => location.pathToOpen)
.map(pathToOpen => '`' + pathToOpen + '`, ')
.join(''))
description += 'and `' + missingFolders[missingFolders.length - 1].pathToOpen + '` do not exist.'
}
this.notifications.addWarning(message, {description})
}
ipcRenderer.send('window-command', 'window:locations-opened')
}

View File

@ -177,7 +177,7 @@ exports.install = function (resourcesPath, nodeRequire) {
var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(',') + 1)
try {
var sourceMap = JSON.parse(new Buffer(rawData, 'base64'))
var sourceMap = JSON.parse(Buffer.from(rawData, 'base64'))
} catch (error) {
console.warn('Error parsing source map', error.stack)
return null

View File

@ -3,12 +3,17 @@ const {Emitter} = require('event-kit')
let idCounter = 0
const nextId = () => idCounter++
// Applies changes to a decorationsParam {Object} to make it possible to
// differentiate decorations on custom gutters versus the line-number gutter.
const translateDecorationParamsOldToNew = function (decorationParams) {
if (decorationParams.type === 'line-number') {
const normalizeDecorationProperties = function (decoration, decorationParams) {
decorationParams.id = decoration.id
if (decorationParams.type === 'line-number' && decorationParams.gutterName == null) {
decorationParams.gutterName = 'line-number'
}
if (decorationParams.order == null) {
decorationParams.order = Infinity
}
return decorationParams
}
@ -164,7 +169,7 @@ class Decoration {
setProperties (newProperties) {
if (this.destroyed) { return }
const oldProperties = this.properties
this.properties = translateDecorationParamsOldToNew(newProperties)
this.properties = normalizeDecorationProperties(this, newProperties)
if (newProperties.type != null) {
this.decorationManager.decorationDidChangeType(this)
}

View File

@ -20,7 +20,7 @@ class FileSystemBlobStore {
reset () {
this.inMemoryBlobs = new Map()
this.storedBlob = new Buffer(0)
this.storedBlob = Buffer.alloc(0)
this.storedBlobMap = {}
this.usedKeys = new Set()
}

View File

@ -91,6 +91,7 @@ class AtomApplication extends EventEmitter {
constructor (options) {
super()
this.quitting = false
this.quittingForUpdate = false
this.getAllWindows = this.getAllWindows.bind(this)
this.getLastFocusedWindow = this.getLastFocusedWindow.bind(this)
this.resourcePath = options.resourcePath
@ -210,6 +211,7 @@ class AtomApplication extends EventEmitter {
const {
pathsToOpen,
executedFrom,
foldersToOpen,
urlsToOpen,
benchmark,
benchmarkTest,
@ -248,9 +250,10 @@ class AtomApplication extends EventEmitter {
timeout,
env
})
} else if (pathsToOpen.length > 0) {
} else if ((pathsToOpen && pathsToOpen.length > 0) || (foldersToOpen && foldersToOpen.length > 0)) {
return this.openPaths({
pathsToOpen,
foldersToOpen,
executedFrom,
pidToKillWhenClosed,
devMode,
@ -382,6 +385,7 @@ class AtomApplication extends EventEmitter {
this.on('application:install-update', () => {
this.quitting = true
this.quittingForUpdate = true
this.autoUpdateManager.install()
})
@ -806,6 +810,7 @@ class AtomApplication extends EventEmitter {
//
// options -
// :pathsToOpen - The array of file paths to open
// :foldersToOpen - An array of additional paths to open that must be existing directories
// :pidToKillWhenClosed - The integer of the pid to kill
// :devMode - Boolean to control the opened window's dev mode.
// :safeMode - Boolean to control the opened window's safe mode.
@ -814,6 +819,7 @@ class AtomApplication extends EventEmitter {
// :addToLastWindow - Boolean of whether this should be opened in last focused window.
openPaths ({
pathsToOpen,
foldersToOpen,
executedFrom,
pidToKillWhenClosed,
devMode,
@ -825,8 +831,10 @@ class AtomApplication extends EventEmitter {
addToLastWindow,
env
} = {}) {
if (!pathsToOpen || pathsToOpen.length === 0) return
if (!env) env = process.env
if (!pathsToOpen) pathsToOpen = []
if (!foldersToOpen) foldersToOpen = []
devMode = Boolean(devMode)
safeMode = Boolean(safeMode)
clearWindowState = Boolean(clearWindowState)
@ -837,6 +845,22 @@ class AtomApplication extends EventEmitter {
hasWaitSession: pidToKillWhenClosed != null
})
})
for (const folderToOpen of foldersToOpen) {
locationsToOpen.push({
pathToOpen: folderToOpen,
initialLine: null,
initialColumn: null,
mustBeDirectory: true,
forceAddToWindow: addToLastWindow,
hasWaitSession: pidToKillWhenClosed != null
})
}
if (locationsToOpen.length === 0) {
return
}
const normalizedPathsToOpen = locationsToOpen.map(location => location.pathToOpen).filter(Boolean)
let existingWindow
@ -966,7 +990,7 @@ class AtomApplication extends EventEmitter {
const states = await this.storageFolder.load('application.json')
if (states) {
return states.map(state => ({
pathsToOpen: state.initialPaths,
foldersToOpen: state.initialPaths,
urlsToOpen: [],
devMode: this.devMode,
safeMode: this.safeMode

View File

@ -148,7 +148,7 @@ class AtomWindow extends EventEmitter {
handleEvents () {
this.browserWindow.on('close', async event => {
if (!this.atomApplication.quitting && !this.unloading) {
if ((!this.atomApplication.quitting || this.atomApplication.quittingForUpdate) && !this.unloading) {
event.preventDefault()
this.unloading = true
this.atomApplication.saveCurrentWindowOptions(false)

View File

@ -39,7 +39,7 @@ class AutoUpdater extends EventEmitter {
}
supportsUpdates () {
SquirrelUpdate.existsSync()
return SquirrelUpdate.existsSync()
}
checkForUpdates () {

View File

@ -1,7 +1,7 @@
const Module = require('module')
const path = require('path')
const cachedVm = require('cached-run-in-this-context')
const crypto = require('crypto')
const vm = require('vm')
function computeHash (contents) {
return crypto.createHash('sha1').update(contents, 'utf8').digest('hex')
@ -34,6 +34,24 @@ class NativeCompileCache {
this.previousModuleCompile = Module.prototype._compile
}
runInThisContext (code, filename) {
// produceCachedData is deprecated after Node 10.6, will need to update
// this for Electron 4.0 to use script.createCachedData()
const script = new vm.Script(code, {filename, produceCachedData: true})
return {
result: script.runInThisContext(),
cacheBuffer: script.cachedData
}
}
runInThisContextCached (code, filename, cachedData) {
const script = new vm.Script(code, {filename, cachedData})
return {
result: script.runInThisContext(),
wasRejected: script.cachedDataRejected
}
}
overrideModuleCompile () {
let self = this
// Here we override Node's module.js
@ -64,7 +82,7 @@ class NativeCompileCache {
let compiledWrapper = null
if (self.cacheStore.has(cacheKey)) {
let buffer = self.cacheStore.get(cacheKey)
let compilationResult = cachedVm.runInThisContextCached(wrapper, filename, buffer)
let compilationResult = self.runInThisContextCached(wrapper, filename, buffer)
compiledWrapper = compilationResult.result
if (compilationResult.wasRejected) {
self.cacheStore.delete(cacheKey)
@ -72,12 +90,12 @@ class NativeCompileCache {
} else {
let compilationResult
try {
compilationResult = cachedVm.runInThisContext(wrapper, filename)
compilationResult = self.runInThisContext(wrapper, filename)
} catch (err) {
console.error(`Error running script ${filename}`)
throw err
}
if (compilationResult.cacheBuffer) {
if (compilationResult.cacheBuffer !== null) {
self.cacheStore.set(cacheKey, compilationResult.cacheBuffer)
}
compiledWrapper = compilationResult.result

View File

@ -84,17 +84,17 @@ class Task
# Routes messages from the child to the appropriate event.
handleEvents: ->
@childProcess.removeAllListeners()
@childProcess.removeAllListeners('message')
@childProcess.on 'message', ({event, args}) =>
@emitter.emit(event, args) if @childProcess?
# Catch the errors that happened before task-bootstrap.
if @childProcess.stdout?
@childProcess.stdout.removeAllListeners()
@childProcess.stdout.removeAllListeners('data')
@childProcess.stdout.on 'data', (data) -> console.log data.toString()
if @childProcess.stderr?
@childProcess.stderr.removeAllListeners()
@childProcess.stderr.removeAllListeners('data')
@childProcess.stderr.on 'data', (data) -> console.error data.toString()
# Public: Starts the task.
@ -147,9 +147,9 @@ class Task
terminate: ->
return false unless @childProcess?
@childProcess.removeAllListeners()
@childProcess.stdout?.removeAllListeners()
@childProcess.stderr?.removeAllListeners()
@childProcess.removeAllListeners('message')
@childProcess.stdout?.removeAllListeners('data')
@childProcess.stderr?.removeAllListeners('data')
@childProcess.kill()
@childProcess = null

View File

@ -1191,6 +1191,10 @@ class TextEditorComponent {
decorationsByScreenLine.set(screenLine.id, decorations)
}
decorations.push(decoration)
// Order block decorations by increasing values of their "order" property. Break ties with "id", which mirrors
// their creation sequence.
decorations.sort((a, b) => a.order !== b.order ? a.order - b.order : a.id - b.id)
}
addTextDecorationToRender (decoration, screenRange, marker) {
@ -3862,15 +3866,24 @@ class LinesTileComponent {
if (blockDecorations) {
blockDecorations.forEach((newDecorations, screenLineId) => {
var oldDecorations = oldProps.blockDecorations ? oldProps.blockDecorations.get(screenLineId) : null
for (var i = 0; i < newDecorations.length; i++) {
var newDecoration = newDecorations[i]
if (oldDecorations && oldDecorations.includes(newDecoration)) continue
const oldDecorations = oldProps.blockDecorations ? oldProps.blockDecorations.get(screenLineId) : null
const lineNode = lineComponentsByScreenLineId.get(screenLineId).element
let lastAfter = lineNode
for (let i = 0; i < newDecorations.length; i++) {
const newDecoration = newDecorations[i]
const element = TextEditor.viewForItem(newDecoration.item)
if (oldDecorations && oldDecorations.includes(newDecoration)) {
if (newDecoration.position === 'after') {
lastAfter = element
}
continue
}
var element = TextEditor.viewForItem(newDecoration.item)
var lineNode = lineComponentsByScreenLineId.get(screenLineId).element
if (newDecoration.position === 'after') {
this.element.insertBefore(element, lineNode.nextSibling)
this.element.insertBefore(element, lastAfter.nextSibling)
lastAfter = element
} else {
this.element.insertBefore(element, lineNode)
}
@ -4433,7 +4446,7 @@ class NodePool {
if (element) {
element.className = className || ''
element.styleMap.forEach((value, key) => {
element.attributeStyleMap.forEach((value, key) => {
if (!style || style[key] == null) element.style[key] = ''
})
if (style) Object.assign(element.style, style)

View File

@ -2221,14 +2221,17 @@ class TextEditor {
//
// The following are the supported decorations types:
//
// * __line__: Adds your CSS `class` to the line nodes within the range
// marked by the marker
// * __line-number__: Adds your CSS `class` to the line number nodes within the
// range marked by the marker
// * __highlight__: Adds a new highlight div to the editor surrounding the
// range marked by the marker. When the user selects text, the selection is
// visualized with a highlight decoration internally. The structure of this
// highlight will be
// * __line__: Adds the given CSS `class` to the lines overlapping the rows
// spanned by the marker.
// * __line-number__: Adds the given CSS `class` to the line numbers overlapping
// the rows spanned by the marker
// * __text__: Injects spans into all text overlapping the marked range, then adds
// the given `class` or `style` to these spans. Use this to manipulate the foreground
// color or styling of text in a range.
// * __highlight__: Creates an absolutely-positioned `.highlight` div to the editor
// containing nested divs that cover the marked region. For example, when the user
// selects text, the selection is implemented with a highlight decoration. The structure
// of this highlight will be:
// ```html
// <div class="highlight <your-class>">
// <!-- Will be one region for each row in the range. Spans 2 lines? There will be 2 regions. -->
@ -2236,45 +2239,25 @@ class TextEditor {
// </div>
// ```
// * __overlay__: Positions the view associated with the given item at the head
// or tail of the given `DisplayMarker`.
// * __gutter__: A decoration that tracks a {DisplayMarker} in a {Gutter}. Gutter
// decorations are created by calling {Gutter::decorateMarker} on the
// desired `Gutter` instance.
// or tail of the given `DisplayMarker`, depending on the `position` property.
// * __gutter__: Tracks a {DisplayMarker} in a {Gutter}. Gutter decorations are created
// by calling {Gutter::decorateMarker} on the desired `Gutter` instance.
// * __block__: Positions the view associated with the given item before or
// after the row of the given `TextEditorMarker`.
// after the row of the given {DisplayMarker}, depending on the `position` property.
// Block decorations at the same screen row are ordered by their `order` property.
// * __cursor__: Render a cursor at the head of the {DisplayMarker}. If multiple cursor decorations
// are created for the same marker, their class strings and style objects are combined
// into a single cursor. This decoration type may be used to style existing cursors
// by passing in their markers or to render artificial cursors that don't actaully
// exist in the model by passing a marker that isn't associated with a real cursor.
//
// ## Arguments
//
// * `marker` A {DisplayMarker} you want this decoration to follow.
// * `decorationParams` An {Object} representing the decoration e.g.
// `{type: 'line-number', class: 'linter-error'}`
// * `type` There are several supported decoration types. The behavior of the
// types are as follows:
// * `line` Adds the given `class` to the lines overlapping the rows
// spanned by the `DisplayMarker`.
// * `line-number` Adds the given `class` to the line numbers overlapping
// the rows spanned by the `DisplayMarker`.
// * `text` Injects spans into all text overlapping the marked range,
// then adds the given `class` or `style` properties to these spans.
// Use this to manipulate the foreground color or styling of text in
// a given range.
// * `highlight` Creates an absolutely-positioned `.highlight` div
// containing nested divs to cover the marked region. For example, this
// is used to implement selections.
// * `overlay` Positions the view associated with the given item at the
// head or tail of the given `DisplayMarker`, depending on the `position`
// property.
// * `gutter` Tracks a {DisplayMarker} in a {Gutter}. Created by calling
// {Gutter::decorateMarker} on the desired `Gutter` instance.
// * `block` Positions the view associated with the given item before or
// after the row of the given `TextEditorMarker`, depending on the `position`
// property.
// * `cursor` Renders a cursor at the head of the given marker. If multiple
// decorations are created for the same marker, their class strings and
// style objects are combined into a single cursor. You can use this
// decoration type to style existing cursors by passing in their markers
// or render artificial cursors that don't actually exist in the model
// by passing a marker that isn't actually associated with a cursor.
// * `type` Determines the behavior and appearance of this {Decoration}. Supported decoration types
// and their uses are listed above.
// * `class` This CSS class will be applied to the decorated line number,
// line, text spans, highlight regions, cursors, or overlay.
// * `style` An {Object} containing CSS style properties to apply to the
@ -2300,12 +2283,15 @@ class TextEditor {
// Controls where the view is positioned relative to the `TextEditorMarker`.
// Values can be `'head'` (the default) or `'tail'` for overlay decorations, and
// `'before'` (the default) or `'after'` for block decorations.
// * `order` (optional) Only applicable to decorations of type `block`. Controls
// where the view is positioned relative to other block decorations at the
// same screen row. If unspecified, block decorations render oldest to newest.
// * `avoidOverflow` (optional) Only applicable to decorations of type
// `overlay`. Determines whether the decoration adjusts its horizontal or
// vertical position to remain fully visible when it would otherwise
// overflow the editor. Defaults to `true`.
//
// Returns a {Decoration} object
// Returns the created {Decoration} object.
decorateMarker (marker, decorationParams) {
return this.decorationManager.decorateMarker(marker, decorationParams)
}

View File

@ -1,8 +1,4 @@
(function () {
// Eagerly require cached-run-in-this-context to prevent a circular require
// when using `NativeCompileCache` for the first time.
require('cached-run-in-this-context')
const electron = require('electron')
const path = require('path')
const Module = require('module')