Commit Graph

28629 Commits

Author SHA1 Message Date
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
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
Antonio Scandurra
1dc518050a Missing break statement when encountering an unmatched scope end tag 2016-04-27 10:56:50 +02:00
Lee Dohm
3b204d404f ⬆️ apm@1.9.3 2016-04-26 15:46:47 -07:00
Josh Abernathy
877601d5fb Merge pull request #11615 from atom/remove-app-delegate
Remove TextEditor's dependency on ApplicationDelegate
2016-04-26 17:11:38 -04:00
Wliu
6bb5e09af9 ⬆️ language-shellscript@0.22.0 2016-04-26 16:46:00 -04:00
joshaber
c3bfba0e53 We don't need to pass in an app delegate here anymore. 2016-04-26 16:15:30 -04:00
joshaber
e038ff3260 Remove applicationDelegate from TextEditor 2016-04-26 16:04:41 -04:00
Josh Abernathy
44d3f2dd07 Merge pull request #11614 from atom/remove-project-dependency
Remove TextEditor's dependency on Project
2016-04-26 15:47:32 -04:00
joshaber
aa9e8ab620 Update the spec. 2016-04-26 14:56:00 -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
a51c997b74 Merge branch 'master' into remove-project-dependency 2016-04-26 14:22:28 -04:00
Josh Abernathy
f960af51cd Merge pull request #11604 from atom/remove-view-registry-dependency
Remove TextEditor's dependency on ViewRegistry
2016-04-26 14:21:50 -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
joshaber
53b7a20ad7 ⬆️ status-bar@1.2.6 2016-04-26 11:40:56 -04:00
joshaber
e1c17ed856 ⬆️ status-bar@1.2.5 2016-04-26 11:17:20 -04:00
joshaber
9732874999 Don't log anymore. 2016-04-26 11:02:01 -04:00
joshaber
f70b93d9c2 Merge branch 'remove-packagemanager-dependency' into remove-project-dependency 2016-04-26 11:01:28 -04:00
Josh Abernathy
355d5b3544 Merge pull request #11606 from atom/fix-infinite-recursion
Fix infinite recursion in GitRepositoryAsync
2016-04-26 10:38:28 -04:00
joshaber
5d7c2fc8ba Just observe the grammar. 2016-04-26 10:32:41 -04:00
joshaber
0541755ac8 Consistent indentation. 2016-04-26 09:49:38 -04:00
joshaber
67c7c60dcc Test getUpstreamBranch 2016-04-26 09:49:03 -04:00
joshaber
e16e987e08 Give the fixture a remote 2016-04-26 09:46:04 -04:00
joshaber
33a9240fe1 ⬆️ ohnogit@0.0.11 2016-04-26 09:45:56 -04:00
joshaber
ff43d917be Lower case 2016-04-26 09:23:54 -04:00
joshaber
f86a15e5fc Spec for getOriginURL 2016-04-26 09:22:56 -04:00
joshaber
f589bdd8d9 Add a remote to the fixture. 2016-04-26 09:22:38 -04:00
Antonio Scandurra
7ba9cc6329 Unfold all the folds intersecting the row when clicking fold indicators 2016-04-26 13:24:21 +02:00
Antonio Scandurra
38bd120fb1 🎨 2016-04-26 12:11:13 +02:00
Antonio Scandurra
f81f54e08a Apply 'folded' decoration only to 1st screen row of a wrapped buffer row 2016-04-26 12:11:05 +02:00
Antonio Scandurra
4f6687324e Include bufferRange in decorationsStateForScreenRowRange 2016-04-26 12:09:38 +02:00
Antonio Scandurra
f85c72978e Fix wrong implementation in TextEditor.prototype.screenRowForBufferRow 2016-04-26 12:06:41 +02:00
Antonio Scandurra
ebfd821237 Destroy folds corresponding to fold-markers and not the whole buffer row 2016-04-26 10:47:42 +02:00
Antonio Scandurra
00ebe6bbbc Merge branch 'master' into ns-switch-to-display-layers
# Conflicts:
#	src/text-editor.coffee
2016-04-26 10:19:39 +02:00
Antonio Scandurra
e3773f24fc 🔥 Delete obsolete code 2016-04-26 10:05:35 +02:00
Damien Guard
891071196f Ensure atom.cmd with --wait returns exit code of 0 for git commit usage #11605 2016-04-25 15:28:22 -07:00
joshaber
8d26fe133a s/original/origin 2016-04-25 17:10:39 -04:00
joshaber
fdb439be9c Call through to the underlying repo. 2016-04-25 17:09:07 -04:00
joshaber
7ed4d60967 Don't need to pass Project around anymore. 2016-04-25 17:03:26 -04:00
joshaber
9fa669b293 Set the initial path after saving in Project. 2016-04-25 17:02:51 -04:00
joshaber
5cf532ebe8 Move checkoutHeadRevision to Workspace. 2016-04-25 17:02:36 -04:00
joshaber
856697e55f Uh we seriously don't need package manager.
Not sure how that slipped back in there.
2016-04-25 16:31:28 -04:00
joshaber
8d7f1b8fba Don't need to pass view registry through anymore. 2016-04-25 16:26:28 -04:00
joshaber
32a53e392c Merge branch 'remove-packagemanager-dependency' into remove-view-registry-dependency 2016-04-25 16:26:04 -04:00