Commit Graph

16125 Commits

Author SHA1 Message Date
Antonio Scandurra
7bd2c670e1 Merge pull request #15546 from atom/as-never-autoscroll-when-clicking-on-content
Don't autoscroll when using the mouse to add, delete or move selections
2017-09-06 02:12:15 -07:00
Antonio Scandurra
9bbd71219d Merge pull request #15550 from atom/as-fix-rendering-out-of-range-decorations
Don't render block decorations located outside the visible range
2017-09-06 02:11:16 -07:00
Antonio Scandurra
20ea98ad41 Don't render block decorations located outside the visible range
Previously, when trying to use block decorations on non-empty markers,
Atom could sometimes throw an error if such markers ended or started at
a position that was not currently rendered.

In fact, even if we already restricted the decoration query to markers
that intersected the visible row range, markers that were only partially
visible would still be considered for rendering. If, depending on the
`reversed` property, we decided to render the tail or head of the marker
in question and this was outside the viewport, Atom would throw the
aforementioned exception.

This commit addresses the above issue by explicitly ignoring block
decorations that are located on rows that are not yet rendered.
2017-09-05 18:05:35 +02:00
Damien Guard
e4e758110a Load non-dev packages in dev mode too, found by @as-cii 2017-09-05 08:44:09 -07:00
Antonio Scandurra
91bb1e12c7 Don't autoscroll when using the mouse to add, delete or move selections 2017-09-05 15:26:54 +02:00
Antonio Scandurra
6e919e7acd Don't remeasure invalid block decorations
This fixes an uncaught exception that was being thrown after
invalidating a marker and resizing the editor.
2017-09-02 11:11:27 +02:00
Damien Guard
f3161b06f7 Merge pull request #15522 from atom/dg-async-package-deactivation
Convert package-manager from Coffeescript to JavaScript
2017-09-01 12:34:20 -07:00
Damien Guard
e0606d5e2f 🎨 2017-09-01 10:04:13 -07:00
Damien Guard
c7e56d6366 Avoid ES6 because we run use this code in apm from node 2017-09-01 08:47:24 -07:00
Damien Guard
098231caf9 Convert package-manager from Coffeescript to JavaScript 2017-08-31 19:34:16 -07:00
Bryant Ung
96b3af143d Merge pull request #15163 from atom/fb-wb-modal-focus
Automatically manage focus for modal panels
2017-08-31 17:09:02 -07:00
Antonio Scandurra
53135c5d0d Call this.didMouseDown instead of props.didMouseDown in dummy scrollbars 2017-08-31 14:23:11 +02:00
Antonio Scandurra
3e10a84d49 Merge pull request #15506 from atom/as-honor-scrollbar-visible-only-when-scrolling
Honor macOS "Show scrollbars only when scrolling" setting
2017-08-31 11:29:26 +02:00
Antonio Scandurra
f85deec482 Merge pull request #15503 from atom/as-fix-invalidated-block-decoration-markers
Fix rendering of block decorations for invalid markers
2017-08-31 11:29:14 +02:00
Antonio Scandurra
12e6740c9c Merge pull request #15487 from atom/as-scroll-sensitivity
Always honor scroll intent on mousewheel
2017-08-31 11:28:16 +02:00
Antonio Scandurra
ac9cc72845 Merge pull request #15486 from atom/as-highlights-outside-of-tiles
Move highlight decorations outside of tiles
2017-08-31 11:26:15 +02:00
Bryant Ung
3bf8344519 Merge branch 'master' into fb-wb-modal-focus 2017-08-30 17:06:29 -07:00
Antonio Scandurra
50088b16c9 Honor macOS "Show scrollbars only when scrolling" setting
Previously, we were hiding scrollbars when their height/width was 0. On
macOS, however, users can decide to only show scrollbars while
scrolling, which causes Atom to detect scrollbars as being invisible
during measurements. As a result, we were mistakenly setting the
visibility property to `hidden` when this setting was on, thus
preventing users from seeing the scrollbar on scroll.

With this commit we are changing the dummy scrollbar components to only
become invisible when the content is not scrollable rather than when the
scrollbars have zero width or height.

