Commit Graph

316 Commits

Author SHA1 Message Date
Antonio Scandurra
72093da1a7 🔥 🎉 Remove scoped character width 2015-09-29 17:32:20 +02:00
Antonio Scandurra
a0277728d6 🔥 Remove deprecated methods 2015-09-25 12:58:23 +02:00
Antonio Scandurra
ce714b9852 🎨 Rename to ::onDidRequestAutoscroll 2015-09-25 10:57:09 +02:00
Antonio Scandurra
535a9da946 wip 2015-09-24 11:21:26 +02:00
Antonio Scandurra
1f81c633e0 Serialize state using logical coordinates 2015-09-24 09:01:51 +02:00
Antonio Scandurra
91ef57ed29 Merge branch 'master' into as-display-buffer-logical-coordinates
# Conflicts:
#	src/display-buffer.coffee
2015-09-23 18:46:16 +02:00
Antonio Scandurra
e85f61cced Continue emitting events when setting scroll top in the model 2015-09-23 17:43:53 +02:00
Antonio Scandurra
870a5303e1 🔥 Remove unused code 2015-09-23 15:34:45 +02:00
Antonio Scandurra
b198acc995 Fix soft wrapping when editorWidthInChars is used 2015-09-23 15:34:44 +02:00
Antonio Scandurra
fffcfb3405 Save scroll positions in the model to serialize 'em 2015-09-23 15:34:44 +02:00
Antonio Scandurra
140624326a Report the already calculated width to the model 2015-09-23 15:34:44 +02:00
Antonio Scandurra
abd1b05c65 Report the already calculated height to the model 2015-09-23 15:34:44 +02:00
Antonio Scandurra
fda981ed1d 🔥 Remove absolute scrolling from DisplayBuffer 2015-09-23 15:34:43 +02:00
Antonio Scandurra
49fae9b029 Test that the logical scroll event is triggered 2015-09-23 15:34:43 +02:00
Antonio Scandurra
e3dabd5200 Move scroll margin into TextEditorPresenter 2015-09-23 15:34:22 +02:00
Nathan Sobo
69c4764b2f Don’t use Serializable mixin in DisplayBuffer 2015-09-22 10:37:15 -06:00
Nathan Sobo
bf0bdd4882 🔥 Remove deprecations from DisplayBuffer 2015-09-22 10:37:07 -06:00
Thomas Johansen
c0f5a322fb 💚 Partially revert deprecation removal from DisplayBuffer 2015-09-22 10:37:06 -06:00
Thomas Johansen
1463266b84 🔥 Remove deprecations from DisplayBuffer 2015-09-22 10:37:05 -06:00
Antonio Scandurra
2588e9779e Avoid relying on ::scrollTop to calculate logical height 2015-09-22 18:13:41 +02:00
Antonio Scandurra
68e2d7e7e4 wip 2015-09-22 17:30:51 +02:00
Antonio Scandurra
b5a59017d5 wip 2015-09-22 16:20:15 +02:00
Nathan Sobo
314e082f1d Clean up max scroll margin code
Previously we were attempting the same computation twice, once
incorrectly when returning the scroll margins as integers and then doing
the same thing in terms of pixels. This just cleans up the original
calculation. It’s *slightly* different because it takes the floor to
continue returning integers, but the behavior is extremely close.
2015-08-27 17:40:01 -06:00
Nathan Sobo
2d25301ea0 Destroy folds when DisplayBuffer is destroyed
Fixes #4562
2015-07-27 12:04:46 -06:00
Nathan Sobo
5566d54f58 Don’t update screen lines if DisplayBuffer has been destroyed 2015-07-09 15:44:11 -05:00
Nathan Sobo
4567601ae9 Maintain change counts for debugging purposes
When we have an unexpected display-buffer or tokenized-buffer state,
we can include the change counts to make sure that every change to the
buffer has been processed by display-buffer and tokenized-buffer. If
they haven’t, there’s something wrong with our event ordering. If they
have, there’s a logic error somewhere else.
2015-07-09 02:18:24 -05:00
Nathan Sobo
afa6c9a786 Add invariant assertion about line count to see if we can find a bug
Does the line count ever get out of whack after an update, or is it
happening in some other way?
2015-07-09 01:55:13 -05:00
Nathan Sobo
3e7881f35f Report extra metadata when screen lines are undefined when clipping 2015-07-08 13:29:25 -05:00
aki
449c03cb35 Fix destroy listeners 2015-06-16 18:05:45 +09:00
Nathan Sobo
88812831ce Only check for max line length when lines exist 2015-06-05 23:40:56 +02:00
Nathan Sobo
56273e7eef Preserve large file mode across serialization and pane splits 2015-06-05 21:44:23 +02:00
Nathan Sobo
efd4662de0 Don’t allow soft wrap to be enabled in large file mode 2015-06-05 21:36:20 +02:00
Nathan Sobo
639647d115 Disallow fold creation in large file mode 2015-06-05 21:31:06 +02:00
Nathan Sobo
c34838277d In largeFileMode, base maxLineLength on the longest line we’ve seen
This is pretty hacky. If we want to compute the true longest line, we’ll
need to process every line, which is what large file mode is designed
to avoid. So now whenever the display buffer returns a line, it has
the potential to update the longest line.

