Commit Graph

16026 Commits

Author SHA1 Message Date
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
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
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
38978da0fa Explicitly compare compositionCheckpoint against null, since it can be 0 2017-08-13 14:03:58 -06:00
Nathan Sobo
592d174e3b Merge pull request #15266 from atom/ns-fix-alt-bindings-on-mac
Suppress composition events default prevented on previous keydown
2017-08-12 15:23:33 -06:00
Max Brunsfeld
acc7b97ae0 Merge pull request #15264 from captbaritone/pane-destroy-item
Ensure Pane.destroyItem always returns a promise
2017-08-12 13:04:35 -07:00
Nathan Sobo
744b96df46 Suppress composition events default prevented on previous keydown
This seems like a browser bug.
2017-08-12 13:50:08 -06:00
Nathan Sobo
ff32fd80bf Merge pull request #15273 from atom/as-fix-line-height-0
Don't throw an error when setting an incredibly small `lineHeight`
2017-08-12 13:46:23 -06:00
Nathan Sobo
d8a8b03db2 Merge pull request #15275 from atom/as-fix-scrollbar-cursor
Use default cursor on dummy scrollbars and make them 15px wide/tall
2017-08-12 13:30:41 -06:00
Nathan Sobo
feb0cddf5e Merge pull request #15265 from atom/ns-ime-workaround
Work around incorrect data on `compositionupdate` events in Chrome 56
2017-08-12 13:26:01 -06:00
Antonio Scandurra
8cbfcf6e2b Use default cursor on dummy scrollbars and make them 15px wide/tall 2017-08-12 15:56:19 +02:00
Antonio Scandurra
964f209c40 Don't throw an error when setting an incredibly small lineHeight
Instead, if the measured line height equals 0, default it to 1 so that
the editor component doesn't start computing `NaN` or `Infinity` values
due to e.g. dividing by 0.

We should probably consider sanitizing line heights smaller than a
certain threshold, but that's non trivial because line height is
expressed as a multiplier of the font size. Also, users may style the
`line-height` property via CSS, which may still throw errors when using
small values.
2017-08-12 15:38:32 +02:00
Antonio Scandurra
b4f029e9f0 Test both Chrome 56 and other Chrome versions IME behavior 2017-08-12 14:38:18 +02:00
Antonio Scandurra
fc1327eb22 Fix measuring lines in presence of pending autoscroll requests
Calling `pixelPositionForScreenPosition` was sometimes throwing an error
indicating that the requested position was not rendered and that, as
such, could not be measured.

This was caused by trying to measure a line that was visible at the
moment of the call while also having a pending autoscroll request that
would cause that line to go off-screen. Due to how the code was
structured, we would mistakenly detect that line as visible, autoscroll
to a different location, re-render a different region of the buffer and
then try to measure the now invisible line.

This commit fixes this issue by restructuring and simplifying the logic
for rendering extra lines in order to measure them. Now, every line for
which a measurement has been requested is stored in a `linesToMeasure`
map. During the first phase of the update process (after honoring
autoscroll requests), we detect which of these lines are currently
visible and if they're not, store them into the
`extraRenderedScreenLines` map, which is then used to render lines that
are invisible but need to be measured.
2017-08-12 12:31:50 +02:00
Antonio Scandurra
ca183dd693 Don't insert IME preview on next tick if composition has already ended 2017-08-12 10:06:56 +02:00
Nathan Sobo
54a6f0d29f Clear hidden input compositionstart on Chrome 56
We use the value of the hidden input to display a preview of the
composition, but it might already contain spaces from previous
keystrokes, since we don't call preventDefault when spaces are inserted.
2017-08-11 15:57:46 -06:00
Nathan Sobo
8667cfdd13 Work around incorrect data on compositionupdate events in Chrome 56 2017-08-11 15:47:37 -06:00
Jordan Eldredge
5a8b197db1 Ensure Pane.destroyItem always returns a promise
Fixes #15157
2017-08-11 13:29:27 -07:00
Nathan Sobo
b0622d224e Merge pull request #15244 from atom/ns-rows-per-page
Shim rowsPerPage property on Editor instances
2017-08-11 10:48:44 -06:00
Antonio Scandurra
a7358477d9 Merge pull request #15240 from atom/as-manual-highlight-updates
Create, update and destroy highlights manually
2017-08-11 11:26:15 +02:00
Nathan Sobo
7f8f184e96 Shim rowsPerPage property on Editor instances
Several packages were relying on a raw property rather than the getter
method. This isn't really supported, but may as well keep them working.
2017-08-10 12:55:41 -06:00
Wliu
8963cf4955 Only use multiline if the flag is passed in 2017-08-10 13:24:46 -04:00
Antonio Scandurra
00d27befe8 Create, update and destroy highlights manually
Etch's reconciliation routine causes elements to be sometimes
re-ordered. In order to move an element, however, Etch needs to first
detach it from the DOM and then re-append it at the right location.

