Commit Graph

7367 Commits

Author SHA1 Message Date
Antonio Scandurra
3d2e18747f Prefer using new TextEditor to Workspace.prototype.buildTextEditor 2016-10-10 09:28:36 +02:00
Antonio Scandurra
18ddcf902b Statically assign a clipboard instance to the TextEditor class 2016-10-07 18:21:09 +02:00
Antonio Scandurra
d48c1e96d0 Tweak wording in TextEditorElement spec 2016-10-07 15:42:21 +02:00
Antonio Scandurra
901b0b17a3 Fix failing tests 2016-10-07 13:41:00 +02:00
Antonio Scandurra
07d56b23f0 Cache style sheet deprecated selectors transformations in StyleManager 2016-10-07 10:40:41 +02:00
Antonio Scandurra
4db895c731 Transform also more complex atom-text-editor selectors 2016-10-07 10:40:41 +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
91df848b8a Keep a backward compatible DOM structure for atom-text-editor contents 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
Antonio Scandurra
0f6e018804 Throw an error if there is any deprecation in a spec
Previously this logic lived in atom-reporter, but it seems more
reasonable to throw errors in spec-helper instead, so that the test
suite fails in CI as well whenever a deprecated method or stylesheet is
used.
2016-10-07 10:40:41 +02:00
Antonio Scandurra
80fc448b8d Transform deprecated shadow DOM selectors in StyleManager 2016-10-07 10:40:41 +02:00
Antonio Scandurra
7174b54139 Convert style-manager-spec to JavaScript 2016-10-07 10:40:41 +02:00
Antonio Scandurra
2d553fae12 Return scopes prepended with --syntax from TokenizedBufferIterator 2016-10-07 10:40:41 +02:00
Antonio Scandurra
b71b412ede Transform deprecated shadow DOM selectors 2016-10-07 10:40:41 +02:00
Antonio Scandurra
56a6510b25 Start on removing shadow DOM 2016-10-07 10:40:41 +02:00
Matthew Dapena-Tretter
f1be4f057e Add methods for checking if initial packages have been loaded/activated
This will allow packages to observe the state without having to worry
about subscribing to the events after they've already fired.

Originally suggested in #10839
2016-10-06 15:36:28 -07:00
Max Brunsfeld
e6cac10a23 Always return Disposable from maintain{Config,Grammar} 2016-10-05 12:03:53 -07:00
Indrek Ardel
fd1e060592 Use inline source maps for coffeescript 2016-09-30 15:03:04 +03:00
Max Brunsfeld
d79690e2d5 Merge pull request #12823 from atom/mb-as-guard-tab-length
Guard against null tab length value
2016-09-29 14:21:54 -07:00
Wliu
0e99232615 Merge pull request #12782 from Ingramz/remove-unused-variables-obvious
Remove unused variables (obvious ones)
2016-09-29 16:58:06 -04:00
Max Brunsfeld
51a2360a9b Fix uses of call-window-method IPC channel in specs 2016-09-29 12:13:24 -07:00
Max Brunsfeld
556d79b544 Guard against null tab length value
Signed-off-by: Antonio Scandurra <as-cii@github.com>
2016-09-29 12:01:39 -07:00
Indrek Ardel
55f3311c01 Remove unused variables 2016-09-26 20:52:13 +03:00
Nathan Sobo
85efc08d13 Merge pull request #12753 from lgeiger/tildify-path
Tildify path in title bar
2016-09-22 15:07:50 -07:00
Nathan Sobo
b7126aff4c Don't serialize packages in deactivatePackages
Serialization still occurs when deactivating a single package via the
API. Otherwise, when the window is closed or reloaded we will serialize
all packages as a result of saving the window state.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
2016-09-22 12:39:06 -06:00
Lukas Geiger
498a56a603 Tildify path in title bar
This will use ~/ for the path to the home directory
2016-09-22 11:14:03 +02:00
Max Brunsfeld
b88fa984cf Wait for project folder to be added in main process tests 2016-09-21 11:37:37 -07:00
Max Brunsfeld
3039024d17 Go back to using promise based on window:loaded event in main process tests 2016-09-21 11:37:24 -07:00
Max Brunsfeld
cff4de5195 Wait for project directory to be added in main process test 2016-09-21 11:04:29 -07:00
Max Brunsfeld
da6bfedc76 Merge branch 'master' into mb-ns-avoid-adding-non-existent-project-directories 2016-09-21 09:54:04 -07:00
Max Brunsfeld
890436a456 Spy on AtomEnvironment.destroy in window event handler spec 2016-09-20 17:45:58 -07:00
Max Brunsfeld
d1a4fd2378 Wait for reused window's project paths to update in main process test
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-09-20 16:52:47 -07:00
Max Brunsfeld
833b3b0ab0 Save state when reloading AtomWindow
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-09-20 16:10:11 -07:00
Max Brunsfeld
c2c7241eda Destroy AtomEnvironment in beforeunload handler, not unload handler
See https://github.com/electron/electron/issues/7278

