Commit Graph
565 Commits
Author SHA1 Message Date
Antonio Scandurra af917de684 Handle inserting multiple tabs on the same row
This also fixes a panic when tabbing on a row that contained multi-byte
characters.
2022-07-16 08:40:44 +02:00
Antonio Scandurra fd5cb02ea9 Truncate description in tab title when it is too long 2022-07-14 15:12:16 +02:00
Antonio Scandurra 07d269234f Differentiate among tabs with the same name
This commit introduces a new, optional `Item::tab_description` method
that lets implementers define a description for the tab with a certain
`detail`. When two or more tabs match the same description, we will
increase the `detail` until tabs don't match anymore or increasing the
`detail` doesn't disambiguate tabs any further.

As soon as we find a valid `detail` that disambiguates tabs enough, we
will pass it to `Item::tab_content`. In `Editor`, this is implemented by
showing more and more of the path's suffix as `detail` is increased.
2022-07-14 11:54:11 +02:00
Max Brunsfeld 9c82d5b080 Merge pull request #1333 from zed-industries/editor-mouse-context-menu
Editor mouse context menu
2022-07-13 15:58:31 -07:00
Keith Simmons 7f3018c3f6 add show_completions_on_input setting to disable popping the completions menu automatically 2022-07-13 14:23:49 -07:00
Keith Simmons d796b543e0 WIP add basic context menu and make progress toward adding quick actions to it 2022-07-13 14:13:19 -07:00
Max Brunsfeld b7109ea4fc Restore document highlights when canceling a rename 2022-07-12 17:01:18 -07:00
Max Brunsfeld c02f4ea8dc Rename LanguageSettings -> EditorSettings 2022-07-12 11:42:43 -07:00
Max Brunsfeld ec8a493700 Move all default settings from source code into the JSON file 2022-07-12 11:35:19 -07:00
Antonio Scandurra afc8e9050c Merge pull request #1252 from zed-industries/plugin
Language Server WebAssembly Plugin Integration (Part 2)
2022-07-12 11:04:20 +02:00
Isaac Clayton ec327a30c3 Fix minor issues pointed out in the review 2022-07-11 15:54:03 +02:00
Mikayla Maki 2a6e23ff28 Hoisted assert clipboard into TestAppContext 2022-07-07 14:55:25 -07:00
Isaac Clayton 895747476f Done! Finish transition to async, very close to merging 2022-07-07 16:21:20 +02:00
Isaac Clayton 39fdbc593b Fix most warnings 2022-07-07 16:19:49 +02:00
Isaac Clayton d009e10a46 Fix all residual errors, need to polish off warnings and TODOS 2022-07-07 16:17:03 +02:00
Isaac Clayton 6585daccf9 Further unpropogate async 2022-07-07 16:16:58 +02:00
Max Brunsfeld a378ec49ec Enable and disable nav buttons based on pane's navigation stack
Also, make the `NavHistory` type private to the `workspace` crate.
Expose only the `ItemNavHistory` type, via a method on Pane called
`nav_history_for_item`.
2022-07-06 15:46:43 -07:00
Antonio Scandurra b937c1acec Move autosave logic up into Workspace and Pane 2022-07-06 16:33:22 +02:00
Keith Simmons 58e57d0150 Merge pull request #1271 from zed-industries/matching-bracket-highlights
Highlight matching bracket when newest selection head is on a bracket
2022-07-05 16:51:46 -07:00
Keith Simmons 1f3dc2f534 highlight both brackets, only when empty selection, and add test 2022-07-05 15:19:05 -07:00
Antonio Scandurra f09d265054 Remove non-determinism from autosave after delay 2022-07-05 17:54:54 +02:00
Antonio Scandurra a5c39acf4c Always finish previous autosave before starting a new one 2022-07-05 17:51:01 +02:00
Antonio Scandurra ebf4bae173 Add unit test for autosave 2022-07-05 17:51:01 +02:00
Antonio Scandurra 885172f4dd Honor Autosave setting in Editor 2022-07-05 17:51:01 +02:00
Max Brunsfeld 771a834d84 Delete the autoclosing bracket when deleting the opening bracket 2022-07-04 10:46:35 -07:00
Keith Simmons 9b36e3d009 Highlight matching bracket when newest selection head is on a bracket 2022-07-01 15:06:16 -07:00
Keith Simmons 92ab107fc9 working jump to definition with tests 2022-06-24 15:09:31 -07:00
Keith Simmons 848445455d Working underline based on symbol origin 2022-06-24 15:05:35 -07:00
Keith Simmons 4286a9b564 wip 2022-06-24 15:03:24 -07:00
Keith Simmons f78b55f92d wip 2022-06-24 15:03:24 -07:00
Max Brunsfeld c91451a1b2 Merge pull request #1234 from zed-industries/fix-editor-cloning
Clone fold and selection state correctly when splitting an editor
2022-06-23 13:27:40 -07:00
Max Brunsfeld fb2a7787a1 Clone fold and selection state correctly when splitting an editor 2022-06-23 13:15:50 -07:00
Keith Simmons 755636d10e Use NonZeroU32 to ensure settings tabsize cannot be zero 2022-06-23 12:55:38 -07:00
Antonio ScandurraandNathan Sobo 2cb8a3ccfb Don't override top-level settings with language defaults
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-23 16:40:57 +02:00
Keith Simmons fb881b2eda hide hover on editor blur 2022-06-21 10:37:59 -07:00
Antonio Scandurra d5efae609e Respect close in language configuration when autoclosing bracket 2022-06-20 11:50:44 +02:00
Antonio Scandurra ae2273b40a Merge pull request #1204 from zed-industries/accurate-is-dirty
Determine `Buffer::is_dirty` based on the rope's fingerprint
2022-06-17 16:08:07 +02:00
Antonio Scandurra 5654684d30 Fix editor tests after changing the semantics of is_dirty 2022-06-17 12:57:40 +02:00
Antonio Scandurra 6f7a893ec9 Determine Buffer::is_dirty based on the rope's fingerprint 2022-06-17 12:38:25 +02:00
Max Brunsfeld 216a275ef2 Disable auto-indent entirely for markdown 2022-06-16 14:20:09 -07:00
Antonio Scandurra 4750727586 Autoscroll to newest selection when adding it via the cursor 2022-06-15 13:21:01 +02:00
Antonio Scandurra 7a81983c62 Fix surrounding text with bracket pairs with multiple selections
This was probably a regression that was introduced with the new batched
`Buffer::edit` API and was caused by providing selection ranges in a
non-ordered fashion (we were passing all the starts first and then all the
ends).

