Commit Graph

1344 Commits

Author SHA1 Message Date
Julia
dde3dfdbf6 Quick cut of using display point conversion to layout hunks
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-10-13 16:34:34 -04:00
Julia
8d609959f1 Clean 2022-10-13 15:23:41 -04:00
Julia
16f854b636 Expand diff gutter indicator to cover all of a wrapped line 2022-10-13 14:05:57 -04:00
Julia
9c47325c25 Use correct range to get diff hunks in the presence of wrapped lines 2022-10-13 13:52:44 -04:00
Antonio Scandurra
a5a60eb854 Log view name alongside error in ChildView 2022-10-13 15:44:01 +02:00
Julia
a6a7e85894 Misc fixes, still broken soft wrap 2022-10-13 02:02:29 -04:00
Julia
e75dcc853b Include deletion hunks in fold regardless of end 2022-10-13 00:42:53 -04:00
Max Brunsfeld
6cdf4e98fc Re-export basic text types from text and language crates
Also avoid production dependencies on fs and rope in collab
2022-10-12 15:48:19 -07:00
Julia
e744520d90 Correctly offset diff hunk layouts 2022-10-12 16:40:19 -04:00
Max Brunsfeld
1179f8f7be Fix rounding error in computing editor's row range during layout
Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2022-10-12 09:19:29 -07:00
Julia
a6910584b6 Something's happening, nothing correct, but something 2022-10-12 00:39:56 -04:00
Mikayla Maki
41590ef64b
Merge branch 'main' into test-branch 2022-10-11 19:55:32 -07:00
Max Brunsfeld
7eceff1d7b Impose min scrollbar height in a way that doesn't impede scrollbar's movement
Also, fix the editor's scroll max so that you can scroll to the last
display row.
2022-10-11 18:50:04 -07:00
Kay Simmons
81a3a22379
Merge pull request #1685 from zed-industries/vim-text-objects
Vim Text Objects and Numeric Repitions
2022-10-11 16:36:19 -07:00
Mikayla Maki
0beb97547e Finished refactoring out fs and rope 2022-10-11 15:25:54 -07:00
Max Brunsfeld
638e9f9477
Merge pull request #1715 from zed-industries/scrollbars
Add scrollbars
2022-10-11 13:34:15 -07:00
Max Brunsfeld
acc85ad03c Impose a minimum height on the scrollbar 2022-10-11 13:18:33 -07:00
Mikayla Maki
cc8ae45012 Added theme writing code, really bad race condition 2022-10-11 12:48:30 -07:00
Antonio Scandurra
a656047c15
Merge pull request #1700 from zed-industries/room
Introduce call-based collaboration
2022-10-11 17:40:44 +01:00
Max Brunsfeld
f4306d977f Refresh scrollbar auto-hide setting when opening a new editor 2022-10-11 09:28:17 -07:00
Max Brunsfeld
67a32de7d4 Hide the scrollbar track, not just the thumb 2022-10-11 09:26:19 -07:00
Max Brunsfeld
e2700ff8c6 Enable/disable scrollbar auto-hide based on OS setting 2022-10-11 09:13:34 -07:00
Antonio Scandurra
45d118f96f Decide whether to clip to visible bounds on a per-element basis
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-10-11 17:05:13 +02:00
Max Brunsfeld
7b084199be Auto-hide scrollbars 2022-10-10 17:54:29 -07:00
Max Brunsfeld
6dcf638322 Represent scrollbar range with f32s 2022-10-10 17:06:48 -07:00
Max Brunsfeld
eedcc585af Add scrollbars to editors 2022-10-10 16:20:47 -07:00
K Simmons
d2494822b0 Add assertion context manager to TestAppContext and convert existing vim tests to use neovim backed test context 2022-10-10 14:46:07 -07:00
Nathan Sobo
425e540c9a Fix tests by providing close: true 2022-10-10 15:29:24 -06:00
Nathan Sobo
3ae96f2c6e Don't autoclose brackets when is false 2022-10-10 15:15:43 -06:00
Mikayla Maki
1d2495d57b Re-arrange how lines are set 2022-10-10 11:38:28 -07:00
Mikayla Maki
1af4b263b2 Implemented page up and page down for the editor 2022-10-09 19:19:40 -07:00
K Simmons
515c1ea123 Fixed some neovim test context issues, added repeated commands in vim mode, and ported some tests to use the neovim testing strategy 2022-10-08 21:52:07 -07:00
K Simmons
b82db3a254 Adds word and sentence text objects along with a new vim testing system which uses cached neovim data to verify our test accuracy 2022-10-08 21:51:49 -07:00
Max Brunsfeld
ec76146a23
Merge pull request #1692 from zed-industries/avoid-duplicate-autoformat-edits
Avoid duplicate autoformat edits
2022-10-07 09:35:10 -07:00
Julia
8fb8fff61b
Merge pull request #1682 from zed-industries/load-diff-base-from-correct-relative-path
Fix some git gutter bugs
2022-10-06 22:28:52 -04:00
Max Brunsfeld
47a8e4222a Don't allow multiple concurrent formatting requests for the same buffer
Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-10-06 17:03:38 -07:00
Max Brunsfeld
8411d886ac Fix multi-line string formatting in editor_test.rs 2022-10-06 15:13:29 -07:00
Max Brunsfeld
b6525e9164 Extract editor tests to their own file 2022-10-06 13:32:34 -07:00
Max Brunsfeld
51fa06cc8d
Merge pull request #1404 from zed-industries/html-support
Basic html support
2022-10-06 10:32:44 -07:00
Julia
771215d254 Reload git index on file events to catch new contents 2022-10-06 12:01:21 -04:00
Max Brunsfeld
7fb5fe036a Derive indent size from the language at the cursor when auto-indenting 2022-10-05 17:07:35 -07:00
Max Brunsfeld
8b86781ad1 Remove last usages of MultiBufferSnapshot::language 2022-10-05 14:44:34 -07:00
Max Brunsfeld
aa86806408 Finish generalizing ToggleComments to support block comments 2022-10-05 12:25:32 -07:00
Max Brunsfeld
d9fb8c90d8 Start work on toggling block comments for HTML 2022-10-04 17:27:03 -07:00
Julia
2bd947d4d0 Use correct start row for hunk retrieval & correct paint offset
Co-Authored-By: Joseph Lyons <joseph@zed.dev>
2022-10-04 15:04:42 -04:00
Max Brunsfeld
218ba81013 Fix autoclose error when cursor was at column 0 2022-10-03 17:44:18 -07:00
Mikayla Maki
499e95d16a Removed debugs, simplified settings 2022-10-03 17:43:05 -07:00
Max Brunsfeld
c354b9b959 Add assertions to test for autoclose with embedded languages 2022-10-03 13:24:37 -07:00
Mikayla Maki
5769cdc354 made git diff rendering respect line wrap 2022-10-02 18:00:13 -07:00
Mikayla Maki
9fe6a5e83e made git stuff slightly more themable 2022-09-29 13:16:02 -04:00
Nate Butler
b395fbb3f2 wip 2022-09-29 13:16:02 -04:00
Nate Butler
8a2430090b WIP Git gutter styling 2022-09-29 13:16:02 -04:00
Julia
d5fd531743 Move git related things into specialized git crate
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-09-29 13:16:02 -04:00
Julia
7e5d49487b WIP Notifying buffers of head text change
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-09-29 13:16:02 -04:00
Julia
8d2de1074b Pull git indicator colors out of theme
Co-Authored-By: Kay Simmons <kay@zed.dev>
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-09-29 13:16:02 -04:00
Julia
b18dd8fcff Fully qualify outside git-related code when a diff is a git diff 2022-09-29 13:16:02 -04:00
Julia
6825b6077a Properly invalidate when async git diff completes 2022-09-29 13:16:02 -04:00
Julia
9c82954877 Changed diffs to be async and dropped git delay 2022-09-29 13:16:02 -04:00
Julia
b9d84df127 Track buffer row divergence while iterating through diff lines
This allows for offsetting head row index of deleted lines to normalize
into buffer row space
2022-09-29 13:16:02 -04:00
Julia
c1249a3d84 Handle deletions more robustly and correctly 2022-09-29 13:16:02 -04:00
Julia
883d5b7a08 Update git gutter status after debounced delay
Co-authored-by: Max Brunsfeld <max@zed.com>
2022-09-29 13:16:02 -04:00
Julia
5157c71fa9 Render deletion gutter markers 2022-09-29 13:16:02 -04:00
Julia
fdda2abb78 Correct start/end of git diff hunks 2022-09-29 13:16:02 -04:00
Julia
641daf0a6e Correct git gutter indicator scroll position & add rounded corner 2022-09-29 13:16:02 -04:00
Julia
55ca02351c Start painting some sort of hunk info, it's wrong but it's close
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-09-29 13:16:01 -04:00
Julia
6fa2e62fa4 Start asking Editors to update git after a debounced delay 2022-09-29 13:16:01 -04:00
Max Brunsfeld
2da32af340 Update EditorTestContext usage to reflect new synchronous constructor 2022-09-28 12:36:55 -07:00
Max Brunsfeld
2b0794f5ae Restructure autoclosing to account for multi-language documents 2022-09-28 12:32:04 -07:00
Max Brunsfeld
67e188a015 Add Buffer::language_at, update MultiBuffer to use it
Co-authored-by: Julia Risley <floc@unpromptedtirade.com>
2022-09-28 12:32:04 -07:00
Max Brunsfeld
5d0b6a3da7 Merge branch 'main' into new-signup-flow 2022-09-27 15:35:05 -07:00
Nathan Sobo
824fdb54e6 Report editor open and save events to Amplitude
Co-authored-by: Max Brunsfeld <max@zed.dev>
2022-09-26 18:18:34 -06:00
Julia
12e439bda9 Test manual buffer format trigger 2022-09-23 12:15:24 -04:00
Julia
f3395cf4fd Add editor action to manually invoke buffer format 2022-09-22 18:21:05 -04:00
Mikayla Maki
e0635a3ed8 Fixed autoscroll jump on 4-click 2022-09-19 17:05:10 -07:00
Antonio Scandurra
9efa39e81e Merge branch 'main' into capture 2022-09-15 12:02:07 +02:00
Antonio Scandurra
f67e2bea29 Refresh windows when OS appearance changes 2022-09-14 11:47:43 +02:00
K Simmons
3b9b2cd443 Add tests for the dock 2022-09-13 19:18:05 -07:00
K Simmons
3c88aa3d18 Fix hovering over hover popovers in the editor
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-09-13 13:35:06 -07:00
K Simmons
6b26965074 Permanent fix to repeat MouseRegion Tag failure in Workspace
Polish tab bar buttons

Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-09-11 15:34:10 -07:00
K Simmons
69ecbb644d DOCK WORKING!
Update editor element to use mouse regions instead of dispatch event for mouse events
Fix bug in presenter where mouse region handlers were stored on click and called instead of more up to date handlers from subsequent renders
Changed MouseRegion to require discriminants in all cases
Add scroll wheel event to MouseRegion
Polished a bunch of dock inconsistencies

Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-09-11 15:32:20 -07:00
K Simmons
b88abcacac WIP dock split button and default item 2022-09-11 15:31:44 -07:00
K Simmons
31ecb2f7bc Introduced ItemEvent and to_item_events function to Item trait which converts the Item's events into a standard ItemEvent similar to how SearchableItems work.
Add breadcrumb_location and breadcrumbs functions to item trait which handles rendering of the breadcrumb elements
Change breadcrumb toolbar to use these new functions rather than having hard coded breadcrumb logic
Add breadcrumb support to the terminal tabs

Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-09-06 16:05:36 -07:00
K Simmons
ab81093ef5 WIP pull breadcrumb rendering out into item trait 2022-09-06 14:39:58 -07:00
Mikayla Maki
0e0bae8faa
Merge pull request #1587 from zed-industries/alac-search
Terminal Search
2022-09-01 13:49:48 -07:00
Mikayla Maki
ebae991cb2 Finished terminal search 2022-09-01 13:45:46 -07:00
Mikayla Maki
1a0f43f0c5 Actually added all files this time 2022-08-31 20:37:04 -07:00
Mikayla Maki
3f11fd3b8b Terminal implements important half of search protocol 2022-08-31 17:41:53 -07:00
K Simmons
d7e6e8c5a1 Add match associated type and fix failing test 2022-08-30 21:53:49 -07:00
K Simmons
91a5d0b036 SearchableItem trait is completed and editor searches appear to be working 2022-08-30 15:37:54 -07:00
Nathan Sobo
daf33fc657
Merge pull request #1557 from zed-industries/operations-hang
Prevent guest disconnection when opening buffers with many operations
2022-08-24 08:47:39 -06:00
Antonio Scandurra
f0d35ccc50 Move operation serialization off the main thread 2022-08-23 16:34:25 +02:00
Antonio Scandurra
954695f5fe Stream buffer ops in the background when creating buffer for peers 2022-08-23 16:05:56 +02:00
Mikayla Maki
77670cbc7c Added scroll-to-edge. 2022-08-22 18:24:58 -07:00
ForLoveOfCats
d00a482bdd Only extend selection with shift without other modifiers 2022-08-21 13:23:48 -04:00
Mikayla Maki
6122bc863d
Merge pull request #1522 from zed-industries/terminal-mouse
Terminal mouse mode
2022-08-19 15:19:27 -07:00
ForLoveOfCats
40a8c26080 Include empty selections in updating link logic on cmd/shift changed
Prevents an issue where pressing cmd while the mouse button is down
would create a link which would fire on mouse up if the selection was
still empty
2022-08-19 17:25:35 -04:00
Mikayla Maki
9f9bafd2a7 Merge branch 'terminal-mouse' of github.com:zed-industries/zed into terminal-mouse 2022-08-19 13:04:34 -07:00
Mikayla Maki
efd3247ce4 Added modifiers to scroll wheel eevent 2022-08-19 12:10:12 -07:00
Julia
1f7db46d98
Merge pull request #1537 from zed-industries/fix-goto-links-with-selections
Fix goto links with selections
2022-08-18 18:49:21 -04:00
ForLoveOfCats
8583320e9b Add test for pending selection influence on go-to links
Co-authored-by: Max Brunsfeld <max@zed.dev>
2022-08-18 18:34:01 -04:00
ForLoveOfCats
b61e9a940e Avoid triggering goto-definition links while with a pending selection
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-08-18 18:34:01 -04:00
Mikayla Maki
d545e59b49 Finished IME for now 2022-08-18 12:57:19 -07:00
Mikayla Maki
acce0042f9 Fixed blink problems 2022-08-17 14:41:28 -07:00
Mikayla Maki
73cd6b51d8
Merge pull request #1520 from zed-industries/terminal-blink
Terminal cursor blinking
2022-08-15 18:39:23 -07:00
Mikayla Maki
b9c73127b4 Added a hollow mode to the cursor rendering code, for terminal lost focus 2022-08-15 18:27:26 -07:00
Max Brunsfeld
754a130e59 Clear go-to-def link when deactivating the window 2022-08-15 17:30:41 -07:00
Max Brunsfeld
7de8228efd Clear stale go-to-def link when resizing buffer font 2022-08-15 16:15:20 -07:00
ForLoveOfCats
7b71554b58 Don't scroll to cursor when performing file save 2022-08-12 11:20:18 -04:00
ForLoveOfCats
8ba2f77148 One big cleanup pass of clippy lints
Co-authored-by: Mikayla <mikayla@zed.dev>
2022-08-10 16:51:01 -07:00
Keith Simmons
ec015d4607
Merge pull request #1422 from zed-industries/workspace-child-focus-pane-activation
Add on_child_focus and on_child_blur to View trait
2022-08-10 16:42:01 -07:00
K Simmons
6f180ed822 Pane focus working. Modals seem broken now 2022-08-09 17:15:54 -07:00
K Simmons
690ea57211 WIP compiling but failing with circular reference 2022-08-09 17:15:52 -07:00
K Simmons
4271eb3624 Event dispatch moved to MutableAppContext. No longer dispatches from presenter. Not currently handling key presses properly 2022-08-09 17:09:16 -07:00
ForLoveOfCats
a47a6f2f22 Handle Cmd/Shift + Click go-to action on mouse-up instead of mouse-down 2022-08-08 15:59:33 -04:00
Max Brunsfeld
89a645ee11 Add docs to some EditorTestContext methods that use marked text 2022-08-04 11:25:09 -07:00
Max Brunsfeld
26fdaeb92b Use new marked ranges format whenever we don't need overlapping ranges 2022-08-04 10:23:03 -07:00
Max Brunsfeld
8e6fb76681 Use new marked_ranges format in more editor tests 2022-08-03 20:04:47 -07:00
Max Brunsfeld
afcf5fc95b Update vim mode tests to use new marked text format 2022-08-03 17:52:34 -07:00
Max Brunsfeld
eabd9c02e5 Update marked text helpers to use more distinctive characters for markers 2022-08-03 16:45:16 -07:00
Max Brunsfeld
6e76bd32da
Merge pull request #1462 from zed-industries/crash-on-goto-diagnostic
Fix two crashes related to diagnostics and bugs in mouse-based columnar selection
2022-08-03 12:04:56 -07:00
Max Brunsfeld
096f4693d3 Fix crash and wrong columnar selection when mousing over block lines 2022-08-03 10:19:06 -07:00
Max Brunsfeld
e1431ede36 Avoid crash when clicking the popover of a diagnostic that's been removed 2022-08-03 09:10:00 -07:00
ForLoveOfCats
f9dc14be43 Add newline_below action 2022-08-03 11:34:40 -04:00
Antonio Scandurra
3174b08082 Update old snapshot when only the tab size changes 2022-08-03 12:23:02 +02:00
Antonio Scandurra
1e94eb74f4 Don't ignore new tab snapshot in WrapMap if only tab size changed 2022-08-03 12:16:46 +02:00
Antonio Scandurra
385d214b47 Enhance DisplayMap randomized test to change tab size
This removes the need for a unit test.
2022-08-03 12:01:26 +02:00
Antonio Scandurra
d1f155337f Recompute layers above tab map entirely when tab size changes
Previously, we wouldn't generate any `TabEdit` when the tab size
changed, causing coordinate spaces in `WrapMap` and `BlockMap` to
become outdated.

