Max Brunsfeld
84bbd7f717
Add a platform API for accessing the keychain
2021-06-08 17:44:45 -07:00
Max Brunsfeld and Nathan Sobo
9091d6a223
Start work on a login command
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-06-07 18:15:11 -07:00
Nathan Sobo and Max Brunsfeld
acc9b6e2e9
Rename MainThreadPlatform to ForegroundPlatform and fix crash on quit
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2021-06-07 17:42:49 -06:00
Nathan Sobo and Max Brunsfeld
3f9b7d54d4
Allow platform references to be sent to background threads
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2021-06-07 17:35:27 -06:00
Nathan Sobo and Max Brunsfeld
3a26f3a1c3
Move path prompting methods to MainThreadPlatform
...
They need to call back into the main thread, meaning the callbacks can't be Send + Sync.
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2021-06-07 17:32:03 -06:00
Nathan Sobo and Max Brunsfeld
7fb632508f
Rename PlatformLifecycle to MainThreadPlatform
...
Don't love it, but at least it's accurate.
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2021-06-07 17:21:34 -06:00
Nathan Sobo
7faf6a5a38
Extract a platform::Lifecycle trait
...
This will allow us to make platform::Platform be Send + Sync and keep the lifecycle on the main thread.
2021-06-07 17:02:24 -06:00
Max Brunsfeld
5203f8af1c
Rename context parameters to cx in gpui
2021-05-28 15:32:35 -07:00
Max Brunsfeld and Nathan Sobo
a82d25e5dd
Rename foo/mod.rs files too foo.rs
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-05-28 14:41:58 -07:00
Antonio Scandurra
8837be65d8
Add test for font selection
2021-05-26 09:41:57 +02:00
Max Brunsfeld
f4921ab1c1
Bump context-predicate grammar to the latest Tree-sitter
2021-05-22 12:34:35 +02:00
Nathan Sobo
d72dc9ff6a
Fix test assertions
2021-05-21 14:36:52 -06:00
Nathan Sobo
e393697a21
Fix typo
2021-05-21 14:36:44 -06:00
Nathan Sobo
7b840467ef
Clarify variable name
2021-05-21 14:14:05 -06:00
Nathan Sobo
6a078c3281
Accept colors in styling runs passed to layout_str
...
Also move from the runs being expressed as ranges to the runs being expressed as a sequence of contiguous scalar lengths.
2021-05-21 14:10:38 -06:00
Antonio Scandurra
4e845a3003
Complete unit test for Label highlights
2021-05-20 12:47:08 +02:00
Max Brunsfeld
53867f6620
WIP - Adjust Label element to expect highlights as byte offsets
2021-05-20 12:47:08 +02:00
Max Brunsfeld
853c50a2d2
Adjust layout_str to use byte coordinates
...
* Interpret ranges as byte ranges for incoming runs
* Return glyphs whose indices are byte offsets
2021-05-20 12:47:08 +02:00
Antonio Scandurra
bd47511d07
Revert "Temporary: ensure CI env variable is being set"
...
This reverts commit b2c006d4cf .
2021-05-19 15:20:33 +02:00
Antonio Scandurra
b2c006d4cf
Temporary: ensure CI env variable is being set
2021-05-19 15:19:07 +02:00
Antonio Scandurra
b85fe83751
Remove condition_with_duration for ModelHandle
...
Also, use a 2s timeout on CI for both `ModelHandle::condition` and
`ViewHandle::condition`.
2021-05-19 14:50:28 +02:00
Antonio Scandurra
a5167177d5
Increase condition timeout on CI and remove condition_with_duration
...
`condition_with_duration` wasn't really being used, as the default
timeout was `500ms` and the only places that did use it specified
`500ms` as well.
2021-05-19 14:42:10 +02:00
Antonio Scandurra
29705ae02f
Implement time::Global using a SmallVec
...
Version vectors are going to be small most of the time, especially
as soon as we introduce an optimization that will let us only
track concurrent versions, thus preventing the version vector from
growing indefinitely over time in the tree.
2021-05-18 17:34:48 +02:00
Max Brunsfeld
9e54aa6471
Merge branch 'master' into file-changed-on-disk
2021-05-12 20:08:09 -07:00
Max Brunsfeld
97cc639825
Remove dropped entities even if there are no effects to flush
2021-05-12 19:45:45 -07:00
Nathan Sobo
018d30cc00
Don't remove entities whose ref count has become positive again
2021-05-12 19:29:17 -06:00
Nathan Sobo
d9392243f9
Remove dropped entities after every effect
2021-05-12 19:28:48 -06:00
Max Brunsfeld
3226435fc5
Merge branch 'master' into file-changed-on-disk
2021-05-12 16:20:03 -07:00
Max Brunsfeld
4d075c38e0
Remove commented-out tests for spawn and spawn_stream
2021-05-12 15:27:58 -07:00
Nathan Sobo
a792e53401
Pass a handle to the current view model when spawning
...
Most of the time, we'll want a way to get a reference back to the current view or model, so this facilitates that common case.
2021-05-12 15:28:59 -06:00
Nathan Sobo and Max Brunsfeld
f39e101ae2
Introduce AsyncAppContext and simplify spawning
...
Now when you call spawn in various context, you pass an FnOnce that is called with an AsyncAppContext and returns a static future. This allows you to write async code similar to how our tests work, borrowing the guts of the AsyncAppContext when needed to interact, but using normal async await semantics instead of callbacks.
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2021-05-12 15:16:49 -06:00
Antonio Scandurra and Max Brunsfeld
78f4e93215
Use gpui::test for tests in gpui
...
Co-Authored-By: Max Brunsfeld <max@zed.dev >
2021-05-12 18:21:32 +02:00
Antonio Scandurra
ba47eafe25
Introduce a gpui::test macro
2021-05-12 17:05:03 +02:00
Antonio Scandurra
ed49b0ea34
Test prompting when saving while there's a conflict
2021-05-12 15:21:50 +02:00
Antonio Scandurra
236ffaa1ad
Make MutableAppContext::prompt private
...
...as we're supposed to call this method only via ViewContext.
2021-05-12 11:57:05 +02:00
Antonio Scandurra
aa68b290c4
Display prompt when trying to save a conflicting file
2021-05-12 11:54:48 +02:00
Antonio Scandurra and Nathan Sobo
8de74d3f4a
Add a basic tab keybinding
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-05-11 17:10:37 +02:00
Antonio Scandurra and Nathan Sobo
2d56da5259
Emit Dirtied event when a clean buffer's file is deleted
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2021-05-11 16:32:52 +02:00
Max Brunsfeld
e099025466
Ensure that the bundle runs on macOS versions < 11.0
2021-05-10 14:14:04 -06:00
Nathan Sobo
0ea30dca56
Merge pull request #40 from zed-industries/close-window
...
Correctly handle closing windows and removing entities
2021-05-08 09:06:54 -06:00
Nathan Sobo
3dce1af998
Fix double borrow error in Window::on_close callbacks when quitting app
...
The simplest solution I could come up with was to make quitting the app asynchronous. Calling mac::Platform::quit enqueues a request to quit the app and then allows the call stack to fully return. This ensures we aren't holding a borrow when we quit and invoke all the Window::on_close callbacks. Seems like it should be fine to be async on quitting.
2021-05-08 08:49:14 -06:00
Max Brunsfeld
8ef5af4969
Ignore events for held-down keys after a key combo is partially released
2021-05-07 16:54:55 -07:00
Max Brunsfeld
b878e50277
Remove logging of retained views
2021-05-07 14:51:55 -07:00
Max Brunsfeld
e488eb96bc
Merge branch 'master' into close-window
2021-05-07 14:24:48 -07:00
Max Brunsfeld
8c4a70f7c7
Fix the Clone impl for AnyViewHandle
2021-05-07 14:16:16 -07:00
04dcf1aca6
Avoid redundant entity refcount operations
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
2021-05-07 14:15:43 -07:00
Max Brunsfeld
76bcbcc72c
Keep weak handles to workspace items
2021-05-07 09:52:15 -07:00
Nathan Sobo and Antonio Scandurra
9349aeac1a
Fix focus test
...
Call on_focus on the root view when the window is originally created. Test dropping a focused view. Simplify test to avoid relying on emitting events.
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
2021-05-07 09:43:07 -06:00
Max Brunsfeld
19d8fa2fe3
Fix handling of new files with new buffer/file structure
2021-05-06 21:06:20 -07:00
Nathan Sobo and Max Brunsfeld
a0c8ac3fdc
Refocus root view if focused view is removed
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2021-05-06 16:30:10 -06:00