Antonio Scandurra
cbbdef5434
Extract an ExcerptRange containing a context field in multi_buffer
...
This lays the groundwork for adding an optional `primary` field that can
be supplied to provide the "jump to" feature.
2022-06-08 12:13:04 +02:00
Antonio Scandurra
e2d1995010
Provide tab_size when formatting document using LSP range formatting
2022-06-08 09:56:11 +02:00
Keith Simmons
69bc9489f6
Add integration test and fix hovering over the wire
2022-06-07 14:22:02 -07:00
Keith Simmons
7f12bd6bb0
Add vim bindings for hover
...
Allow scrolling in hover popover
2022-06-07 13:07:53 -07:00
Keith Simmons
76104481b6
Move highlighting to editor code and implement proto message types for hover response
2022-06-07 11:54:52 -07:00
Keith Simmons
017e95f782
working markdown rendering
2022-06-07 11:54:51 -07:00
Isaac Clayton
68dbb0c1a9
Quick documentation pass
2022-06-07 11:54:33 -07:00
Keith Simmons
2a50811651
Syntax highlighting working. Getting started on markdown support
2022-06-07 11:54:33 -07:00
Isaac Clayton
8fd2228405
Clean up impl a bit
2022-06-07 11:54:33 -07:00
Isaac Clayton
f14734bc51
Add basic debounce, fix flickering
2022-06-07 11:54:31 -07:00
Keith Simmons
98c402c349
Pull hover popover out of context menu
2022-06-07 11:54:00 -07:00
Isaac Clayton
91acab26b0
Get minimal POC working
2022-06-07 11:52:52 -07:00
Isaac Clayton
5d81e8a296
Add hover action and style context menu
2022-06-07 11:50:49 -07:00
Keith Simmons
fe7fadad01
WIP
2022-06-07 11:49:28 -07:00
Keith Simmons
1c9ff7d1d4
WIP jump to definition with mouse
2022-06-07 11:47:23 -07:00
Antonio Scandurra
dc056176f2
Make Buffer::edit and MultiBuffer::edit resilient to inverted ranges
...
Previously, we would accept edits containing out-of-order ranges. When
generating such ranges in our randomized tests, many invariants started
breaking causing e.g. undo/redo to misbehave and operation application
to panic.
In theory, we should never pass inverted ranges, but this commit changes
the above functions to swap the start and the end when that occurs to avoid
breaking the entire system and panicking.
2022-06-06 15:22:36 +02:00
Antonio Scandurra
77224e023a
Require that PartialEq is implemented for Action
2022-06-06 09:18:44 +02:00
Max Brunsfeld
54eb6fa94b
Upgrade deps to avoid multiple versions of transitive deps
...
* env_logger
* prost-build
* bindgen
2022-06-02 17:38:33 -07:00
Antonio Scandurra
66b7083139
Align tooltip based on the available window space
2022-06-01 10:03:46 +02:00
Antonio Scandurra
0b765ebdc6
Pass a &mut BlockContext when rendering blocks
...
This wraps and derefs to `RenderContext<Editor>`, so that we can
easily use `MouseEventHandler`s in blocks.
2022-05-31 15:50:34 +02:00
Antonio Scandurra
025f9af73b
Cap MessageStream buffer size to 1MB
...
We temporarily let it grow when the message size exceed the limit,
but restore the buffer's capacity shortly after. This ensures that,
for each connection in its entire lifetime, we only ever use 1MB.
2022-05-31 11:16:32 +02:00
Antonio Scandurra
cf0c9b089c
Merge branch 'main' into project-panel-with-new-mouse-events
2022-05-30 18:29:46 +02:00
Keith Simmons
c4b0a60808
Remove unused context_menu file in rust crate
2022-05-27 11:32:15 -07:00
Antonio Scandurra
d71e5455a0
Merge branch 'mouse-events' into project-panel-context-menu
2022-05-27 12:07:00 +02:00
Nathan Sobo and Max Brunsfeld
eb71ed400b
Switch MouseEventHandler to use MouseRegions
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2022-05-26 20:00:01 -06:00
Nathan Sobo and Max Brunsfeld
e50715745d
Pass a RenderContext to UniformList
...
In some cases, we need to render during layout. Previously, we were rendering with a LayoutContext in some cases, but this commit adds the ability to retrieve a render context with a given handle and we use that feature in UniformList.
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2022-05-26 18:03:34 -06:00
Keith Simmons
d741fd09cf
Track selection changes in mutable selections collection
2022-05-26 17:02:05 -07:00
Max Brunsfeld and Keith Simmons
f7a49efb59
Avoid switching to visual mode when following in vim mode
...
Co-authored-by: Keith Simmons <keith@zed.dev >
2022-05-26 17:02:05 -07:00
Keith Simmons
2d611cb251
Fixup paste locations
2022-05-26 17:02:05 -07:00
Keith Simmons
d5178a27f9
fix bug in marked_range utils
2022-05-26 17:02:05 -07:00
Keith Simmons
f39925f024
WIP
2022-05-26 17:02:05 -07:00
Keith Simmons
b0c5ac1f54
Unify visual line_mode and non line_mode operators
2022-05-26 17:02:05 -07:00
Keith Simmons
f053c479e9
Visual line mode handles soft wraps
2022-05-26 17:02:05 -07:00
Keith Simmons
36fa835664
Enable copy and paste in vim mode
2022-05-26 17:02:05 -07:00
Keith Simmons
bdfa7200b9
WIP copy on delete
2022-05-26 17:02:05 -07:00
Keith Simmons
a66cc7c40b
Working change and delete in line mode
2022-05-26 17:02:05 -07:00
Keith Simmons
be8bfa9592
WIP line mode operations
2022-05-26 17:02:05 -07:00
Nathan Sobo and Antonio Scandurra
a0c355ca24
Introduce CursorRegion struct
...
This will blend in with an upcoming MouseRegion struct that sits next to it in the scene.
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
2022-05-26 11:00:10 -06:00
Nathan Sobo
c44dfa13ec
Fix editor tests
2022-05-26 09:59:25 +02:00
Nathan Sobo
287aff941e
Render a context menu when right-clicking in project panel
...
It doesn't currently do anything, but I managed to get it rendering in an absolutely positioned way.
2022-05-26 09:59:25 +02:00
Max Brunsfeld
d14224a54d
Merge pull request #1027 from zed-industries/missing-menu-commands
...
Add missing File menu commands, improve handling of unsaved multibuffers
2022-05-23 21:29:32 -07:00
Max Brunsfeld and Nathan Sobo
65c8bea372
Distinguish between singleton and non-singleton workspace items
...
* Prompt to save singleton items before non-singleton ones
* Don't prompt to save multi-buffers if they contain excerpts to items that are open elsewhere and not being closed.
Co-authored-by: Nathan Sobo <nathan@zed.dev >
2022-05-23 16:03:00 -07:00
Max Brunsfeld
259d76aa40
Start work on handling multibuffers properly when closing unsaved buffers
2022-05-22 16:48:33 -07:00
Antonio Scandurra
1fb594a0ac
Clear multi-buffer redo stack when pushing transaction onto undo stack
2022-05-22 10:44:32 +02:00
Max Brunsfeld
6082282925
Add "New Window" command
2022-05-20 11:01:20 -07:00
Max Brunsfeld
8b5b908985
Merge pull request #1023 from zed-industries/app-menu-improvements
...
Correctly populate application menus' keystrokes and enabled status
2022-05-20 10:22:20 -07:00
Max Brunsfeld
e6011794ca
Remove AppState from workspace actions
...
This allows those actions to be bound to keystrokes in the keymap.
Also, remove the WorkspaceParams struct, simplify how Workspaces are
constructed.
2022-05-19 14:37:26 -07:00
Keith Simmons
4ba404bc74
Clone selections on editor split
2022-05-19 11:22:53 -07:00
Antonio Scandurra
65d11f89f4
Bump FoldSnapshot version if excerpt gets edited outside of its bounds
...
This will cause layers above `FoldMap` to grab a fresh snapshot of the `FoldMap`
and, as a result, of the underlying `MultiBufferSnapshot`. It is a necessary change
because, even though the coordinate space is not affected, a buffer edit taking place
*before* an excerpt range could cause the excerpt buffer rows to change, e.g. if
lines were added or removed. This manifested itself in a randomized test.
2022-05-18 10:13:18 +02:00
Keith Simmons
b03abdb6df
Reduce accessibility of multibuffer read to reduce risk of borrowing snapshot and buffer refcells twice
2022-05-13 16:58:30 -07:00