Antonio Scandurra
fff1d9c631
Implement glyph scaling in a way that works with emojis as well
2022-04-13 15:56:32 +02:00
Keith Simmons
4249b5687e
Implement font fallback in layout_line
...
Co-authored-by: Max Brunsfeld <max@zed.dev>
2022-04-13 11:42:19 +02:00
Antonio Scandurra
6cc9306f00
Make room for font subpixel variants correctly
2022-04-13 11:36:54 +02:00
Antonio Scandurra
6b629dfa5c
Use CTFont::draw_glyphs
to rasterize glyphs
...
This API supports rendering emojis in addition to normal glyphs.
2022-04-12 19:37:26 +02:00
Max Brunsfeld
949fbe7cd3
Allow dumping the project diagnostic view's state as JSON
...
Also, improve DebugElements action so that it shows the JSON in an editor.
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-04-11 19:51:46 -07:00
Max Brunsfeld
a754c3015f
Merge pull request #762 from zed-industries/safer-atlas-allocation
...
Safer Atlas Allocation
2022-04-11 17:42:53 -07:00
Max Brunsfeld
be11f63f1e
Watch ~/.zed/bindings.json file for custom key bindings
...
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-11 16:50:44 -07:00
Max Brunsfeld
92a5c30389
Merge branch 'main' into load-keymaps
2022-04-11 15:55:10 -07:00
Keith Simmons
0ca4c9946a
Add logging when atlas allocator fails to allocate
2022-04-11 10:31:38 -07:00
Keith Simmons
7abd3a98a8
Make atlas allocation fallable and skip rendering icons and paths when it fails
2022-04-11 10:15:49 -07:00
Max Brunsfeld
3636c9ec25
Load workspace and editor key bindings from a JSON file
2022-04-10 11:18:08 -07:00
Nathan Sobo
17195e615e
Merge pull request #781 from zed-industries/structured-logging
...
Introduce structured logging
2022-04-09 07:40:24 -06:00
Max Brunsfeld
fd4b81c8fc
Allow actions to be deserialized from JSON
...
Introduce separate macro for implementing 'internal' actions which
are not intended to be loaded from keymaps.
2022-04-08 15:47:51 -07:00
Nathan Sobo
7e5a3f9f6b
Introduce structured logging
...
We're enabling the log crate feature everywhere, but only using it on the server for now.
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-04-08 10:06:51 -06:00
Max Brunsfeld
5242a3a6dc
Restructure action macro to assign a namespace to every action
...
Also, allow arbitrary types to be used as Actions via the impl_actions macro
Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-07 16:20:49 -07:00
Antonio Scandurra
b396909035
Calculate hitbox based on visible bounds in {Mouse}EventHandler
...
This is in contrast to not dispatching the event altogether in `Flex` when
the event is not contained in the flex element bounds. That approach was
problematic because it didn't give an opportunity to `MouseEventHandler`s
to handle mouse move events when they didn't intersect with the element bounds,
causing elements to never clear their hover state, cursor style, etc.
2022-04-07 15:12:09 +02:00
Antonio Scandurra
73f2fd6b09
Pass visible bounds to Element::dispatch_event
2022-04-07 15:10:09 +02:00
Antonio Scandurra
ae415ee49b
Merge pull request #763 from zed-industries/inconsistent-diagnostic-state
...
Fix bad diagnostic state when restarting a language server w/ a running diagnostic task
2022-04-07 09:54:00 +02:00
Antonio Scandurra
52251c3463
Merge pull request #745 from zed-industries/scroll-tabs
...
Allow pane tabs to be scrolled when they overflow
2022-04-07 09:48:54 +02:00
Max Brunsfeld
b354af7bda
Use an unbounded channel in gpui test helper methods
...
The bounded channel could fill up when many events were emitted in one
effect cycle.
2022-04-06 22:02:04 -07:00
Keith Simmons
1812480cbb
Tab size is pulled properly from settings instead of hardcoded
2022-04-06 10:23:37 -07:00
Nathan Sobo
0214bec7f4
Don't dispatch events to flex children outside of parent flex's bounds
2022-04-06 10:59:03 -06:00
Antonio Scandurra
1453954ef4
Autoscroll to active tab when activating a new item
2022-04-06 09:08:44 +02:00
Nathan Sobo
eb99588368
Remove stray dbg! expressions
2022-04-05 20:02:45 -06:00
Nathan Sobo
ab3bbe1e17
Make the tabs scrollable when they overflow
...
This adds the ability to make a Flex element scrollable by passing a type tag and instance id, which we use to store the scroll position in an ElementStateHandle.
Still need to allow the element to auto-scroll.
2022-04-05 19:58:15 -06:00
Nathan Sobo
025d857be8
Make UniformListState an Rc<RefCell<>> instead of an Arc<Mutex<>>
...
We don't need to support multiple threads.
2022-04-05 18:40:25 -06:00
Nathan Sobo
aeb0b42c7a
Report more information when we panic due to an allocation failure
2022-04-05 13:53:13 -06:00
Nathan Sobo
4f4364d510
Ensure we drop the last pane item
...
Previously, we weren't updating the toolbar's active item when emptying out a pane. This enhances an integration test to ensure that we don't hold references to any editors or buffers once we close everything.
2022-04-05 13:05:14 -06:00
Nathan Sobo
41a27e6925
💄
2022-04-05 12:09:40 -06:00
Nathan Sobo
e2bf89b1e8
Don't require a path in TestAppContext::dispatch_action
...
Instead, derive it from the presenter. This makes tests easier to write and more reliable since we'll be accurately simulating the actual relationship between parent and child views.
2022-04-05 12:08:25 -06:00
Antonio Scandurra
61c479ebc8
Pass an NSString
to objectForInfoDictionaryKey
2022-04-05 10:02:37 +02:00
Max Brunsfeld
e566a8335f
Find path to running app using [NSBundle bundlePath]
2022-04-04 20:53:46 -07:00
Nathan Sobo
66544d54f2
Drop borrow to window state before calling beginSheetModalForWindow
...
Co-Authored-By: Keith Simmons <keith@the-simmons.net>
2022-04-04 16:18:28 -06:00
Antonio Scandurra
38e902b241
WIP: Start on auto-update
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
Co-Authored-By: Keith Simmons <keith@zed.dev>
2022-04-04 18:59:57 +02:00
Antonio Scandurra
dee416bdbe
Avoid text insertion when holding down the fn
key
2022-04-04 11:13:35 +02:00
Nathan Sobo
903810f22e
Style search in buffer below breadcrumbs
...
We still have issues with project search styling.
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-03-31 11:44:16 -06:00
Antonio Scandurra
0453dd1101
Allow flex items to float to the end of the flex axis
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-30 16:46:14 +02:00
Antonio Scandurra
0cd356ce06
Merge pull request #689 from zed-industries/format-timeout
...
Skip formatting during save if it takes too long
2022-03-28 16:17:56 +02:00
Antonio Scandurra
f69bd0e327
Snap icon sprites to pixel grid
...
This should resolve some rendering artifacts potentially caused by
floating point errors when sampling the texture. It should also lead
to crisper images when icons are rendered midway through a pixel.
2022-03-28 11:52:13 +02:00
Antonio Scandurra
26aa138429
Fire fake timers waking up at the same time as the current clock
2022-03-28 10:57:52 +02:00
Nathan Sobo
daf999c3be
Fully disable vim mode on start unless it's enabled
...
Also: Make some structural adjustments to remove the need for defer. Instead of accessing the global in associated VimState functions, have a single method that allows us to call update instance methods.
2022-03-26 19:19:12 -06:00
Keith Simmons
bb9b36dccd
Add initial vim mode mode switching
...
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-03-25 20:10:37 -07:00
Keith Simmons
0a8d543f66
Add global tests and wrap global update functions in update call to flush effects
...
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-03-23 10:27:27 -07:00
Keith Simmons
454f7a570c
Add global change observations
2022-03-23 09:14:12 -07:00
Antonio Scandurra
3298529ed1
Fix global nested event test after turning subscriptions into effects
2022-03-23 09:14:33 +01:00
Max Brunsfeld
880eaa268b
Coalesce followed view updates only within one frame
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-22 17:03:24 -07:00
Antonio Scandurra
9885c4f6ba
Don't trigger observations with notifications emitted prior to observing
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-22 16:28:11 +01:00
Antonio Scandurra
5ecf945e28
Don't trigger global subscriptions with events emitted prior to subscribing
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-22 16:14:21 +01:00
Antonio Scandurra
73eae287a1
Don't trigger subscriptions with events emitted prior to subscribing
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-22 15:57:30 +01:00
Antonio Scandurra
a154e4500b
Implement Workspace::unfollow
...
This also changes the structure of the follow state back to be per-pane. This
is because we can't share the same view state across different panes for
a couple of reasons:
- Rendering the same view in N different panes is almost always not something
that we want due to global state such as focus.
- If we allowed it and a user followed the same person in two different panes,
there would be no way of unfollowing in one pane without also unfollowing in
the other.
2022-03-21 16:55:18 +01:00
Max Brunsfeld
e338da0271
Allow clicking a titlebar avatar to initiate following
2022-03-18 13:37:07 -07:00
Antonio Scandurra
10e6d82c3e
WIP: Start on sending view updates to followers
2022-03-18 14:20:09 +01:00
Max Brunsfeld
eda06ee408
Add AnyWeakViewHandle
2022-03-17 17:53:38 -07:00
Antonio Scandurra
5d14c9abdf
Introduce workspace::register_project_item
...
This lets downstream crates like `editor` define how project items should be
opened.
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 15:54:34 +01:00
Antonio Scandurra
44d997c00c
Rename app_state
to global
in gpui
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 14:33:01 +01:00
Antonio Scandurra
aced1e2315
Finish refactoring of how editors are opened
2022-03-17 11:29:46 +01:00
Max Brunsfeld
a88320dc5f
Remove workspace::Item trait
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Keith Simmons <keith@zed.dev>
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2022-03-16 13:34:06 -07:00
Antonio Scandurra
b0afb64a6e
Fix edge cases when calling refresh_windows
...
This commit ensures that new views are rendered for the first time. This fixes
a panic that could be reproduced by dropping the `ThemeSelector` and opening
the file finder during the same update.
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-16 14:51:54 +01:00
Antonio Scandurra
447f350123
Compute line-height as a multiple of font size
...
...instead of using the bounding box. This makes `PragmataPro` and other
fonts render more cleanly.
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-15 16:35:06 +01:00
Antonio Scandurra
45ce503afd
Start on implementing filtering support for Cursor::prev
2022-03-15 15:13:23 +01:00
Antonio Scandurra
fbf7cdf4f2
Make all HighlightStyle
properties optional
...
Previously, some of those properties such the font weight, style and color
would be mandatory: when the theme didn't specify them, Zed would use a default
value during deserialization. This meant that those default properties would
unconditionally override the base text style, causing a rendering bug when
combining syntax highlights with diagnostic styles.
This commit fixes that by making `HighlightStyle`s more additive: each property
can be set independently and only the properties that theme specifies get
overridden in the base text style.
2022-03-15 10:39:43 +01:00
Max Brunsfeld
e392368d89
Fix layout panic on empty editors with blocks
...
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-14 12:03:26 -07:00
Antonio Scandurra
5d5f89231b
Hold strong handle in ChildView
...
This eliminates a whole class of errors where the `ChildView` could
be referring to a view that doesn't exist anymore. That probably still
indicates that there's an underlying bug, but at least we won't panic.
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-14 15:49:11 +01:00
Antonio Scandurra
47b40e3839
Don't draw scene elements if their size is zero
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-14 15:29:18 +01:00
Antonio Scandurra
1e9b6b050d
Merge pull request #596 from zed-industries/fix/dropped-subscription-in-callback
...
Fix Dropped Subscription in Handler Bug
2022-03-12 19:14:38 +01:00
Keith Simmons
c50be72214
Format including missing formatting changes from previous PR
2022-03-11 15:38:01 -08:00
Keith Simmons
16afb3d5b1
Add some tests for global events and fix potential bug in subscriptions when subscription is dropped inside of it's own callback
...
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-03-11 15:34:04 -08:00
Nathan Sobo
951fd1ab36
Merge branch 'main' into select-on-rename
2022-03-11 15:30:07 -07:00
Keith Simmons
87b1cfe34f
Merge pull request #576 from zed-industries/cursor-shape
...
Add support for rendering the cursor as a Block and Underscore
Co-authored-by: Max Brunsfeld <max@zed.dev>
2022-03-11 11:51:24 -08:00
Keith Simmons
144591d639
Minor renames for clarity
2022-03-11 11:25:36 -08:00
Keith Simmons
81fc812221
Add global events to MutableAppContext and raise global event when new workspace is created
2022-03-10 20:03:01 -08:00
Keith Simmons
b62daebde1
Merge pull request #563 from zed-industries/mouse-history-navigation
...
Add missing mouse button events and mouse history navigation
2022-03-10 17:39:36 -08:00
Nathan Sobo
a498cd32c8
When renaming, match the color of the renamed token in the rename editor
2022-03-10 16:38:45 -07:00
Nathan Sobo
3968b37e26
When renaming, fade out the old name and select all
2022-03-10 14:55:31 -07:00
Keith Simmons
eddb089f27
render character under block cursor
2022-03-10 13:16:31 -08:00
Nathan Sobo
e6b1fea117
WIP
2022-03-10 11:32:14 -07:00
Nathan Sobo
ac1eb19f83
Start on text highlight support
2022-03-09 20:51:35 -07:00
Keith Simmons
6ee0cceb14
Switch to using mouse navigation events instead of other in order to get rid of opaque button id
2022-03-09 15:04:04 -08:00
Antonio Scandurra
ef1ec88523
Remove delegate support from GPUI
...
We added this because we thought it would save some allocations when
sending operations given that we could move them to the delegate upon
notifying it, but the reality is that we serialize operations and that
only requires a reference.
2022-03-09 10:48:52 +01:00
Keith Simmons
fc36c706d3
Add missing mouse button events and mouse history navigation
...
Co-Authored-By: Max Brunsfeld
Co-Authored-By: Nathan Sobo
2022-03-08 15:45:36 -08:00
Antonio Scandurra
317a1bb07b
Remove language servers from buffers
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
Co-Authored-By: Keith Simmons <keith@zed.dev>
2022-03-08 15:16:07 -08:00
Antonio Scandurra
b49951ac57
Implement {ModelHandle,ViewHandle}::become_delegate
2022-03-08 09:30:32 +01:00
Nathan Sobo
f2848a092b
WIP: Start on a delegation... like events, but single consumer that takes ownership of event
2022-03-08 09:01:57 +01:00
Max Brunsfeld
bb6ab837cf
Merge pull request #542 from zed-industries/guest-disconnections
...
Send heartbeats in both directions so the server can detect when clients disconnect
2022-03-07 15:52:35 -08:00
Max Brunsfeld
1f5eab39a9
Reset peer's receive timeout when a message is received
...
* Make advance_clock more realistic by waking timers in order,
instead of all at once.
* Don't advance the clock when simulating random delays.
Co-Authored-By: Keith Simmons <keith@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-07 15:33:43 -08:00
Nathan Sobo
40c0b9e7a5
Halt keystroke dispatch when a global action is dispatched
2022-03-06 09:46:33 -07:00
Max Brunsfeld
4124308d94
Fix errors from conditional compilation in timer functions
2022-03-04 17:16:17 -08:00
Max Brunsfeld
9017a1363b
Send websocket pings from both the client and the server
...
Remove the client-only logic for sending protobuf pings.
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-04 15:21:18 -08:00
Max Brunsfeld
c61a1bd659
Make timer method available on both foreground and background executors
...
Also, make it return a static future.
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-04 13:54:07 -08:00
Antonio Scandurra
c38de3243d
🎨
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-04 17:54:48 +01:00
Antonio Scandurra
38313abc48
Disable events when project becomes read-only
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-04 17:37:37 +01:00
Antonio Scandurra
77e913b5a4
Blur focused view when project becomes read-only
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-04 17:37:26 +01:00
Max Brunsfeld
05df1dfae9
Disable doctests for all libraries
...
We don't use them, and they add a lot of noise to the test output
when running all tests in the workspace.
2022-03-03 16:15:56 -08:00
Max Brunsfeld
5c1aff1143
Don't insert input into editors when control or command keys are held
...
This is a follow-up to #475
2022-03-02 14:09:46 -08:00
Antonio Scandurra
141e0559a5
Fix warnings
2022-03-02 12:45:49 +01:00
Antonio Scandurra
3ec76b63d3
Make dhat
optional
2022-03-02 11:02:10 +01:00
Antonio Scandurra
51345cf1e1
Advance clock when simulating random delay
2022-03-02 10:39:46 +01:00
Antonio Scandurra
be7a4770fb
Delete timer state when the future that's awaiting it gets dropped
2022-03-02 10:08:38 +01:00
Max Brunsfeld
8b7a9367fa
Avoid storing type name string on AnyViewHandle
...
It won't be needed for leak error messages, because the typed
view handle will typically be created first. And this avoids
increasing the size of the handle used in production.
2022-03-01 18:22:09 -08:00
Antonio Scandurra
a25f21df39
Remove debug_elements_callbacks
from App
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-03-01 19:16:58 +01:00