Commit Graph

320 Commits

Author SHA1 Message Date
Indrek Ardel
55f3311c01 Remove unused variables 2016-09-26 20:52:13 +03:00
Antonio Scandurra
a45afcbba4 Always invalidate yardstick measurements when the editor becomes visible
...because content could get reflowed and previous measurements might
become inaccurate. Typically, this could occur when measuring while the
editor is hidden: in that case, the yardstick would always report `0px`
and save that position into the cache. Then, when the editor becomes
visible again, the wrong `0px` value would be returned, thus causing
cursors etc. to be displayed incorrectly.

This was being shadowed by a bug in our measurements cache, but after
fixing it in #12730 it started becoming evident.
2016-09-22 09:50:51 +02:00
Antonio Scandurra
24f9c24d79 🐛 Perform measurements only when editor is visible 2016-09-20 15:29:31 +02:00
Nathan Sobo
7a49013057 Only create a single deprecation warning per editor and improve message 2016-08-17 16:58:17 -06:00
Nathan Sobo
13c00995d4 Return default value of true from TextEditor.getAutoHeight
When we need to check for unassigned in the deprecated code path, we
can just read the instance variable directly to avoid getting the
deafult.

Signed-off-by: Antonio Scandurra <as-cii@github.com>
2016-08-17 15:52:51 -06:00
Nathan Sobo
106621e161 Deprecate automatic assignment of autoHeight for text editors
Previously, we attempted to automatically determine whether the editor’s
height should be based on the editor’s content or the height of its
container. Unfortunately, DOM APIs are insufficient to make this
determination in a complete way, leading to unpredictable behavior.

This PR deprecates the automatic determination of this behavior. By
default, editors base their height on their content. If an editor has
an explicit height assigned via its style or is positioned absolute with
an explicit top and bottom, we disable the content-based autoHeight and
log a deprecation warning telling the user to assign autoHeight
explicitly.

This paves the way to add an autoWidth setting, which will default to
false.
2016-08-17 15:52:51 -06:00
Antonio Scandurra
1587dcbe89 Take the gutter width into account when sizing TextEditorElement 2016-08-17 19:21:56 +02:00
Antonio Scandurra
6f0fd965cd Clear out width on TextEditorElement only if autoWidth was previously on 2016-08-17 18:05:16 +02:00
Antonio Scandurra
e8f2e3a608 Size TextEditorElement according to the autoWidth property 2016-08-17 16:20:00 +02:00
Max Brunsfeld
1c99c399d1 Merge branch 'master' into ns-mb-detangle-editor 2016-08-15 11:17:07 -07:00
Nathan Sobo
ced2174b5a Mock clock and animation frames in TextEditorComponent specs 2016-08-12 15:21:46 -06:00
Max Brunsfeld
11463ef00b Merge remote-tracking branch 'origin/as-introduce-editor-update' into ns-mb-detangle-editor 2016-08-11 11:36:48 -07:00
Max Brunsfeld
5d83874725 Merge branch 'master' into ns-mb-detangle-editor 2016-08-08 15:39:24 -07:00
Yuya Tanaka
1ce2f6ce87 🐛 Fix window size is not updated on resize 2016-08-05 11:56:01 +09:00
Max Brunsfeld
f1a302a139 Merge branch 'master' into ns-mb-detangle-editor 2016-07-28 10:33:23 -07:00
Max Brunsfeld
f48165deaf 🔥 Unused workspace parameter in TextEditorComponent 2016-07-28 10:07:53 -07:00
Max Brunsfeld
36ecbd4ca4 🔥 Unused grammar registry parameter in TextEditorComponent 2016-07-28 10:06:42 -07:00
Max Brunsfeld
738a2b90dc 🔥 useShadowDOM setting 2016-07-28 10:02:16 -07:00
Max Brunsfeld
e1f8a72995 Move ctrl-mousewheel handling out of TextEditorComponent
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-07-27 16:02:24 -07:00
Max Brunsfeld
63a730253b Don't use config for scrollSensitivity in TextEditorComponent
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-07-27 15:35:56 -07:00
Max Brunsfeld
4c03cb39de 🔥 Unused method
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-07-27 15:35:53 -07:00
Max Brunsfeld
1c38dce3b2 Don't use font config settings in TextEditorComponent
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-07-27 15:23:59 -07:00
Nathan Sobo
7c79a5b973 Fix regression where spacebar scrolled elements containing editors
/cc @hellendag
2016-07-27 14:58:11 -06:00
Antonio Scandurra
c769b169aa Allow scrollPastEnd to be set from the editor 2016-06-30 15:05:21 +02:00
Leo Lamprecht
0ceacf5c13 OSX -> macOS 2016-06-20 11:29:10 +02:00
Leonard Lamprecht
3a1ad3fd40 Replace OS X and Mac OS with macOS 2016-06-18 15:33:08 +02:00
Antonio Scandurra
f9039a35f6 Refactor isRowVisible to isRowRendered
There's a distinction to make between rendered and visible rows, and we
were using the former as if it was the latter. In particular, if a tile
is visible, all its rows get rendered on screen, even though they might
not necessarily be visible by the user.
2016-05-14 17:38:49 +02:00
Antonio Scandurra
7b2f049cbb 🎨 Refine binary search algorithm 2016-04-29 16:51:51 +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
bbef0b4551 💚 2016-04-14 11:19:45 +02:00
Nathan Sobo
be05071462 Merge remote-tracking branch 'origin/master' into ns-use-display-layers 2016-04-08 15:18:44 -06:00
joshaber
130c400758 Remove unnecessary fat arrow.
Looks like this was introduced in https://github.com/atom/atom/pull/11369. 
🙈
2016-04-07 11:25:00 -04:00
Nathan Sobo
85ab86df10 Merge branch 'master' into ns-use-display-layers 2016-04-05 16:40:41 -06:00
Antonio Scandurra
108513f994 Fix LinesYardstick specs to use the new tagCode-based scope structure
Also, remove specs testing RTL behavior. They don’t work as of today,
and I think we need a better approach to handle them, that doesn’t
solely rely on the DOM, but actually takes into account that e.g. (0, 0)
is the rightmost character on a right-to-left string.
2016-04-05 10:47:25 +02:00
Nathan Sobo
9833e54ec3 Fix typo 2016-04-04 19:22:44 -06:00
Nathan Sobo
f638bcbb6d Don’t assume the accented character menu on every IME event 2016-04-04 18:56:08 -06:00
Nathan Sobo
a99ee14ac0 Make accented character menu detection work with left/right arrow keys 2016-04-04 17:47:36 -06:00
Isaac Salier-Hellendag
2a7344091d Avoid setting hidden input value on textInput
Atom currently sets the `value` of the input on every `textInput` event, in an effort to appropriately handle changes made via the OSX diacritic menu (for accents, umlauts, etc).

