Commit Graph
3296 Commits
Author SHA1 Message Date
Nathan SoboandKeith Simmons 210fa4c443 Remove CharKind::Newline
This is just a character, and so it seems clearer to refer to it specifically when we want to know if a character is a newline. There was only one case where we relied on Newline being different from Whitespace, and we special-cased that instance. Changing this actually makes us match the behavior of VS Code when double-clicking runs of multiple newlines.

/cc @as-cii

Co-Authored-By: Keith Simmons <keith@the-simmons.net>
2022-03-21 15:17:32 -06:00
Nathan SoboandKeith Simmons baeb7d27b8 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
Nate Butler 1c23a45d02 Update Zed fonts to 1.2.1 2022-03-21 12:11:31 -04:00
Nathan Sobo c03eec019c Merge pull request #647 from zed-industries/fix-reopening-project-items
Pass project entry id to Pane when opening a project item
2022-03-20 11:01:23 -06:00
Nathan Sobo 7cb8935ff5 Pass project entry id to Pane when opening a project items
This fixes an oversight where we were failing to associate project items with their project entry ids, which broke the logic that prevented the same project entry from being opened twice in the same pane.
2022-03-20 08:54:20 -06:00
Antonio Scandurra c8a6226e03 Merge pull request #640 from zed-industries/item-view
Remove `workspace::Item` and rename `workspace::ItemView` to `workspace::Item`
2022-03-17 16:04:11 +01:00
Antonio ScandurraandNathan Sobo 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 ScandurraandNathan Sobo bff414cfbc Remove Editor::find_or_create
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 15:13:47 +01:00
Antonio ScandurraandNathan Sobo 6f9c37851c 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 ScandurraandNathan Sobo 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 ScandurraandNathan Sobo 84bacc556f Rename build_editor to build_item in Pane::open_item
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 14:31:05 +01:00
Antonio Scandurra 6446660c88 Rename open_buffer_for_path to open_buffer 2022-03-17 11:42:13 +01:00
Antonio Scandurra e6755f4115 Search only in active pane when using Editor::find_or_create 2022-03-17 11:39:39 +01:00
Antonio Scandurra a691c2fbdb Delete unused code 2022-03-17 11:33:58 +01:00
Antonio Scandurra 0efce8f70a Rename ItemView to Item 2022-03-17 11:32:46 +01:00
Antonio Scandurra aced1e2315 Finish refactoring of how editors are opened 2022-03-17 11:29:46 +01:00
Nathan SoboandMax Brunsfeld 728c708150 WIP: Massage opening of editors
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-03-16 17:40:09 -06:00
1f9885ec42 Remove open_item_in_pane
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Keith Simmons <keith@the-simmons.net>
2022-03-16 16:08:13 -06:00
0036e5c86c 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
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 e8efaed1b2 Merge pull request #633 from zed-industries/refresh-windows-panic
Fix edge cases when calling `refresh_windows`
2022-03-16 14:58:49 +01:00
Antonio ScandurraandNathan Sobo 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 17742a9fe8 Merge pull request #632 from zed-industries/underline-unused-warning
Restore underline for warnings about unused code
2022-03-16 09:52:11 +01:00
Max Brunsfeld 76fc9c955e Restore underline for warnings about unused code 2022-03-15 13:13:33 -07:00
Antonio Scandurra a0224cbe71 Merge pull request #630 from zed-industries/fix/go-to-line-panic
Fix go to line panic by replacing an unwrap with an and_then
2022-03-15 18:11:26 +01:00
Keith Simmons 72188456b2 fix go to line panic by replacing an unwrap with an and_then 2022-03-15 09:31:24 -07:00
Antonio Scandurra f20aaf5c35 v0.21.0 2022-03-15 16:48:28 +01:00
Antonio Scandurra 22688c7c82 Merge pull request #627 from zed-industries/golden-line-height
Compute line-height as a multiple of font size
2022-03-15 16:45:38 +01:00
Antonio ScandurraandNathan Sobo 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 8122abeb64 Merge pull request #626 from zed-industries/inactive-code-diagnostics
De-emphasize unnecessary code diagnostics
2022-03-15 16:09:06 +01:00
Antonio ScandurraandNathan Sobo c6c72a7249 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 ScandurraandNathan Sobo 7155dabf5b Fade out unnecessary code
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-15 15:51:59 +01:00
Antonio ScandurraandNathan Sobo 41bd58e3ac Only show errors and warnings in project diagnostics
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-15 15:30:05 +01:00
Antonio Scandurra 182b2b175d Merge pull request #625 from zed-industries/go-to-prev-diagnostic
Go to previous diagnostic via `shift-f8`
2022-03-15 15:22:53 +01:00
Antonio ScandurraandNathan Sobo 021699e51c 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 ScandurraandNathan Sobo a6d0caf557 Don't seek FilterCursor upon creation
This lets us use `next` or `prev` to decide whether to park the cursor
at the first or last filtered item.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-15 15:13:23 +01:00
Antonio ScandurraandNathan Sobo f10fd6c419 Randomize test FilterCursor::prev
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-15 15:13:23 +01:00
Antonio Scandurra 45ce503afd Start on implementing filtering support for Cursor::prev 2022-03-15 15:13:23 +01:00
Nathan Sobo 7c6fe56347 Merge pull request #624 from zed-industries/fix-broken-syntax-highlighting
Make all `HighlightStyle` properties optional
2022-03-15 06:05:35 -06: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 72692f1700 Merge pull request #622 from zed-industries/guest-settings-file
Open settings file in new window if current window isn't local
2022-03-14 17:19:11 -07:00
Max BrunsfeldandKeith Simmons 3a439f141d Open settings file in new window if current window isn't local
Co-Authored-By: Keith Simmons <keith@zed.dev>
2022-03-14 17:12:07 -07:00
Max Brunsfeld d193c9a358 v0.20 2022-03-14 15:59:52 -07:00
Max Brunsfeld 38dcd522de Bump protocol version number 2022-03-14 15:57:39 -07:00
Max Brunsfeld e7835caac4 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 325e6c31ae Autoclose brackets before a language-specific set of characters
Fixes #588
2022-03-14 15:17:40 -07:00
Max Brunsfeld 2c25e619b4 Respect theme's background color when rendering field editors 2022-03-14 14:24:51 -07:00
Max Brunsfeld 7bdb91f4ec Merge pull request #619 from zed-industries/project-entry-ids
Ensure that worktree entry ids are unique across the project
2022-03-14 12:43:58 -07:00
Max Brunsfeld 5822b47b74 Ensure that worktrees' entry ids are unique across the project
Fixes #512
2022-03-14 12:36:56 -07:00
Max Brunsfeld 91b33e4432 Merge pull request #618 from zed-industries/fix-block-layout-panic
Fix layout panic on empty editors with blocks
2022-03-14 12:25:05 -07:00