As part of this, we have also renamed the
`is{Horizontal,Vertical}ScrollbarVisible` functions to
`canScroll{Horizontally,Vertically}`, to better express their intent.
2017-08-30 17:11:40 +02:00
Antonio Scandurra
af42b4b86f Move DummyScrollbarComponent into its own GPU layer
This was fixed back in bac9922 and, due to the same reasons, not having
a separate layer causes the "Show scrollbars only when scrolling"
setting on macOS to not work properly.
2017-08-30 16:11:21 +02:00
Antonio Scandurra
9bf47f31cb Fix rendering of block decorations for invalid markers
Previously, when a marker became invalid we would delete the
corresponding block decoration from the DOM, without however removing it
from the `lineTopIndex`. Also, we had a similar issue when decorating a
marker that was already invalid: we would account for it in the index
without adding it to the DOM.

This commit addresses the above problems by ensuring that block
decorations are never added for invalid markers. At the same time, the
editor component will still keep track of changes on the marker that was
decorated, so that it can detect when its validity changes and render it
appropriately.
2017-08-30 14:25:20 +02:00
Max Brunsfeld
bd9570b165 Merge pull request #15446 from atom/mb-remove-runas
Use fs-admin instead of runas
2017-08-29 10:14:42 -07:00
Nathan Sobo
d016b09fb4 Merge pull request #15383 from atom/fb-wb-command-meta
[Commands] Add support for rich listener objects with first-class metadata
2017-08-29 09:54:41 -06:00
Antonio Scandurra
76e2e03139 Always honor scroll intent on mousewheel
This commit introduces a change in the way we respond to mousewheel
events. In particular, if `delta * scrollSensitivity` is less than 1 or
greater than -1, we will round it up or down in an attempt to honor the
user's scroll intent.
2017-08-29 13:39:11 +02:00
Antonio Scandurra
b486e3edda Move highlight decorations outside of tiles
As a consequence of https://github.com/atom/atom/pull/15378, we are now
able to render highlight decorations in a separate div, as opposed to
having an highlight container for each tile.

Code-wise this is much simpler, because highlights spanning multiple
tiles can be represented via a single region and don't need to be split
across the tiles they span anymore. As a byproduct, performance should
improve as well, because the number of nodes that need to be managed
should decrease significantly.

This also fixes https://github.com/atom/atom/issues/15449, and other
similar rendering artifacts, because highlight decoration DOM nodes
won't need to move between tiles anymore when their position changes.
2017-08-29 11:44:07 +02:00
Will Binns-Smith
b7c328fd59 Clean up docs and comment wording 2017-08-28 14:49:54 -07:00
Jason Rudolph
425a48bd28 Merge pull request #15438 from atom/b3-dont-move-undefined
Don't attempt to move undefined items when splitting panes
2017-08-28 15:56:22 -04:00
Max Brunsfeld
c8303d6391 Replace runas with fs-admin in CommandInstaller
Also, convert CommandInstaller to JavaScript.
2017-08-25 15:46:43 -07:00
simurai
80ce237348 Merge pull request #14711 from atom/sm-native-tabs
Native tabs on macOS
2017-08-25 09:11:13 +09:00
Linus Eriksson
27f17318d7 Don't attempt to move undefined items when splitting panes 2017-08-24 16:15:06 +02:00
simurai
915e886711 Merge branch 'master' into sm-native-tabs 2017-08-24 13:52:52 +09:00
Will Binns-Smith
2ac1d54557 handleEvent -> onDidDispatch 2017-08-23 13:27:16 -07:00
Antonio Scandurra
f45c0236ab Enhance error when a line component is not found for a screen line
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-08-23 14:52:56 +02:00
Antonio Scandurra
74ae169fcc Maintain a map of line components instead of line nodes and text nodes
Other than simplifying the code, this will help us understand whether
https://github.com/atom/atom/issues/15263 might be related to a node
reuse issue.

