Commit Graph
3305 Commits
Author SHA1 Message Date
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
Max Brunsfeld 995b1421aa Merge pull request #651 from zed-industries/refine-word-movement
Add sub-word movement and helper functions for finding word boundaries
2022-03-22 09:09:03 -07:00
Nathan Sobo 3b5830d041 Make boundary-finding methods wrap across newlines
This requires word and subword methods to explicitly acknowledge that they want to stop at newlines, which I think actually increases clarity. It makes the boundary finding method more general and useful for external callers such as the forthcoming vim crate.
2022-03-21 21:25:02 -06:00
Nathan Sobo 47496eda80 Improve DisplayPoint Debug impl 2022-03-21 21:07:56 -06:00
Nathan Sobo ba73ef8861 Implement next_subword_end 2022-03-21 20:02:08 -06:00
acad71b1f5 WIP: Start on previous_subword_start
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Keith Simmons <keith@the-simmons.net>
2022-03-21 19:53:01 -06:00
Nathan Sobo 37420a1dd0 Extract logic for scanning over character boundaries 2022-03-21 16:01:22 -06:00
Nathan Sobo ffb280f963 Make multi-byte and surrounding_word tests more readable
Just merge multi-byte tests into the main word movement tests
2022-03-21 15:41:42 -06:00
Nathan SoboandKeith Simmons ce4280c12f 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 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
Nathan Sobo fa5ab732c8 Merge pull request #648 from zed-industries/update-fonts-to-1-2-1
Update Zed fonts to 1.2.1
2022-03-21 12:19:33 -06:00
Nate Butler 6d1b231818 Update Zed fonts to 1.2.1 2022-03-21 12:11:31 -04:00
Nathan Sobo a2d9b2224d 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 6a987cedcc 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 719c7e71fe 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 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 ScandurraandNathan Sobo c9524e63a0 Remove Editor::find_or_create
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 15:13:47 +01:00
Antonio ScandurraandNathan 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 ScandurraandNathan 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 ScandurraandNathan Sobo 4ead48541f 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 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 7347e68a6d Delete unused code 2022-03-17 11:33:58 +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 SoboandMax Brunsfeld e5b82e80da WIP: Massage opening of editors
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-03-16 17:40:09 -06:00
b87e204972 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
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
Antonio Scandurra 85fbf07b32 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 ec9e02b035 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 10bd3344c9 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 235f52427a Restore underline for warnings about unused code 2022-03-15 13:13:33 -07:00
Antonio Scandurra f906b9ec5c 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 6939787b68 fix go to line panic by replacing an unwrap with an and_then 2022-03-15 09:31:24 -07:00
Antonio Scandurra 652675e39e v0.21.0 2022-03-15 16:48:28 +01:00
Antonio Scandurra 613ab4019f 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 bdd8bbb1da 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 5a47ed1e6f 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 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 ScandurraandNathan Sobo 1816b44648 Fade out unnecessary code
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-15 15:51:59 +01:00
Antonio ScandurraandNathan Sobo d567abe273 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 14e9ff5ea6 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 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 ScandurraandNathan Sobo 3217629af3 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 bbd6140677 Randomize test FilterCursor::prev
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-15 15:13:23 +01:00
Antonio Scandurra c2c68cbfe9 Start on implementing filtering support for Cursor::prev 2022-03-15 15:13:23 +01:00
Nathan Sobo 324fa9ef3f 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 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 2b57a08580 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