This behavior is unacceptable for highlight decorations because it could
re-start CSS animations on a certain highlight decoration when a
completely different one is added or removed.

Even though we are still interested in restructuring etch's
reconciliation logic to prevent unwanted re-orderings, with this commit
we are switching to a custom routine to create/update/remove highlight
decorations that prevents unnecessary moves and, as a result, fixes the
undesired behavior described above.
2017-08-10 17:48:34 +02:00
Wliu
2fa2feacaf Multiline is important, don't forget to set it 2017-08-09 22:52:39 -04:00
Ash Wilson
fb0e29cf07 Merge pull request #14853 from atom/aw-filewatcher
Filesystem watcher API
2017-08-08 14:04:39 -04:00
Jason Rudolph
3dc2e61990 Add comment explaining motivation for didPaste implemenation 2017-08-07 12:43:13 -04:00
Jason Rudolph
b9ace6a5b6 🎨 2017-08-07 12:31:04 -04:00
Ash Wilson
fc7ecb76d1 :burn: double word 2017-08-07 11:13:03 -04:00
Jason Rudolph
c7bfbc181c 🐛 Fix atom/tabs#461
On Linux, when the user performs a middle-button mouse click, Chromium
fires both a mouse-down event *and* a paste event. This commit teaches
the TextEditorComponent to ignore the paste event.

When the user performs a middle-mouse click on a tab, we get close the
tab and attempt to prevent Chromium's default processing for the event.
[1] This prevents Chromium's default processing for the *mouse down*
event, but then Chromium also fires a *paste* event, and that event
pastes the clipboard's current content into the newly-focused text
editor. 🙀

Since Atom already has its own logic for handling pasting, we
shouldn't (🤞) need to handle browser paste events. By ignoring the
browser paste events on Linux, we fix atom/tabs#461.

[1]
ce1d92e0ab/lib/tab-bar-view.coffee (L416-L418)
2017-08-07 10:19:08 -04:00
Ash Wilson
f270402c6b s/type/action/, s/changed/modified/, s/added/created/ 2017-08-07 10:04:00 -04:00
Ash Wilson
f623b03157 Documentation touchups 2017-08-07 10:04:00 -04:00
Ash Wilson
6c608e88bc Merge remote-tracking branch 'origin/master' into aw-filewatcher 2017-08-05 10:14:32 -04:00
Ash Wilson
ca28f8ac48 Fussing with documentation 2017-08-04 16:30:43 -04:00
Ash Wilson
2310053637 Reword Project.onDidChangeFiles documentation 2017-08-04 14:34:06 -04:00
Ash Wilson
97ffe46247 Consistently use require('temp').track() 2017-08-04 14:08:29 -04:00
Ash Wilson
662e2aaf06 Revisit a bunch of documentation. 2017-08-04 12:55:25 -04:00
Ash Wilson
418fe48bad Emulate a "filesystem watcher" by subscribing to Atom events 2017-08-03 15:32:40 -04:00
Ash Wilson
83f022b618 Add a fileSystemWatcher config key to use as a feature flag 2017-08-03 15:32:40 -04:00
Nathan Sobo
f8f3252962 Merge pull request #15148 from atom/ns-disable-electron-logging-by-default
Don't enable electron logging by default
2017-08-03 13:27:43 -06:00
Nathan Sobo
55748bd2c4 Document enable-electron-logging option 2017-08-02 21:12:02 -06:00
Nathan Sobo
1584189962 Ensure custom decoration elements fill their container 2017-08-02 20:34:18 -06:00
Ash Wilson
931b4e7055 👕 lint lint lint 2017-08-02 12:33:06 -04:00
Ash Wilson
318708bb42 wip 2017-08-02 09:50:57 -04:00
Ash Wilson
320664a359 Remove an export I missed 2017-08-02 09:04:33 -04:00
Ash Wilson
c7a47a9e89 Use module.exports to not break Joanna horribly 2017-08-01 16:40:54 -04:00
Ash Wilson
f005fcdca1 Use directory.getPath() as the object key 2017-08-01 15:55:39 -04:00
Ash Wilson
1285a89a4b Reset @watchersByPath on atom.project.setPaths 2017-08-01 15:55:28 -04:00
Ash Wilson
ee9ad53d91 🔥 unused variables 2017-08-01 15:55:08 -04:00
Ash Wilson
b3f327b0b3 Implement atom.project.onDidChangeFiles 2017-08-01 15:08:07 -04:00