Commit graph

812 commits

Author SHA1 Message Date
Antonio Scandurra
61346f734d WIP 2022-05-05 15:15:58 +02:00
Max Brunsfeld
8fdc5c9be3 Improve the appearance of project panel filename editor
* Always layout single-line editors with a fixed height
* Preserve directory chevron when editing folder names
* Allow theming the filename editor

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-05-04 10:28:44 -07:00
Max Brunsfeld
d4492086b3 Abstract more local project setup inside Project::test helper 2022-05-04 10:28:09 -07:00
Antonio Scandurra
aa4919a76f
Merge pull request #964 from zed-industries/transpose
Introduce `Editor::transpose` bound to `ctrl-t`
2022-05-04 10:04:55 +02:00
Antonio Scandurra
9a7c07f539 Improve transpose when cursors are two chars away from each other 2022-05-04 09:59:34 +02:00
Antonio Scandurra
95680aa5f2 Account for multi-byte characters in Editor::transpose 2022-05-03 14:35:03 +02:00
Antonio Scandurra
b6ff07afac Add failing test for multi-byte characters 2022-05-03 14:33:57 +02:00
Antonio Scandurra
070607c821 Implement Editor::transpose without accounting for multi-byte chars 2022-05-03 14:33:43 +02:00
Keith Simmons
b2138f5935 Add insert line above and below 2022-05-02 11:49:10 -07:00
Keith Simmons
833a7b6e76 WIP just missing insert line above and below 2022-05-02 11:49:10 -07:00
Antonio Scandurra
2977b33dd9 Use the new batched edit API when pasting
This fixes a bug that would cause zed to paste text at the wrong
location when inside a multi-buffer where the same buffer was excerpted
more than once.
2022-05-02 10:21:53 +02:00
Antonio Scandurra
5821ce9b82 Insert newlines on paste if copied selections don't match current ones 2022-05-02 10:21:20 +02:00
Keith Simmons
d4bef67cf2
Merge pull request #929 from zed-industries/non-uniform-batched-edits
Allow batched edits where each range is associated with different insertion text
2022-04-29 16:14:38 -07:00
Keith Simmons
2eb1c107ce Convert common edit strings to Arc<str> and simplify duplicate line 2022-04-29 14:57:20 -07:00
Max Brunsfeld
2c2ca1bfbd Reduce string allocations in Editor::insert
Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-04-29 10:07:21 -07:00
Keith Simmons
b4b61b4bbc Consolidate edit and edit_batched functions 2022-04-28 16:52:04 -07:00
Max Brunsfeld
fa358c01cf Add format_on_save setting
This lets you turn of formatting on save for specific languages.
2022-04-28 14:31:06 -07:00
Keith Simmons
74b467aaa8 tweak editor selection mutating functions 2022-04-28 13:46:06 -07:00
Keith Simmons
42b900774e add anchor to selection fixup info in newline 2022-04-28 13:10:31 -07:00
Max Brunsfeld
37a3cead03
Merge pull request #921 from zed-industries/new-status-bar-design
Style the status bar according to the latest design
2022-04-28 12:42:25 -07:00
Antonio Scandurra
0bb889afec
Merge pull request #923 from zed-industries/navigate-panic
Clip `scroll_top_row` before navigating back to it
2022-04-28 10:22:09 +02:00
Keith Simmons
04fc1d5982 Building, but failing test WIP 2022-04-27 17:25:38 -07:00
Max Brunsfeld
a3700e0dd8 Combine diagnostic status w/ diagnostic message indicators
Improve the indicator styling
2022-04-27 14:25:39 -07:00
Max Brunsfeld
3ad13bdd4f Display buffers in order of their path in refactor multibuffers
Previously, they were non-deterministically ordered via a HashMap iterator.
This was causing integration tests to fail spuriously on PRs.
2022-04-27 14:01:37 -07:00
Antonio Scandurra
c9478cab09 Don't panic when navigation data contains invalid anchors and/or points
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-27 16:51:48 +02:00
Antonio Scandurra
cde5a45318 Clip scroll_top_row before navigating back to it
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-27 16:25:26 +02:00
Keith Simmons
c61ae6f31f
Merge pull request #877 from zed-industries/misc-normal-commands
Add inclusive vs exclusive motions to vim mode
2022-04-22 14:25:56 -07:00
Nathan Sobo
92f040df00 Apply cursor styles during paint
This makes the editor's cursor an IBeam and properly deals with nested cursor styles.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-04-22 10:54:18 -06:00
Antonio Scandurra
53bf7b61c0
Merge pull request #887 from zed-industries/fix-typescript-rename
Use document highlights to prepare rename if LSP doesn't support it
2022-04-22 16:37:13 +02:00
Antonio Scandurra
5e16adc6c9 Use document highlights to prepare rename if LSP doesn't support it 2022-04-22 15:43:57 +02:00
Nathan Sobo
8ec2b5e359 Delete selected text when deleting to beginning of line 2022-04-22 06:04:14 -06:00
Keith Simmons
5ea782de21 Add inclusive vs exclusive motions to vim mode 2022-04-21 16:50:23 -07:00
Antonio Scandurra
5081eafa9d Always wrap lines that are wider than 512 em advances
We went with a more conservative upper bound so that the number of
characters (hopefully) never exceeds `MAX_LINE_LEN` (1024) when laying
out text.

Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-04-21 19:29:37 +02:00
Antonio Scandurra
2695b13947 Always clear rename state when selections change
At some point during the implementation of rename, we added logic for
invalidating the rename state when the selection moved outside the original
rename range. After transitioning to displaying renames as a block decoration,
we don't need that anymore given that a new, temporary editor is used instead.

