Commit Graph

33889 Commits

Author SHA1 Message Date
Nathan Sobo
cd8233028d Merge pull request #15347 from atom/ns-capture-mouseup
Use capture phase for mouseup handler
2017-08-16 17:24:37 -06:00
Nathan Sobo
d88ddc3d4d Merge pull request #15345 from atom/ns-round-max-scroll-top
Round return values of getMaxScrollTop, getScrollHeight
2017-08-16 17:24:09 -06:00
Nathan Sobo
ccb3aaacf7 Merge pull request #15346 from atom/ns-fix-alt-bindings
Suppress default-prevented composition events on compositionstart instead of compositionupdate
2017-08-16 17:23:50 -06:00
Nathan Sobo
3926dac789 Use capture phase for mouseup handler
This ensures that we always handle the mouseup even if the mouse is
outside of the editor when the button is released
2017-08-16 16:28:18 -06:00
Nathan Sobo
3d9b49056e Suppress default-prevented composition events on compositionstart
This avoids creating a composition checkpoint and reverting to it on the
next keystroke, which causes the cursor to move.
2017-08-16 16:06:53 -06:00
Nathan Sobo
9cf7f609f5 Round return values of getMaxScrollTop/Left 2017-08-16 15:59:04 -06:00
Katrina Uychaco
d2a266e369 ⬆️ text-buffer@13.0.10 2017-08-16 14:21:57 -07:00
Nathan Sobo
72322985d9 Merge pull request #15337 from atom/ns-remeasure-longest-line
Remeasure the longest line's width when the font size changes
2017-08-16 14:32:22 -06:00
Jordan Eldredge
228f65da5f Base context menu accelerators on activeElement
Addresses issue pointed by out @nathansobo in #15277 where keybindings
for unfocusable nodes were being surfaced as accelerator indicators in
context menus.

When you right click in the DOM, your focus goes to the first focusable
ancestor of your click target. This change uses the ancestor that you
are actually focused on when looking for avaliable key bindings rather
than using the event target directly. This ensures that any surfaced key
bindings are actually reachable.
2017-08-16 11:58:05 -07:00
Nathan Sobo
2bcfd934c0 Fix tests by ignoring off screen lines
Also, clear the dataset when recycling DOM elements

Signed-off-by: Antonio Scandurra <as-cii@github.com>
2017-08-16 12:31:42 -06:00
Antonio Scandurra
15e3fbaa07 Merge pull request #15339 from atom/ns-as-clear-lines-to-measure-later
Only clear linesToMeasure when we have actually measured
2017-08-16 20:08:59 +02:00
Nathan Sobo
9d356020c5 Remeasure the longest line's width when the font size changes 2017-08-16 11:53:55 -06:00
Nathan Sobo
c626836b2e Only clear linesToMeasure when we have actually measured
Previously, as soon as we decided to render linesToMeasure, we would
clear them out. However, if a second update interleaved with the update
that initially requested measurement, it could cause the requested lines
to not be present when the measurement phase from the first update
occurred. Now, any additional updates will only add to the set of lines
that need to be measured until the measurement phase actually happens.