The drawback of this is approach is that updating the value of the input will trigger layout and a subsequent layer tree update.

To resolve this, here is my proposal:

  - Track a flag for `keypress` events. When the diacritic menu is used, there are two `textInput` events, with no `keypress` in between. Therefore, when no `keypress` has occurred just prior to a `textInput`, the editor model can select the previous character to be replaced by the new accented character.
  - Track a flag for `compositionstart` events. When a user is in IME mode, the diacritic menu cannot be used, so the editor can skip the backward selection.

Test Plan:

Tested in a plaintext file.

  - Type Latin characters, verify proper character insertion.
  - Press and hold <kbd>a</kbd>. Diacritic menu appears. Select an option using the keyboard or mouse. Verify that the `a` is replaced by an accented `a`, with no extra characters.
  - Type test strings in Katakana, 2-Set Korean, Telex (Vietnamese), Simplified Pinyin. Verify that characters are inserted correctly while composing, and after committing strings.
2016-04-04 13:33:43 -07:00
joshaber
98c8a08ac3 s/ignoreScrollPastEnd/scrollPastEnd 2016-03-03 10:06:15 -05:00
joshaber
ff0b9e30a9 Add ignoreScrollPastEnd 2016-02-25 16:59:58 -05:00
joshaber
dd780a7c5a Revert "Use the computed style to find the height"
This reverts commit 822cd78055.
2016-02-25 15:41:55 -05:00
joshaber
822cd78055 Use the computed style to find the height 2016-02-25 15:18:29 -05:00
Wliu
7ee74ed4c7 Merge branch 'master' into wl-electron-35 2016-01-15 17:20:31 -05:00
Antonio Scandurra
a812f282a2 Measure decorations only for visible editors 2016-01-14 12:36:23 -07:00
Antonio Scandurra
f81843d465 Merge branch 'master' into as-block-decorations 2016-01-14 09:30:06 -07:00
Wliu
d855613340 Merge remote-tracking branch 'refs/remotes/origin/master' into wl-electron-35 2016-01-05 17:25:51 -05:00
Nathan Sobo
6669703677 Force a sync render when measuring if we don’t have a DOM node for a row 2016-01-04 16:40:56 -07:00
Nathan Sobo
9f6fbacddd Don’t clip screen positions in yardstick
By clipping positions only in the TextEditorComponent, we can ensure
that we check for the presence of a rendered line for the clipped row
value.
2016-01-04 16:32:38 -07:00
Antonio Scandurra
07234c5109 Resize all block decorations when width changes 2015-12-19 12:50:58 +01:00
Antonio Scandurra
8710089cb7 Support only Shadow DOM enabled editors 2015-12-18 15:43:23 +01:00