This commit removes that invalidation logic and always calls `Editor::take_rename`
when the editor selections change. Doing so also fixes a bug that was causing Zed
to hide the cursor when clicking on the editor to dismiss the rename.
2022-04-15 10:32:07 +02:00
Max Brunsfeld
3cdda79fc3
Merge pull request #817 from zed-industries/dynamic-editor-highlights
Store accessors for editor highlight colors not colors themselves
2022-04-14 10:36:38 -07:00
Antonio Scandurra
6d33697e82 Fix warning 2022-04-14 13:03:46 +02:00
Antonio Scandurra
1a1d670104 Speed up WrapSnapshot::line_len using the indexed transforms 2022-04-14 13:01:29 +02:00
Antonio Scandurra
91d4c835ad Introduce TabMap::line_len 2022-04-14 12:55:33 +02:00
Keith Simmons
292d075f81 Store accessors for editor highlight colors not colors themselves 2022-04-13 15:30:57 -07:00
Keith Simmons
b893cb6d82 rename NavigationData anchor and offset to cursor_anchor and cursor_offset 2022-04-13 14:53:47 -07:00
Keith Simmons
9cec6d8d65 add comment explaining offsets 2022-04-13 13:30:07 -07:00
Keith Simmons
f20e3f35a1 Record scroll position in nav history 2022-04-13 12:30:33 -07:00
Max Brunsfeld
949fbe7cd3 Allow dumping the project diagnostic view's state as JSON
Also, improve DebugElements action so that it shows the JSON in an editor.

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-04-11 19:51:46 -07:00
Max Brunsfeld
b3c64e47f1
Merge branch 'main' into cancel-buffer-search 2022-04-11 17:38:26 -07:00
Max Brunsfeld
92a5c30389 Merge branch 'main' into load-keymaps 2022-04-11 15:55:10 -07:00
Keith Simmons
4b295f566a Handle editor cancel in pane in order to dismiss find toolbar 2022-04-11 15:11:23 -07:00
Max Brunsfeld
3636c9ec25 Load workspace and editor key bindings from a JSON file 2022-04-10 11:18:08 -07:00
Nathan Sobo
17195e615e
Merge pull request #781 from zed-industries/structured-logging
Introduce structured logging
2022-04-09 07:40:24 -06:00
Max Brunsfeld
fd4b81c8fc Allow actions to be deserialized from JSON
Introduce separate macro for implementing 'internal' actions which
are not intended to be loaded from keymaps.
2022-04-08 15:47:51 -07:00
Nathan Sobo
7e5a3f9f6b Introduce structured logging
We're enabling the log crate feature everywhere, but only using it on the server for now.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-04-08 10:06:51 -06:00