This is a bit weird because retrieving a line now has a side effect.
It’s even more weird because the longest line will actually be wrong for
the initial state updates in the TextEditorPresenter. But as soon as
the user interacts in any way the dimensions are recomputed, so it works
for now.

A better approach may be to set a visible region on the display buffer.
But I’d like to keep this low-touch until we have a chance to revisit
the design of DisplayBuffer in a bigger way.
2015-06-05 19:55:34 +02:00
Nathan Sobo
de508db9b2 Implement basic large file mode for editor
* Don’t tokenize
* Don’t build metadata to support folds and soft wraps

Remaining issues:

* Max line length is hard coded
* Foldable indicators should be disabled
* Folding via API should be disallowed
2015-06-05 02:25:57 +02:00
Max Brunsfeld
b80c480d86 Store overlay decorations to optimize ::getOverlayDecorations() 2015-06-04 10:27:36 -07:00
Max Brunsfeld
f5895d8b0b presenter: use 'markers-updated' event for state updates
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-06-03 17:58:44 -07:00
Max Brunsfeld
6f553f234c Add TextEditor::observeMarkers, use it in presenter
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-05-29 17:21:23 -07:00
Nathan Sobo
2379b3803f Revert "Revert "Merge pull request #6757 from atom/ns-less-memory-for-tokens""
This reverts commit 7cb0bc3bc2.
2015-05-21 19:56:52 +02:00
Nathan Sobo
7cb0bc3bc2 Revert "Merge pull request #6757 from atom/ns-less-memory-for-tokens"
This reverts commit 0cd1f110b5, reversing
changes made to d75d202d33.

Conflicts:
	package.json
2015-05-21 16:25:23 +02:00
Nathan Sobo
50dd7ebbce Only perform a single marker query for folds when updating screen lines
This saves over 50ms to initialize the DisplayBuffer when opening
`text-editor.coffee`.
2015-05-21 00:54:12 +02:00
Nathan Sobo
2beb6c0fe0 Pass TokenIterator reference instead of using global singleton
Adds an extra reference to each tokenized line but is also more sane.

/cc @maxbrunsfeld
2015-05-20 19:29:38 +02:00
Nathan Sobo
3dcf9a4c66 Merge remote-tracking branch 'origin/master' into ns-less-memory-for-tokens 2015-05-16 03:05:11 +02:00
Max Brunsfeld
855d327d35 Merge pull request #6760 from atom/mb-text-buffer-6
Upgrade text-buffer for marker performance improvements
2015-05-14 14:29:35 -07:00
Nathan Sobo
e694b18ae2 Merge branch 'master' into ns-less-memory-for-tokens
Conflicts:
	spec/tokenized-buffer-spec.coffee
	src/tokenized-buffer.coffee
2015-05-14 18:55:16 +02:00
Max Brunsfeld
19d905606b Avoid double computation of screen lines when opening files
Previously, instantiating a TextEditor would always compute compute
screen lines twice: once when the DisplayBuffer was instantiated,
and once when the 'invisibles' property was set on the DisplayBuffer.
2015-05-13 19:59:25 -07:00
Max Brunsfeld
fe2cfff7a6 Allocate fewer objects for fold attributes in DisplayBuffer 2015-05-13 17:00:35 -07:00
Nathan Sobo
37d9a00b37 Use TokenIterator in DisplayBuffer instead of tokens shim 2015-05-14 01:15:44 +02:00
Max Brunsfeld
34a3ee1be9 ⬆️ text-buffer 2015-05-12 18:02:27 -07:00
Nathan Sobo
0d310c767f Splice in new DisplayBuffer lines in chunks to avoid stack overflows 2015-05-08 19:23:45 +02:00