Signed-off-by: Nathan Sobo <nathan@github.com>
2016-09-20 16:10:05 -07:00
Nathan Sobo
fa41da182e Merge pull request #12697 from atom/ns-upgrade-atom-keymap
Improve support for international keyboards
2016-09-20 14:43:01 -07:00
Max Brunsfeld
46eb861f84 Try manually tearing down atom env before reloading window in main process spec 2016-09-20 12:37:40 -07:00
Max Brunsfeld
cec2c87793 Assert about remote directories' types in main process test 2016-09-20 09:54:28 -07:00
Max Brunsfeld
7c93063861 Merge remote-tracking branch 'origin/master' into mb-ns-avoid-adding-non-existent-project-directories 2016-09-19 12:31:38 -07:00
Max Brunsfeld
ee1b8160e5 Wait for each window to save its state in main process test
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-09-19 12:06:37 -07:00
Max Brunsfeld
511fe1a576 Tweak test again for travis
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-09-19 11:02:48 -07:00
Nathan Sobo
7bba3e86b2 Try this on travis 2016-09-16 16:47:33 -06:00
Nathan Sobo
f62bf2c7e0 Focus test on for travis 2016-09-16 14:22:23 -06:00
Nathan Sobo
5fad2bdbf9 Return a promise from AtomWindow.reload that resolves on window:loaded 2016-09-16 14:10:34 -06:00
Max Brunsfeld
e444076a46 WIP - debug travis CI failures 2016-09-15 17:29:02 -07:00
Max Brunsfeld
0d2b7d12b7 Fix test description 2016-09-15 16:56:10 -07:00
Max Brunsfeld
3758fe5646 Use fake directory provider in integration test for remote dirs
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-09-15 16:33:04 -07:00
Max Brunsfeld
09b50f8740 Don't remove non-local directories on Project deserialization 2016-09-15 16:32:14 -07:00
Nathan Sobo
a6094d2ed0 Don't allow menu shortcuts that could conflict with AltGraph characters
Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
2016-09-15 14:08:35 -06:00
Max Brunsfeld
fe480d8fa4 Do not add project directories that do not exist
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-09-14 13:48:17 -07:00
Max Brunsfeld
3aaa738944 Activate atom.directory-provider services before deserialization
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-09-14 13:26:03 -07:00
Matthew Dapena-Tretter
283a573ce5 Test that destroyed panes aren't included in PaneContainer::getPanes() 2016-09-12 18:03:40 -07:00
Nathan Sobo
e313bbe89c Ensure pane is added to container before invoking onDidAddPane listeners
Fixes #12654
2016-09-12 11:00:26 -06:00
Thomas Johansen
5de0e5016e 🐛 Invoke reload instead of non-existant restart
Fix #12665
2016-09-12 07:59:10 +02:00
Max Brunsfeld
2dfa06f24c Merge pull request #12501 from atom/fb-as-add-observe-buffers
Add atom.project.observeBuffers
2016-09-09 13:45:46 -07:00
Antonio Scandurra
5c3bad077d Run platform-specific specs without mocking process.platform 2016-09-09 17:58:23 +02:00
Antonio Scandurra
924ca8ecf6 Run main process tests on Windows 2016-09-09 17:58:23 +02:00
Antonio Scandurra
6841babc4a Run main process tests on Linux 2016-09-09 17:58:23 +02:00
Antonio Scandurra
ccd381b8ad Merge pull request #12645 from atom/as-fix-app-not-quitting-on-windows-and-linux
Fix app not quitting on win32 and linux when closing the last window
2016-09-09 17:57:57 +02:00
Antonio Scandurra
e2a3b75db2 Fix app not quitting on win32 and linux when closing the last window
This regression was caused by a nuance in the way we maintain state in
`AtomApplication` for open windows. Specifically, when closing the last
window on Windows and Linux, we were explicitly calling `app.quit`
*before* removing such window from the list of open ones. In turn, this
caused the new `before-quit` behavior introduced in #12619 to work
improperly because it made the application wait on saving the state of a
stale window before exiting.