Signed-off-by: Nathan Sobo <nathan@github.com>
2017-08-23 14:52:50 +02:00
Will Binns-Smith
128f702784 Add documentation to addModalPanel api 2017-08-22 23:14:54 -07:00
Will Binns-Smith
e8913660fa Make autoFocus opt-in 2017-08-22 23:10:14 -07:00
Will Binns-Smith
7da76ec50d Remove semicolons :'( 2017-08-22 23:10:14 -07:00
Will Binns-Smith
0916b4c4f0 Manage focus for modal panels
This implements automatic focus management for modal panels using the
excellent focus-trap module.

Upon being shown, modals will have their first tabbable element
automatically focused, and shifting focus with the tab key (or more
correctly the core:focus-next command) will be limited to the contents
of the modal. If the modal does not have any tabbable elements, focus()
will be sent to the panel's root element (if it implements it).

I'm happy to update this to *always* calls focus on the panel's root
element, but then modal implementers would need to handle that and
focus things on their own. I'd argue the tabbable element behavior
is more accessible though :)

This has the effect of not automatically closing most of Atom's own
modals whenever the tab key is pressed, which was an odd nonstandard
behavior, IMO.

This also automates returning focus to the element that had focus before
the modal was shown, something up until now had to be implemented in
every modal in Atom.

This likely breaks a few contracts for existing Atom packages that
create modals, but I've found this doesn't conflict behaviorally with
well-behaved modals like the command palette which implement their own
focus management (which can be removed if this lands).

Released under CC0.
2017-08-22 23:09:44 -07:00
Nathan Sobo
b8d22fb4ba Fix lint error 2017-08-22 22:00:54 -06:00
Nathan Sobo
b5f68a6434 Include more metadata when missing a line node in horizontal measurement 2017-08-22 21:03:01 -06:00
Ash Wilson
22336fcb4d Documentation fix
It's `action`, not `type`.
2017-08-22 18:16:16 -04:00
Will Binns-Smith
c916c9d818 Better document the new api externally and internally 2017-08-22 10:53:04 -07:00
Will Binns-Smith
b3a296e802 Eagerly extract descriptor and callback 2017-08-22 10:53:04 -07:00
Will Binns-Smith
9b995c68ec Normalize listeners at registration time; add tests for rich functions 2017-08-22 10:53:04 -07:00
Will Binns-Smith
3aa95d96d4 [Commands] Add support for rich listener objects with first-class metadata
This adds support for listener objects which, in addition to the existing callback listeners, can optionally provide a displayName ahead of time to avoid a potentially awkward humanized displayName.
2017-08-22 10:53:04 -07:00
Antonio Scandurra
0372db43bb Don't select when typing while also holding the left mouse button 2017-08-22 12:04:52 +02:00
Nathan Sobo
5eae5ed5eb Merge pull request #15392 from atom/fb-wb-standard-env
Use standard (eslint's) 'env' field over globals
2017-08-21 09:38:34 -06:00
Nathan Sobo
08f36de7ec Merge pull request #15394 from atom/fb-wb-command-registry-js
Convert CommandRegistry to JavaScript
2017-08-21 09:35:31 -06:00
Antonio Scandurra
66e576f6e3 Merge pull request #15378 from atom/as-fix-cropped-fonts
Drop use of GPU tiles for lines and line numbers
2017-08-21 10:44:58 +02:00
Will Binns-Smith
ac32ffb155 Convert CommandRegistry to JavaScript
This was bootstrapped with running `decaffeinate` on both command-registry
and its spec, but involved a line-by-line eyeing and updating for idioms
and, in one case, correctness:

For some reason, copying the keys to the new dispatchedEvent in
coffeescript (command-registry.coffee:235) currently does not result in a thrown
exception, as it should when trying to write over the read-only property
`isTrusted`, so I added a check to ensure that the key did not already
exist in the new event. Moreover, other definitions of `preventDefault`,
`stopPropagation` and friends, which are also enumerable afaict, would
also overwrite the ones defined just prior (command-registry.coffee:220
and command-registry.js:325), so that check ensures we don't overwrite
those either.

Test plan: `./script/lint && ./script/test`, and a lengthy smoke test of
various commands through keybindings, command palette, and package
interfaces.

Released under CC0.
2017-08-20 20:52:43 -07:00
Will Binns-Smith
882a1924f0 Remove one-off eslint global pragmas in favor of envs 2017-08-20 19:55:00 -07:00