Signed-off-by: Antonio Scandurra <as-cii@github.com>
2017-08-16 11:28:58 -06:00
Nathan Sobo
b9421f721e Merge pull request #15338 from atom/ns-hide-extra-lines-to-measure
Hide off-screen lines when we render them for measurement
2017-08-16 10:45:29 -06:00
Nathan Sobo
c398fe66c9 Hide off-screen lines when we render them for measurement 2017-08-16 10:00:57 -06:00
Bryant Ung
f47cf5b545 ⬆️ autocomplete-plus 2017-08-15 20:52:17 -07:00
Bryant Ung
da2c3fb56b Revert "⬆️ autocomplete-plus@v2.35.8"
This reverts commit 3c2f257155.
2017-08-15 20:47:32 -07:00
Wliu
aac5458f3c ⬆️ settings-view@0.251.5 2017-08-15 22:01:26 -04:00
Nathan Sobo
e9a00ce9b3 Merge pull request #15324 from atom/ns-fix-mousewheel-handling
Only scroll one axis at a time, whichever has the greater delta
2017-08-15 19:29:36 -06:00
simurai
3c2f257155 ⬆️ autocomplete-plus@v2.35.8 2017-08-16 10:17:19 +09:00
Nathan Sobo
de456159a7 Merge pull request #15322 from atom/ns-move-placeholder-text
Move placeholder text inside lines div
2017-08-15 18:13:23 -06:00
Ian Olsen
edcac6897f Merge branch 'master' into pb-remove-unneeded-files-win 2017-08-15 16:12:15 -07:00
Nathan Sobo
4493ae2270 Only scroll one axis at a time, whichever has the greater delta 2017-08-15 16:08:07 -06:00
Nathan Sobo
b35708b8cf Add test for placeholder text positioning 2017-08-15 15:48:18 -06:00
Nathan Sobo
c9b558a08a Move placeholder text inside .lines div
If themes apply padding to the .lines div, the placeholder text looks
mis-aligned unless it is placed within the .lines div
2017-08-15 15:38:04 -06:00
Nathan Sobo
586b818bae Merge pull request #15317 from atom/as-fix-wrong-measurements
Move cursors container inside lines container
2017-08-15 11:38:54 -06:00
Antonio Scandurra
382e1b402a ⬆️ apm 2017-08-15 19:25:01 +02:00
Antonio Scandurra
3d71e627eb Move cursors container inside lines container
This will ensure that applying any style that changes the location of
the lines container will also correctly position the cursors.
2017-08-15 18:44:23 +02:00
Nathan Sobo
8e6497bfba Merge pull request #15277 from captbaritone/accel
Add accelerator indicators to context menus
2017-08-15 10:40:35 -06:00
Nathan Sobo
360f89e33a Merge pull request #15314 from atom/as-stop-ime-input-on-prevent-default
Suppress text input for default-prevented keydown events
2017-08-15 10:13:40 -06:00
Nathan Sobo
7226f6fb08 Merge pull request #15313 from atom/as-fix-extra-schedule-update
Ensure extra document updates are not scheduled during `updateSync`
2017-08-15 09:01:22 -06:00
Nathan Sobo
839f812ee2 Merge pull request #15310 from atom/as-fix-scroll-sensitivity
Honor editor's `scrollSensitivity` parameter
2017-08-15 08:57:50 -06:00
Antonio Scandurra
37274d3365 Suppress text input for default-prevented keydown events
This is a continuation of #15266. In that pull-request we managed to
prevent IME previews from being displayed in the editor when the
originating `keydown` event was default-prevented. However, it was still
possible for IME input to make it through the previous workarounds, thus
triggering the `textInput` event and showing unwanted text.

Pressing another key that would complete the in-progress IME input
would, in fact, first replace `this.lastKeydown` and then trigger the
`textInput` event. In the handling of that event we would detect
`this.lastKeydown` as "non-default-prevented" and therefore mistakenly
insert the IME text.

With this commit we are adopting a different strategy to mitigate the
issue. When receiving the wrong `compositionupdate` event we will first
disable the hidden input and then re-enable it on the next tick.
Disabling the input causes the in-progress IME input to be aborted and
the browser to never fire `textInput` nor `compositionupdate` events
anymore after that.

The only downside of this approach is that the hidden input also loses
focus, but we transfer it back to it as soon as the next tick of the
event loop is served and the input has been re-enabled.
2017-08-15 16:44:53 +02:00
Antonio Scandurra
f569514938 Ensure extra document updates are not scheduled during updateSync
When changing the editor styles, we force the component to remeasure
character dimensions. If they change, each line's height could change
too, causing the current scroll top position to not match the viewport
the user was observing. Thus, when detecting a line height change, we
try to show users the area of the screen they were looking prior to
tweaking the font size.