This commit generates a synthetic edit that covers the entire `TabMap`
to ensure layers above are synchronized.
2022-08-03 11:06:17 +02:00
Max Brunsfeld
039c94c829 🎨 Editor::tab 2022-08-02 17:02:25 -07:00
Julia
8115c1ab24
Merge pull request #1451 from zed-industries/tab-auto-indent
Auto-indent on tab for cursors left of the suggested indent level
2022-08-02 15:52:12 -04:00
Max Brunsfeld
2533648419 Fix selection positions in tab w/ multiple non-empty selections on the same line
Co-authored-by: Julia Risley <floc@unpromptedtirade.com>
2022-08-02 11:42:23 -07:00
Max Brunsfeld
c87eb16ad9 Restructure tab command to treat each cursor individually
Co-authored-by: Julia Risley <floc@unpromptedtirade.com>
2022-08-02 11:08:49 -07:00
Max Brunsfeld
115677ec5d Start work on auto-indenting lines on tab
Co-authored-by: Julia Risley <floc@unpromptedtirade.com>
2022-08-01 16:47:59 -07:00
Max Brunsfeld
33638c0c11 Use first cursor's indent column when pasting w/ different # of cursors 2022-08-01 11:03:07 -07:00
Max Brunsfeld
04e40608a0 Fix mistakes in editor auto-indent test 2022-08-01 11:02:29 -07:00
ForLoveOfCats
479fbee574 Add test cases for `cmd+shift+click" behavior 2022-07-29 17:00:07 -04:00
ForLoveOfCats
2c70583ef0 Add cmd+shift+click action for triggering go to type definition 2022-07-29 17:00:07 -04:00
ForLoveOfCats
5149c15329 Add "go to type definition" action 2022-07-29 11:41:08 -04:00
Max Brunsfeld
868c460620 🎨 Rename and simplify some autoindent stuff 2022-07-28 22:40:30 -07:00
Max Brunsfeld
7a26fa18c7 Record start columns when writing to the clipboard from Zed 2022-07-28 22:13:32 -07:00
Max Brunsfeld
fa5af4383d Introduce AutoindentMode parameter to Buffer::edit
This controls whether or not we preserve the relative indentation
of inserted text blocks.

Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
2022-07-28 14:03:31 -07:00
Max Brunsfeld
cdf6ae25bb Remove indent_size parameter from Buffer::edit_with_autoindent
Instead, compute the indent size by reading the settings inside that method.

Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
2022-07-28 13:00:05 -07:00
Antonio Scandurra
f775cb2947 Honor sort_text when language server provides completions 2022-07-26 10:41:39 +02:00
Max Brunsfeld
ab037fe844 Simulate calling of text-insertion APIs in TestAppContext::dispatch_keystroke 2022-07-25 12:20:12 -07:00
Max Brunsfeld
4c8d9384b1 Replaces lines_utf16 with a single u32 - last_line_len_utf16 2022-07-25 11:35:42 -07:00
Antonio Scandurra
6dc27cbba2 Add test for IME composition with multiple cursors 2022-07-25 17:47:10 +02:00
Antonio Scandurra
ff99f8d0ca Clip UTF-16 offsets provided by Cocoa when composing IME input 2022-07-25 17:32:33 +02:00
Antonio Scandurra
47e8bd5f4f Introduce MultiBuffer::clip_offset_utf16 2022-07-25 15:06:04 +02:00
Antonio Scandurra
c46be992e0 Introduce Rope::clip_offset_utf16 2022-07-25 15:02:45 +02:00
Antonio Scandurra
bb55d654ce Handle IME composition with multiple cursors 2022-07-25 14:50:09 +02:00
Antonio Scandurra
ca3e73106c Merge branch 'main' into ime-support-2 2022-07-25 10:47:49 +02:00
Antonio Scandurra
d3567e381c Coalesce IME compositions into a single edit 2022-07-25 09:53:51 +02:00
Max Brunsfeld
65fd943509 Move edited_ranges_for_transaction from BufferSnapshot to Buffer
Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2022-07-22 11:24:14 -07:00
Keith Simmons
2111fdc118
Merge pull request #1378 from zed-industries/diagnostics-popover
Diagnostics Popover
2022-07-22 11:12:56 -07:00
K Simmons
b93040a6ae attempt to fix broken test 2022-07-22 10:55:57 -07:00
Antonio Scandurra
7b009c8bbe Merge branch 'main' into ime-support-2 2022-07-22 16:03:38 +02:00
Max Brunsfeld
372c3eed52 Adjust editor tests to use input APIs instead of key events 2022-07-21 21:36:40 -07:00
Max Brunsfeld
0185b4fef4 Add simple IME handling to the terminal 2022-07-21 21:32:58 -07:00
Keith Simmons
9286e5ea04
Merge pull request #1396 from zed-industries/better-empty-pane
Fix Pane Focus Issues
2022-07-21 15:07:03 -07:00
Max Brunsfeld
6d264502b2 Remove print statements 2022-07-21 13:44:58 -07:00
Max Brunsfeld
2142fca673 Remove Input action, detect ignored input in vim via an event 2022-07-21 13:40:48 -07:00
Max Brunsfeld
beeaec8647 Prevent IME window from appearing while editor's input is disabled (vim) 2022-07-21 12:48:36 -07:00
Max Brunsfeld
7c575990be Remove the set_selected_text_range method from the InputHandler trait 2022-07-21 12:22:12 -07:00
Antonio Scandurra
97ce3998ec Position IME input according to where the selection is rendered 2022-07-21 17:35:40 +02:00
Antonio Scandurra
101a0663d3 Remove input from KeyDownEvent 2022-07-21 14:29:27 +02:00
Antonio Scandurra
b02681ee8a Treat NSTextInputClient ranges as UTF-16 2022-07-21 13:41:35 +02:00
Antonio Scandurra
32662b6b92 Start indexing UTF-16 offsets
This is needed because cocoa will report ranges as UTF-16 indices.
2022-07-21 09:40:48 +02:00
Antonio Scandurra
eda60effed Honor setting the selected range in addition to marking text 2022-07-21 08:57:20 +02:00
K Simmons
b85b2a90aa address warnings 2022-07-20 19:02:33 -07:00
K Simmons
02a47d962e add test coverage for diagnostic popover 2022-07-20 19:02:33 -07:00
K Simmons
95952f0c66 working diagnostic popover. Also renamed GoToNextDiagnostic to GoToDiagnostic and adjusted it's action to jump to the popover's diagnostic if it is visible 2022-07-20 19:02:33 -07:00
K Simmons
dbedc30abe WIP 2022-07-20 19:02:33 -07:00
K Simmons
225055ed5d Address some issues where panes don't get focused properly, make the focused pane more obvious, and prevent splitting of the pane with no items 2022-07-20 18:52:32 -07:00
Max Brunsfeld
f985515141 Start work on new text input handling in Editor 2022-07-20 16:45:27 -07:00
Keith Simmons
d34d6ea184
Merge pull request #1392 from zed-industries/mouse-vim-mode-clipping
Fixup Clipping at Line Ends when Selecting with the Mouse in Vim Mode
2022-07-20 13:39:24 -07:00
Antonio Scandurra
42ac4bf9fc WIP 2022-07-20 18:06:29 +02:00
K Simmons
1cfaac1bc5 Fix clipping when dragging the mouse with vim-mode enabled and adjust single line editor selections 2022-07-19 17:18:17 -07:00
Nate Butler
bcc554a3db Merge branch 'main' into theme-improvements 2022-07-19 20:12:02 -04:00
Keith Simmons
c2868a39e8
Merge pull request #1388 from zed-industries/mouse-region-refactor
Mouse Region Refactor
2022-07-19 16:50:12 -07:00
Nate Butler
46384e71b7 Add icon sets for sizes 8, 12 and 16, remove old icons 2022-07-19 17:11:15 -04:00
Antonio Scandurra
456a390166 Add character palette menu item 2022-07-19 14:51:57 +02:00
K Simmons
8add81350e Rework presenter and MouseRegion to use Handler hashmap rather than individual fields 2022-07-17 23:19:32 -07:00
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
d4ee372eab 🎨 2022-07-14 16:46:45 +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
5366ed4404 Add basic test for editor context menu 2022-07-13 14:13:19 -07:00
Keith Simmons
b850e41d6f Add editor mouse context menu with some basic refactorings and an entry to pop the code actions 2022-07-13 14:13:19 -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
Keith Simmons
667d031ec8
Merge pull request #1311 from zed-industries/fix-visual-paste
Fix visual paste
2022-07-08 16:54:10 -07:00
Isaac Clayton
988f388165 Added theme to language 2022-07-08 18:11:28 +02:00
Mikayla Maki
be94f614a7 fix merge conflicr 2022-07-07 17:24:55 -07:00
Nathan Sobo
805c06ee76
Merge pull request #1298 from zed-industries/mouse-region-refactor
Mouse Event Refactor
2022-07-07 16:43:36 -06:00
Mikayla Maki
2a6e23ff28 Hoisted assert clipboard into TestAppContext 2022-07-07 14:55:25 -07:00
Mikayla Maki
a8237858bc Added basic selections 2022-07-07 14:52:04 -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
Antonio Scandurra
c6254247c3 Allow providing an external format in format_on_save setting 2022-07-07 11:04:03 +02:00
Keith Simmons
bcb553f233 Combine platform mouse events to use common MouseEvent struct and remove MouseDragged event in favor of MouseMoved 2022-07-06 16:37:56 -07: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
Keith Simmons
686e57373b pull event data out into individual Event structs 2022-07-06 15:36:42 -07:00
Antonio Scandurra
b937c1acec Move autosave logic up into Workspace and Pane 2022-07-06 16:33:22 +02:00
Mikayla Maki
4d88088ca4
Merge pull request #1286 from zed-industries/grid-renderer
Switch from line-and-character renderer to a direct grid renderer
2022-07-05 17:16:00 -07:00
Mikayla Maki
03cbb94057 changed renderer 2022-07-05 17:10:01 -07:00
Keith Simmons
ed52f8a8a3 WIP making paste better 2022-07-05 16:52:56 -07: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
Mikayla Maki
6ac5cc0d2a Fixed cursor positioning bugs in multi-byte charcters. Still have at least one though :/ 2022-07-01 14:53:19 -07:00
Mikayla Maki
62939322d3 rendering cursor correctly 2022-07-01 13:03:26 -07:00
Mikayla Maki
ae836e1465 Fixed a major bug and now use the same cursor paint logic as the editor 2022-06-30 20:43:51 -07:00
Keith Simmons
1eb8351440 add hover popover setting 2022-06-27 16:21:22 -07:00
Keith Simmons
f73af85218 bump protocol version and fix panic from storing display points instead of anchors 2022-06-27 15:10:36 -07:00
Keith Simmons
a0577f5f46 Fix usage of existing definitions 2022-06-27 10:07:44 -07:00
Keith Simmons
a8ea1048cf Change mouse cursor when link is visible 2022-06-24 21:55:57 -07:00
Keith Simmons
a190eb0537 fix rebase merge error 2022-06-24 15:11:57 -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 Scandurra
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
19feb627d8
Add comment linking to long term plan 2022-06-21 12:38:27 -07:00
Keith Simmons
057a7ec989 Don't trigger hover popover action when mouse is over context menu 2022-06-21 11:23:25 -07: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
Antonio Scandurra
c31a233aad Introduce a new fingerprint field to TextSummary
This is calculated in `Rope` and uses the `bromberg_sl2` homomorphic
hash function to determine the fingerprint of a single chunk and
compose each chunk fingerprint into a single fingerprint for the entire
rope that is equivalent to hashing all the rope's bytes at once.
2022-06-17 12:12:37 +02:00
Max Brunsfeld
216a275ef2 Disable auto-indent entirely for markdown 2022-06-16 14:20:09 -07:00
Antonio Scandurra
edd758eb67 Cap context menu's width to cover at most 70% of the window 2022-06-16 10:40:12 +02:00
Antonio Scandurra
516bd13474 Add tooltip to follow collaborators 2022-06-15 17:08:39 +02: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