Commit Graph

319 Commits

Author SHA1 Message Date
Antonio Scandurra
0a702d1680 Skip obsolete tests for now, but delete them later 2017-05-05 09:29:29 +02:00
Andres Suarez
1ee9d7b0f9 Add showCursorOnSelection config 2017-01-20 08:53:28 -05:00
Christopher Chedeau
ef7ce7cd3a Always reserve two digits on the line number gutter
We are working on a feature that changes the content of the editor when you mouse over some things and it makes the UI jump when going from 1 line to > 10. This makes the UI feel really bad.

I've looked at Sublime and the 1-9 state is the same as 1-99, only when you reach 100 lines then it jumps. I think that it is a better behavior as you want to minimize jumps as much as possible and it is extremely likely that you are going to hit the 9-10 lines threshold.

![](http://g.recordit.co/ABIlZf5eTx.gif)

While this is being reviewed and until the new version shipped, we are going to monkeypatch Atom in order to get this feature.

```js
var presenter = atom.textEditors.editors.entries().next().value[0].presenter.__proto__;
var old_updateLineNumberGutterState = presenter.updateLineNumberGutterState;
presenter.updateLineNumberGutterState = function() {
  var res = old_updateLineNumberGutterState.apply(this, arguments);
  this.lineNumberGutter.maxLineNumberDigits = Math.max(2, this.lineNumberGutter.maxLineNumberDigits);
  return res;
};
```

Released under CC0
2017-01-10 18:14:50 -08:00
Max Brunsfeld
79e68b462d Avoid using torn-down properties in specs 2017-01-02 11:55:41 -08:00
Nathan Sobo
953e8eec0e Merge branch 'master' into MikeInnes-overlay-scroll 2016-12-12 08:38:38 -07:00
Max Brunsfeld
f7c5cebdaf Add test for highlight region calculation error 2016-11-28 17:39:36 -08:00
Nathan Sobo
f4c45c1e39 Rename stable: true to avoidOverlay: false and fix tests
As part of the test fixes, I’m honoring the `autoscroll: false` option
in `insertText` and `insertNewline` to avoid inadvertently scrolling the
editor during tests when the editor is modified.
2016-11-28 12:45:05 -07:00
Mike J Innes
f9ef678c4a scroll test 2016-11-28 11:08:39 +00:00
Max Brunsfeld
5509475173 Ensure presenter forces DisplayLayer computations when rendering
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-11-11 12:55:57 -08:00
Antonio Scandurra
4df74beba7 Merge branch 'master' into as-deprecate-shadow-dom 2016-10-17 12:06:00 +02:00
Antonio Scandurra
3d2e18747f Prefer using new TextEditor to Workspace.prototype.buildTextEditor 2016-10-10 09:28:36 +02:00
Antonio Scandurra
1091b0eb60 Fix decorations flashing more than once
When, after flashing a decoration, the decorated range moved, Atom was
showing an additional flash, even if the previous one had already been
consumed. This bug originated in `HighlightsComponent`, where we
maintained state about a certain highlight's flash count. The problem
with this approach, however, is that highlight objects in the component
are very volatile, and we could even have more than one for a single
decoration (i.e. when such decoration spans multiple tiles).

To fix this, we'll now maintain some additional state in
`TextEditorPresenter`, which will set a `needsFlash` attribute on the
highlight state objects, thereby preventing `HighlightsComponent` from
showing the flash animation more than once when the decorated range
changes.
2016-10-07 10:40:41 +02:00
Antonio Scandurra
9c5bddaa69 Reimplement block decorations without the shadow DOM 2016-10-07 10:40:41 +02:00
Indrek Ardel
55f3311c01 Remove unused variables 2016-09-26 20:52:13 +03:00
Antonio Scandurra
1587dcbe89 Take the gutter width into account when sizing TextEditorElement 2016-08-17 19:21:56 +02:00
Antonio Scandurra
e71027ed36 Ensure editors don't scroll or show scrollbars when autoWidth is enabled 2016-08-17 17:58:36 +02:00
Antonio Scandurra
e8f2e3a608 Size TextEditorElement according to the autoWidth property 2016-08-17 16:20:00 +02:00
Antonio Scandurra
2e37d7f0cf Change state.content.width based on autoWidth 2016-08-17 16:14:57 +02:00
Max Brunsfeld
4b0183d074 Remove extraneous TextEditor setter methods 2016-08-15 16:45:10 -07:00
Max Brunsfeld
684952458f Remove new TextEditor setters; just use update 2016-08-11 15:34:54 -07:00
Max Brunsfeld
3f8b6138dc Don't use config in TextEditorPresenter
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-07-27 14:56:36 -07:00
Max Brunsfeld
e35c761246 Use setShowInvisibles in TextEditorPresenter spec 2016-07-27 11:23:39 -07:00
Antonio Scandurra
209e9d8d9c Add coverage for position: 'after' in cursor's state specs 2016-05-24 10:54:01 +02:00
Antonio Scandurra
c0bed9ab50 🐛 Enforce block decorations to be 'before' by default 2016-05-24 10:49:59 +02:00
Antonio Scandurra
896abe358c Merge pull request #11765 from atom/as-fix-presenter-uncaught-exception
Don't render line-numbers corresponding to lines that need measuring
2016-05-16 14:21:43 +02:00
Antonio Scandurra
c13346a455 Show folded marker in the first screen row of a soft-wrapped buffer row 2016-05-16 11:23:54 +02:00
Antonio Scandurra
b5b324875e Don't render line-numbers corresponding to lines that need measuring
Rendering those line numbers in the gutter isn't useful, and it puts
unneeded pressure to the DOM. In the process of changing
`updateLineNumbersState`, we have also refactored it to stop relying on
row ranges being contiguous. This allows that code path to be:

1. Less error-prone, because we were trying to access rows that weren't
actually rendered, thus potentially throwing errors when measuring
non-contiguous screen rows that weren't visible.
2. Tighter, because we can just iterate over each screen row and ask for
its soft-wrap descriptor.
2016-05-16 10:58:37 +02:00
Antonio Scandurra
f4a31261d0 Delete indent guides code from the presenter and the component
…because we're handling that behavior in `TextEditor` and `DisplayLayer`
now.
2016-05-01 11:48:39 +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
a083a754a5 💚 Fix TextEditorPresenter specs 2016-04-05 11:12:51 +02:00
Antonio Scandurra
708da39355 Avoid using tokenizedLineForScreenRow in TextEditorPresenter specs 2016-03-17 10:35:54 +01:00
joshaber
98c8a08ac3 s/ignoreScrollPastEnd/scrollPastEnd 2016-03-03 10:06:15 -05:00
joshaber
4cd7cbda02 Test ignoreScrollPastEnd. 2016-03-01 10:53:31 -05:00
Max Brunsfeld
98559f5d34 Add missing 2016-02-22 16:31:17 -08:00
Max Brunsfeld
ea5500a124 Print line number of wait timeout in presenter spec 2016-02-22 16:31:06 -08:00
joshaber
f0a179fdb5 Add the decoration after subscribing to state updates
Same fixe as #10792.
2016-02-15 17:19:32 -05:00
joshaber
cc3f6b888f Don't need to duplicate this line. 2016-02-12 16:35:16 -05:00
joshaber
82860a12a0 Fix waitsForStateToUpdate proper like. 2016-02-12 16:35:10 -05:00
joshaber
9fa766e01a Don't use synchronous updates anymore. 2016-02-12 15:13:10 -05:00
joshaber
6813bf50a0 Use waitsForStateToUpdateAsync in a bunch of places. 2016-02-12 14:00:47 -05:00
joshaber
272ff19d7b Decrease the timeout interval. 2016-02-12 13:58:54 -05:00
joshaber
8b14f5afdc Let's get some deterministic failures. 2016-02-12 13:58:38 -05:00
joshaber
319043c93d Update this test too. 2016-02-12 12:11:52 -05:00
joshaber
07d35245e0 Move it around again. 2016-02-12 11:51:48 -05:00
joshaber
a3ec51f492 Let's try rearranging this. 2016-02-12 11:46:43 -05:00
joshaber
dd6a6be8b1 Once more, with feeling. 2016-02-12 10:56:36 -05:00
joshaber
3e7de73580 Bump the timeout. 2016-02-12 09:58:37 -05:00
Wliu
8ca1071168 Update presenter specs 2016-02-08 16:52:47 -05:00
Antonio Scandurra
1f0e6a0902 Don't calculate height for following decorations at beginning of tiles 2016-01-13 09:21:31 -07:00
Antonio Scandurra
4499fa8d6f Split following and preceding block decorations
In TextEditorPresenter's state for lines.
2016-01-12 12:04:12 -07:00