Commit Graph

14990 Commits

Author SHA1 Message Date
Antonio Scandurra
1c694df03b Don't show indent guides for mini editors 2016-05-01 11:42:28 +02:00
Antonio Scandurra
4f5efe98ff Overshoot to the nearest character when text nodes are not contiguous 2016-05-01 11:05:14 +02:00
Antonio Scandurra
334b4c1104 Overshoot to the end of the text node when the position cannot be found
...because the only possible scenario when a logical position in a text
node cannot be found is when the requested pixel position is exactly at
the end of the node.
2016-04-30 11:51:54 +02:00
Antonio Scandurra
02d9245c05 Merge branch 'master' into ns-switch-to-display-layers 2016-04-30 11:10:17 +02:00
Antonio Scandurra
7690331555 Merge branch 'master' into wl-electron-37
# Conflicts:
#	package.json
2016-04-30 09:23:14 +02:00
Antonio Scandurra
005022567b Merge pull request #11348 from atom/wl-drewmnoel-electron
Update Electron to 0.36.12
2016-04-30 09:19:17 +02:00
Antonio Scandurra
5a9bd28912 Merge pull request #11646 from atom/as-persist-state-on-reload
Persist the entire state on reload
2016-04-30 01:36:37 +02:00
Wliu
e237a37987 Merge remote-tracking branch 'refs/remotes/origin/master' into wl-electron-37 2016-04-29 18:43:48 -04:00
Lee Dohm
f6352cb47b Merge pull request #11618 from delliott2016/master
Prompt for ctrl-o defaults to last directory where you opened a file
2016-04-29 10:53:17 -07:00
Lee Dohm
fc04e35621 Merge pull request #11634 from livelazily/get-completed-data
🐛 Wait for connection end to get completed data;
2016-04-29 09:35:16 -07:00
David Elliott
6c9d7ecc28 Remove random space 2016-04-29 08:39:14 -07:00
David Elliott
e2fa948ac8 🐛 Add support for Mac and Open Folder dialog. 2016-04-29 08:20:52 -07:00
Antonio Scandurra
7b2f049cbb 🎨 Refine binary search algorithm 2016-04-29 16:51:51 +02:00
Antonio Scandurra
d1583b46cf Merge branch 'rahatarmanahmed-perf-text-node-binary-search' into ns-switch-to-display-layers 2016-04-29 14:58:42 +02:00
Antonio Scandurra
c5a76d4a7d Persist the entire state on reload
This fixes an annoying problem that prevented the state of marker layers
from being saved when the window was reloaded either via `Cmd+R` in
DevTools or via `Ctrl+Option+Cmd+L` in Atom.

The issue was that we were *always* scheduling `saveState` on an idle
callback: `window.onbeforeunload`, however, doesn't wait for that event
before closing the window, and thus that state was never saved in those
situations.

The solution is to use idle callbacks only during the critical code path
(i.e. on mousedown and keydown), but save it synchronously otherwise.
Saving something to IndexedDB is actually asynchronous too, but it seems
like Chrome fulfills `put` requests that get executed right during
`onbeforeunload`.
2016-04-29 14:41:34 +02:00
Rahat Ahmed
c6bd9bc8c0 Adjustments for @as-cii 2016-04-28 15:28:54 -05:00
Damien Guard
d3ee21941a Fix some specs on Windows and honor options.shell 2016-04-28 12:23:44 -07:00
David Elliott
398ae4491e 🎨 Removed application:open-dev and application:open-safe from new method. 2016-04-28 11:13:07 -07:00
Giuseppe Piscopo
07bf40879d Fix coffeelint error on trailing whitespace 2016-04-28 19:25:54 +02:00
joshaber
2f1268dc7c Move copyPathToClipboard to the default commands. 2016-04-28 11:36:17 -04:00
Josh Abernathy
5ba701f112 Merge pull request #11616 from atom/dont-require-assert
Remove TextEditor's dependency on assert
2016-04-28 10:41:53 -04:00
joshaber
76d8421963 Inline the no-op assert. 2016-04-28 09:50:01 -04:00
joshaber
23023a7a3d Merge branch 'master' into dont-require-assert 2016-04-28 09:48:52 -04:00
Antonio Scandurra
f2a497d591 Don't create folds for empty ranges 2016-04-28 13:43:00 +02:00
Antonio Scandurra
57442781ec Fix bug when positioning cursors after the fold-marker 2016-04-28 13:31:28 +02:00
Giuseppe Piscopo
bebaf1bdb0 extract Windows PowerShell operations from squirrel-update 2016-04-28 09:24:37 +02:00
livelazily
3b5bcf1c0d 🐛 Wait for connection end to get completed data; 2016-04-28 14:27:56 +08:00
joshaber
cd8b28da4d Document why 2016-04-27 22:40:34 -04:00
Giuseppe Piscopo
63c45cc8fd extract Windows registry operations from squirrel-update 2016-04-28 03:20:55 +02:00
Giuseppe Piscopo
77dcf37ee3 extract process spawning from squirrel-update 2016-04-28 03:20:55 +02:00
joshaber
d11e30579b Manually emit the change event. 2016-04-27 17:17:09 -04:00
joshaber
c0adf125ec Reset the cache before calling the callback. 2016-04-27 16:05:00 -04:00
joshaber
20e2486bfb Merge branch 'master' into fix-cached-status 2016-04-27 15:53:23 -04:00
David Elliott
6ec5cf497b 🐛 Ctrl-O opens file dialog in directory of currently active editor 2016-04-27 10:52:57 -07:00
joshaber
69e97204d5 Test for undefinedness instead of 0. 2016-04-27 12:50:27 -04:00
Antonio Scandurra
ce4b2fa810 Merge branch 'master' into ns-switch-to-display-layers
# Conflicts:
#	src/display-buffer.coffee
#	src/text-editor.coffee
#	src/tokenized-buffer.coffee
2016-04-27 18:16:03 +02:00
Antonio Scandurra
5cfe97160d Report boundary when next line's openScopes don't match containingTags
Sometimes, when performing an edit, a change on some row can cause
another row's tokenization to be affected: the classic example is
opening a multi-line comment on a line, thereby causing subsequent lines
to become commented out without changing the buffer's contents at those
locations. We call this technique "spill detection".

