Keith Simmons
8bf564ecf7
Add editor lifetime events
2022-03-22 16:14:32 -07:00
Keith Simmons
8d4deb8693
Add editor selection utilities
...
Also improved test that was failing during above to use marker text approach as a drive by
2022-03-22 16:08:22 -07:00
Keith Simmons
3e22400212
Remove results from movement function return values, and move editor test utilities to test file
2022-03-22 10:55:03 -07:00
Nathan Sobo and Keith Simmons
61b61e070f
Clarify word movement function names and improve test coverage
...
Co-Authored-By: Keith Simmons <keith@the-simmons.net >
2022-03-21 15:17:25 -06:00
Antonio Scandurra and Nathan Sobo
53d7dfb195
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 and Nathan Sobo
c9524e63a0
Remove Editor::find_or_create
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-17 15:13:47 +01:00
Antonio Scandurra and Nathan Sobo
0060010783
Add Editor::for_multibuffer and repurpose Editor::for_buffer
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-17 14:39:02 +01:00
Antonio Scandurra and Nathan Sobo
e158b79115
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
ac220025d8
Rename open_buffer_for_path to open_buffer
2022-03-17 11:42:13 +01:00
Antonio Scandurra
88f72360b5
Search only in active pane when using Editor::find_or_create
2022-03-17 11:39:39 +01:00
Antonio Scandurra
60c4428900
Rename ItemView to Item
2022-03-17 11:32:46 +01:00
Antonio Scandurra
e2c28d19d1
Finish refactoring of how editors are opened
2022-03-17 11:29:46 +01:00
Nathan Sobo and Max Brunsfeld
e5b82e80da
WIP: Massage opening of editors
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
2022-03-16 17:40:09 -06:00
29ab1f30bc
Replace ProjectEntry struct with ProjectEntryId
...
Previously, we tracked the worktree_id and entry_id separately, but now that entry ids are unique across all worktrees this is unnecessary.
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com >
Co-Authored-By: Keith Simmons <keith@the-simmons.net >
2022-03-16 15:59:47 -06:00
4c7d18530a
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
Max Brunsfeld
235f52427a
Restore underline for warnings about unused code
2022-03-15 13:13:33 -07:00
Antonio Scandurra and Nathan Sobo
e1e907c8b0
Skip over unnecessary code diagnostics when hitting f8
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-15 15:55:39 +01:00
Antonio Scandurra and Nathan Sobo
f37b22212f
Implement shift-f8 to go to previous diagnostic
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-15 15:13:23 +01:00
Antonio Scandurra
6013fb8d0f
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
7e24f92975
Merge pull request #621 from zed-industries/autoclose-before-punctuation
...
Autoclose brackets before a language-specific set of characters
2022-03-14 15:33:47 -07:00
Max Brunsfeld
77bbf76cbc
Autoclose brackets before a language-specific set of characters
...
Fixes #588
2022-03-14 15:17:40 -07:00
Max Brunsfeld
cad1725c35
Respect theme's background color when rendering field editors
2022-03-14 14:24:51 -07:00
Antonio Scandurra
e1405addd2
Add more assertions to investigate #503 in the future
2022-03-14 16:53:39 +01:00
Antonio Scandurra and Nathan Sobo
68191e9ba7
Ensure there's at least one selection in Editor::set_selections
...
This commit introduces an assertion that will cause Zed to panic as
soon as the invariant gets violated. This will be useful to investigate
issue #503 .
Co-Authored-By: Nathan Sobo <nathan@zed.dev >
2022-03-14 16:17:14 +01:00
Max Brunsfeld
836480a3e3
Merge branch 'main' into settings-file
2022-03-13 10:43:23 -07:00
Nathan Sobo and Antonio Scandurra
7027cec1a9
Hide selections in original editor when renaming
...
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
2022-03-12 10:45:11 -07:00
Nathan Sobo and Antonio Scandurra
a93bdc4538
🙊
...
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
2022-03-12 10:44:11 -07:00
Nathan Sobo and Antonio Scandurra
795b6344da
Improve selection handling when pending rename is taken
...
- Set selection to the intuitive cursor position when moving up rather than restoring the full selection of the rename editor.
- When cancelling, restore the original selection.
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
2022-03-12 10:30:57 -07:00
Nathan Sobo
ea7f2b309d
Merge remote-tracking branch 'origin/main' into select-on-rename
2022-03-12 10:10:23 -07:00
Nathan Sobo and Antonio Scandurra
f1881795f4
Refresh document highlight after rename, but not during
...
Co-Authored-By: Antonio Scandurra <me@as-cii.com >
2022-03-12 10:10:06 -07:00
Antonio Scandurra
682ac9d92c
Merge pull request #589 from zed-industries/fold-map-test-failures
...
Avoid re-using excerpt IDs in `MultiBuffer`
2022-03-12 17:59:48 +01:00
Antonio Scandurra
4ee1f2dfc4
Fix bug in selection position maintenance while renaming symbol
...
We were resolving the selection with the wrong buffer, which now
causes a panic because we don't check the anchor's `buffer_id` anymore.
2022-03-12 13:03:45 +01:00
Max Brunsfeld
d2a4b6888c
Store settings as a global via a gpui app_state
2022-03-11 15:58:58 -08:00
Nathan Sobo
f2451665af
On rename, replace background highlights with transparent text highlights
2022-03-11 15:54:17 -07:00
Nathan Sobo
2c6d8e9d65
Merge branch 'main' into select-on-rename
2022-03-11 15:30:07 -07:00
Keith Simmons and Max Brunsfeld
1c794540cb
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
fb3d7986cb
Add unwrap check if buffer_line not available
2022-03-10 20:04:16 -08:00
Nathan Sobo
eddd356051
Focus in-progress rename editor when editor is focused
2022-03-10 16:42:20 -07:00
Nathan Sobo
fe88d384a5
When renaming, match the color of the renamed token in the rename editor
2022-03-10 16:38:45 -07:00
Nathan Sobo
799d1c90cb
Remove unused variable
2022-03-10 15:27:29 -07:00
Nathan Sobo
ebdba1d0c8
When renaming, fade out the old name and select all
2022-03-10 14:55:31 -07:00
Keith Simmons
9a43037620
render character under block cursor
2022-03-10 13:16:31 -08:00
Nathan Sobo
1e76d109a3
WIP
2022-03-10 11:32:14 -07:00
Antonio Scandurra
518662da6d
Delete till previous tabstop when backspacing within indent column
2022-03-10 10:28:24 +01:00
Keith Simmons
30b1b1e0c5
fix formatting
2022-03-10 01:09:25 -08:00
Keith Simmons
4a962e3101
Add support for rendering cursors as a block and underscore
2022-03-10 01:09:02 -08:00
Nathan Sobo
150fdc71af
Start on text highlight support
2022-03-09 20:51:35 -07:00
Antonio Scandurra
49b3d39a97
Merge pull request #569 from zed-industries/refine-autoclose
...
Refine bracket auto-closing behavior
2022-03-09 16:28:35 +01:00
Antonio Scandurra
d86c2488eb
💄
2022-03-09 15:44:58 +01:00
Antonio Scandurra
e9d64e7668
Surround selections with brackets when they are non-empty
2022-03-09 15:41:54 +01:00