With this commit we are fixing that by making sure the stale window is
removed before calling `app.quit` in `removeWindow`.
2016-09-09 10:51:40 +02:00
Joe Fitzgerald
d4d05244b3 ATOM_SUPPRESS_ENV_PATCHING > ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT 2016-09-08 12:24:33 -06:00
Joe Fitzgerald
3c7a89ec93 Add Spec To Validate Updating An Existing Env Var
- 🎨 Update spec description to more accurately reflect the intent
2016-09-08 11:17:42 -06:00
Joe Fitzgerald
b321ab6a38 Prevent Regression For Common Shells
- Fix lint warnings
2016-09-08 10:56:01 -06:00
Joe Fitzgerald
10270609d8 Use ATOM_SUPPRESS_ENV_PATCHING Environment Variable
- Stop using shell whitelist
2016-09-08 10:56:01 -06:00
Joe Fitzgerald
c570e14420 Get Environment From Shell On Linux 2016-09-08 10:56:01 -06:00
Antonio Scandurra
bb7ff6d535 🎨 2016-09-07 16:36:01 +02:00
Max Brunsfeld
1ddce8b4a0 Expect double quotes for multi-word font names in spec
getComputedStyle seems to return font families this way in Chrome 52
2016-09-07 16:36:00 +02:00
Max Brunsfeld
6ca1676bcb Access auto-updater through new electron API in AtomEnvironment spec 2016-09-07 16:36:00 +02:00
Antonio Scandurra
34a99f9c82 Write tests to ensure quitting the application works as expected 2016-09-07 14:18:52 +02:00
Antonio Scandurra
0f6eadcfce Wait for windows' state to be saved before closing the app or any window
Previously, we used to save the window's state in the renderer process
`beforeunload` event handler: because of the synchronous nature of event
handlers and the asynchronous design of IndexedDB, this could
potentially not save anything if windows close fast enough to prevent
IndexedDB from committing the pending transaction containing the state.
(Ref.: https://mzl.la/2bXCXDn)

With this commit, we will intercept the `before-quit` events on
`electron.app` and the `close` event on `BrowserWindow` (which will fire
respectively before quitting the application and before closing a
window), and prevent them from performing the default action. We will
then ask each renderer process to save its state and, finally, close the
window and/or the app.
2016-09-07 13:03:33 +02:00
Antonio Scandurra
db76b9fb39 Improve test coverage for #12610
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-09-06 19:24:57 +02:00
Antonio Scandurra
581790760b Clip to next boundary when seeking iterator to the middle of a text tag
Previously, when calling `TokenizedBufferIterator.seek` with a position
that lied within a text tag, we advanced the iterator by the extent of
that tag without, however, consuming it. Hence, when calling
`moveToSuccessor` afterward, we would consume that tag and advance the
iterator again, thus effectively moving it twice and making its position
inaccurate.

An option could be to clip to the left of the textual tag without
consuming it. However, this would be a little odd with respect to the
current contract between (`DisplayLayer` and) `seek`, whose promise is
to move the iterator to a position that is greater or equal than the one
asked by the caller.

Therefore, with this commit, we are changing the behavior of `seek` in
this particular scenario to consume the tag in question and process all
its siblings until a tag boundary is finally found. This ensures that
the above contract is always respected, while still preserving the "seek
to leftmost tag boundary" semantics (i.e. notice how in the changed test
case, calling `seek` with `Point(0, 1)` is the same as calling it with
`Point(0, 3)`).
2016-09-06 18:12:05 +02:00
Damien Guard
9451ca0254
Fix show/hide line numbers in editor 2016-08-30 13:20:17 -07:00
Antonio Scandurra
34978bfeda Merge branch 'master' into ns-modernize-build 2016-08-26 16:20:46 +02:00
Antonio Scandurra
5b57669859 Disable telemetry on AtomApplication tests and smoke-spec.coffee
Unless a choice has been made by the user, this tab always shows up as
the first one when opening Atom, thus breaking some of the assumptions
we make in the main process tests.
2016-08-26 15:13:37 +02:00
Antonio Scandurra
194f927b87 Merge branch 'master' into ns-modernize-build
# Conflicts:
#	build/tasks/build-task.coffee
2016-08-26 13:25:02 +02:00
Wliu
bf463d59c8 Unfocus specs
/cc @damieng
2016-08-25 22:44:57 -04:00
Damien Guard
0f88949832
Remove all redundant separators 2016-08-25 12:49:29 -07:00
Damien Guard
d44dbb373d
Remove trailing context menu separator fixing #5390 2016-08-24 21:45:21 -07:00
Andres Suarez
4ca6eaff34 Add atom.project.observeBuffers
This makes `onDidAddBuffer` symmetrical with other `onDidAddX` methods and their `observeXs`. It also documents `onDidAddBuffer` and adds tests for it.