Since the amount of affected lines can grow quite large, Atom tokenizes
synchronously only those lines where the edit occurred, triggering
background (i.e. `setInterval`) tokenization for all the other lines
that need to be refreshed because of a "spill".

As predictable, this approach causes a temporary inconsistency in the
stored tokenized lines. In particular, suppose we had two tokenized
lines, and that there's an open tag in the middle of the first one which
closes on the second one. If we perform an edit that causes that tag to
be deleted, when reading the second tokenized line we now have a
dangling close tag.

This didn't matter much in the `DisplayBuffer` version, because for each
line we reopened all the tags found in the stored `openScopes` property,
and closed all the tags starting on such line right at the end of it.

In the `DisplayLayer` world, however, we don't read tags from each
tokenized line, but we let `TokenizedBufferIterator` report tag
boundaries and their respective location: since this is an
iterator-based approach, we were not reading `openScopes` for each
`TokenizedLine`, making the dangling close tag example showed above
evident (e.g. close and open tags didn't match anymore, and exceptions
were being thrown all over the place).

To solve this issue I have considered several approaches:

  1. Recompute all the lines where a spill occurs synchronously when the
  buffer changes. For large files, this can be pretty onerous, and we
  don't want to regress in terms of performance.

  2. Let `TokenizedBuffer.tokenizedLineForRow(bufferRow)` recompute
  potential invalid lines lazily (starting from the first invalid line,
  down to the requested buffer row). When editing the first lines of a
  long file and causing a spill to occur, Atom (or any other package,
  for that matter) could request a line down in the file, causing this
  method to recompute lots and lots of lines.

  3. Let `DisplayLayer` deal with closing an un-opened tag. This is nice
  because we already keep track of containing tags there. However, it
  also feels like the wrong spot where to put this logic, as display
  layers shouldn't deal with grammar-related stuff.

  4. Keep track of containing tags in `TokenizedBufferIterator`, and
  report a boundary at the end of the line when the subsequent one's
  `openScopes` property doesn't match the `containingTags` that the
  iterator has been keeping track of.

Of all these solutions I've chosen 4), because it's the most performant
and clean in terms of code.
2016-04-27 18:06:13 +02:00
joshaber
5db3280bf0 Provide openedPath
For backward compatibility with GitRepoAsync before moving to ohnogit.
2016-04-27 11:59:05 -04:00
Antonio Scandurra
1dc518050a Missing break statement when encountering an unmatched scope end tag 2016-04-27 10:56:50 +02:00
David Elliott
e0688bef1a Ctrl-o opens last directory where you opened a file 2016-04-26 16:15:41 -07:00
Rahat Ahmed
f97d197a60 🏇 Improve perf for clicking on long buffer rows
Reimplements the `screenPositionforPixelPosition` method in `lines-yardstick.coffee` to use two binary searches to find the position in order to minimize the number of `getBoundingClientRect` calls. The first stage performs a binary search on the text nodes of a row to find the node containing the pixelPosition. The second stage performs a binary search within the text node to find the character that contains the pixelPosition. This improves responsiveness when clicking near the end of a very long line of text.

Resolves #10769
2016-04-26 16:02:13 -05:00
joshaber
c3bfba0e53 We don't need to pass in an app delegate here anymore. 2016-04-26 16:15:30 -04:00
joshaber
46c97ee2b2 Provide a default assert implementation if one isn't passed in. 2016-04-26 16:14:25 -04:00
joshaber
e038ff3260 Remove applicationDelegate from TextEditor 2016-04-26 16:04:41 -04:00
joshaber
a7606710c0 Don't need Directory anymore. 2016-04-26 14:55:43 -04:00
joshaber
5fd556ac58 We need Directory now. 2016-04-26 14:55:37 -04:00
joshaber
b6e7ef60d5 Merge branch 'remove-view-registry-dependency' into remove-project-dependency 2016-04-26 12:55:45 -04:00
joshaber
ee88b4b2c1 Merge branch 'master' into remove-view-registry-dependency 2016-04-26 12:44:01 -04:00
Josh Abernathy
bb1b89da60 Merge pull request #11603 from atom/remove-packagemanager-dependency
Remove TextEditor's dependency on PackageManager
2016-04-26 12:43:35 -04:00
joshaber
40d7761350 Bail if we don't have a grammar yet. 2016-04-26 11:48:52 -04:00