With this commit we are adding a unit test to verify the behavior of
`Editor::surround_with_bracket_pair` and changing the order in which
we pass edit ranges to respect the selection order.
2022-06-15 11:48:21 +02:00
Antonio Scandurra 666ea61dbc Introduce a new BlockStyle field for blocks
This new field allows blocks to specify how they want to be laid out:

- If `Fixed` they can take up all the width they want and they will impact
the scroll width of the editor. This is useful for diagnostic messages and
allows scrolling the editor further to the right to visualize the entire message.
- If `Flex` they can extend all the way to the scroll width without impacting it
any further. This is useful for the rename editor that we insert as a block
decoration when hitting `F2`.
- If `Sticky`, they will be as wide as the editor element and won't participate
in the horizontal scrolling of the editor. This is useful for headers in general,
where we want e.g. the filename and the jump button to always be visible
independently of how much the user has scrolled to the right.
2022-06-10 13:47:40 +02:00
Keith Simmons 02f0fee6ae Always delay hover display 2022-06-09 18:08:23 -07:00
Keith Simmons 8378590d57 Test fixes 2022-06-09 17:03:45 -07:00
Keith Simmons 722023e347 test and build fixes 2022-06-09 17:03:45 -07:00
Keith Simmons dddfc7beae Add hover test and tweak dismiss logic 2022-06-09 17:03:45 -07:00
Keith Simmons 1da1853a76 Hide hover when font changes, and handle case where delay was preventing hover with large symbol range 2022-06-09 17:03:44 -07:00
Keith Simmons b51bd87c10 Rework hover delay, respect editor font size, and enable hover in multibuffers 2022-06-09 17:03:44 -07:00
Keith Simmons ee33fb03f2 wip 2022-06-09 17:03:44 -07:00