Released under CC0.
2016-08-22 18:00:54 -07:00
Antonio Scandurra
de6b836da4 Add test coverage for copying auto{Width,Height} 2016-08-19 14:10:59 +02:00
Antonio Scandurra
1f4cd6e00d Merge branch 'master' into ns-fix-editor-auto-height
# Conflicts:
#	src/text-editor.coffee
2016-08-19 13:27:26 +02:00
Antonio Scandurra
98fb29800a Don't use deprecate API in tests 2016-08-19 12:40:28 +02:00
Nathan Sobo
4b68e2f411 Remove trailing semicolon 2016-08-19 12:36:26 +02:00
Matthew Dapena-Tretter
fd29f96af9 Serialize active pane item using index instead of URI 2016-08-19 12:36:26 +02:00
Max Brunsfeld
d25f824020 Merge pull request #12469 from atom/mb-fix-tab-length-deserialization
Fix tab length deserialization
2016-08-18 21:46:20 -07:00
Max Brunsfeld
26c9e5ee78 Set editor's tokenized buffer's tab length on its display layer when deserializing 2016-08-18 17:06:26 -07:00
Wliu
af48a087c3 Merge pull request #12439 from remexre/master
Adds configuration option for large file warning threshold.
2016-08-18 17:32:36 -04:00
Nathan Sobo
dd82902bf2 Disable autoHeight on text editor pane items 2016-08-18 14:03:44 -06:00
Nathan Sobo
f723bccc29 Add test coverage for deprecated implicit disabling of autoHeight 2016-08-18 14:03:44 -06:00
Nathaniel Ringo
10b3cbc00c 💚 Hopefully fixes configurable-filesize-warning limit specs. 2016-08-18 14:54:23 -05:00
Nathan Sobo
9f8f03b10f Add test coverage for TextEditor autoHeight 2016-08-18 13:45:00 -06:00
Max Brunsfeld
90b699f5cc Remove some text editor ivars that are redundant w/ display layer properties 2016-08-18 10:41:11 -07:00
Nathaniel Ringo
05602a85ff 💚 Fixes tests for configurable large-file-warning. 2016-08-17 18:11:24 -05:00
Nathaniel Ringo
7be9ff527f 🎨 Improves customizable-size-warning spec styling. 2016-08-17 17:36:54 -05: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
Nathaniel Ringo
324bf649ea Improves specs for configurable large file limit. 2016-08-17 15:14:22 -05:00
Nathaniel Ringo
5a1def03ac Updates spec for configurable large file limit. 2016-08-17 13:37:36 -05:00
Antonio Scandurra
1587dcbe89 Take the gutter width into account when sizing TextEditorElement 2016-08-17 19:21:56 +02:00
Antonio Scandurra
3642292302 🔥 debugger 2016-08-17 18:05:58 +02:00