In trying to maintain the aforementioned logical position, however, we
were mistakenly scheduling a new update before actually finishing the
current one. This was problematic because if the first update detected
that the longest screen line changed and such line was off-screen, it
would try to render it. Before having the chance to measure it, though,
the new update would kick in and delete the new longest screen line
node, because it assumed it had already been measured. Finally, when
`measureContentDuringUpdateSync` fired, it would notice that the longest
screen line node did not exist and throw an exception as a result.

This commit changes the `updateSync` method to set the `updateScheduled`
flag only before returning control to the caller, as opposed to doing so
at the beginning. This prevents calls to `scheduleUpdate` made in
`updateSync` from scheduling new unwanted updates.
2017-08-15 15:32:29 +02:00
Antonio Scandurra
e980598aba Honor editor's scrollSensitivity parameter 2017-08-15 12:22:59 +02:00
Antonio Scandurra
756dad67d8 ⬆️ symbols-view 2017-08-15 11:25:23 +02:00
Antonio Scandurra
2cd107a4e8 Merge pull request #14682 from atom/bring-back-asar
Bring back ASAR archives
2017-08-15 10:43:29 +02:00
Antonio Scandurra
84673775af Merge branch 'master' into bring-back-asar 2017-08-15 10:03:27 +02:00
Nathan Sobo
708c9b4e22 ⬆️ text-buffer
Fixes #15190
2017-08-14 15:36:03 -06:00
Nathan Sobo
2fc2c9caa7 Merge pull request #15302 from atom/ns-as-always-render-input
Always render hidden input
2017-08-14 15:34:45 -06:00
Nathan Sobo
433c514673 Always render hidden input
This avoids mysterious timing issues in which the editor gets a 'focus'
event in a state where `isVisible` returns false. If we always render
the hidden input, we can always focus it.

Signed-off-by: Antonio Scandurra <as-cii@github.com>
2017-08-14 11:53:02 -06:00
Nathan Sobo
2f2d62ca51 Merge pull request #15296 from atom/as-fix-cancel-dialog-on-quit-or-restart
Prompt user only once when quitting/restarting and canceling save dialog
2017-08-14 09:04:04 -06:00
Nathan Sobo
2d6b9e2606 Merge pull request #15299 from atom/as-do-nothing-when-clicking-on-block-decorations
Ignore clicks on block decorations
2017-08-14 08:59:27 -06:00
Antonio Scandurra
eb1eeb3fde Ignore clicks on block decorations
Previously, clicking on a block decoration to interact with it would
cause the editor to scroll to the line next to it. This is inconvenient,
especially if the decoration was designed to be interactive and
contained buttons or links. If the decoration was close to the bottom of
the screen, clicking on a button inside of it would make the editor
scroll down and abort the click.

This behavior regressed during the editor rendering layer rewrite and
with this commit we are restoring the original behavior by simply
ignoring clicks that land on block decorations.
2017-08-14 15:43:48 +02:00
Antonio Scandurra
e50a73b033 Fix tests 2017-08-14 12:28:19 +02:00
Antonio Scandurra
91b7c14281 Prompt user only once when quitting/restarting and canceling save dialog
I think this slipped through during the refactoring performed in
dc32018. With this commit we are fixing the regression and adding a new
main process regression test to exercise this behavior.
2017-08-14 12:21:19 +02:00
Nathan Sobo
44441b14c3 Merge pull request #15285 from atom/ns-ime-workaround-2
Fix IME composition preview for new editors
2017-08-13 15:09:08 -06:00
Nathan Sobo
38978da0fa Explicitly compare compositionCheckpoint against null, since it can be 0 2017-08-13 14:03:58 -06:00
Nathan Sobo
f82ff9c0d1 ⬆️ language-css 2017-08-12 18:09:22 -06:00
Jordan Eldredge
e71d8d863c Add accelerator indicators to context menus
Electron allows us to pass an "accelerator" property for each menu item, which
is renders to the right of the menu item. We were already adding these for the
application level menus.

This pull request adds the accelerator property to regular context menu items,
which should make it easier for people to discover/recall key mappings for
actions which they usually take via a context menu.
2017-08-12 15:00:44 -07:00