Commit Graph

2416 Commits

Author SHA1 Message Date
Julia
85332eacbd Race completion filter w/completion request & make not block UI 2023-10-12 13:23:26 -04:00
Julia
4688a94a54 Allow file links in markdown & filter links a bit aggressively 2023-10-12 12:11:27 -04:00
Kirill Bulatov
1bfde4bfa2 Add more tests 2023-10-12 15:14:51 +03:00
Kirill Bulatov
7f4ebf50d3 Make the first prettier test pass 2023-10-12 13:30:49 +03:00
Julia
a09ee3a41b Fire markdown link on mouse down
Previously any amount of mouse movement would disqualify the mouse down
and up from being a click, being a drag instead, which is a long
standing UX issue. We can get away with just firing on mouse down here
for now
2023-10-11 14:39:34 -04:00
Julia
0cec0c1c1d Fixup layout 2023-10-11 13:41:58 -04:00
Kirill Bulatov
e50f4c0ee5 Add prettier tests infrastructure 2023-10-11 19:13:28 +03:00
Julia
801af95a13 Make completion documentation scroll & fix accompanying panic from tag
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-10-10 10:08:29 -04:00
Julia
f5af5f7334 Avoid leaving selected item index past end of matches list
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-10-10 09:27:18 -04:00
Julia
354882f2c0 Enable completion menu to resolve documentation when guest 2023-10-10 00:16:15 -04:00
Conrad Irwin
ab050d1890 Use Horizontal ranges everywhere 2023-10-09 21:48:50 -06:00
Conrad Irwin
002e2cc42c Round better for up/down 2023-10-09 21:48:32 -06:00
Conrad Irwin
ef7e2c5d86 Get the project running! 2023-10-09 21:48:31 -06:00
Conrad Irwin
e7badb38e9 Refactor to pass a TextLayoutDetails around 2023-10-09 21:47:58 -06:00
Conrad Irwin
dacc8cb5f4 Begin to use pixels for column selection
For zed-industries/community#759
For zed-industries/community#1966

Co-Authored-By: Julia <floc@unpromptedtirade.com>
2023-10-09 21:47:58 -06:00
Julia
7020050b06 Fix hover_popover.rs after bad rebase 2023-10-09 14:28:53 -04:00
Julia
9d8cff1275 If documentation included in original completion then parse up front 2023-10-06 13:26:39 -04:00
Julia
32a29cd4d3 Unbork info popover parsing/rendering and make better 2023-10-06 13:26:39 -04:00
Julia
8dca4c3f9a Don't need editor style to parse markdown 2023-10-06 13:26:39 -04:00
Julia
a881b1f5fb Wait for language to load when parsing markdown 2023-10-06 13:26:39 -04:00
Julia
ea6f366d23 If documentation exists and hasn't been parsed, do so at render and keep 2023-10-06 13:26:38 -04:00
Julia
b8876f2b17 Preparse documentation markdown when resolving completion 2023-10-06 13:26:38 -04:00
Julia
fe62423344 Asynchronously request completion documentation if not present 2023-10-06 13:26:38 -04:00
Julia
77ba25328c Most of getting completion documentation resolved & cached MD parsing 2023-10-06 13:26:38 -04:00
Julia
ca88717f0c Make completion docs scrollable 2023-10-06 13:26:38 -04:00
Julia
e8be14e5d6 Merge info popover's and autocomplete docs' markdown rendering 2023-10-06 13:26:38 -04:00
Julia
370a3cafd0 Add markdown rendering to alongside completion docs 2023-10-06 13:26:38 -04:00
Julia
1584dae9c2 Actually display the correct completion's doc 2023-10-06 13:26:38 -04:00
Julia
e802c072f7 Start hacking in autocomplete docs 2023-10-06 13:26:38 -04:00
Conrad Irwin
2d99b327fc Don't wrap on paragraphs
For zed-industries/community#2116
2023-10-06 10:32:15 -06:00
Mikayla Maki
37de4a9990
Add markdown parsing to channel chat (#3088)
TODO:
- [x] Add markdown rendering to channel chat
- [x] Unify (?) rendering logic between hover popover and chat
- [x] ~~Determine how to deal with document-oriented markdown like `#`~~
Unimportant until we want to do something special with `#channel`
- [x] Tidy up spacing and styles in chat panel

Release Notes:

- Added markdown rendering to channel chat
- Improved channel chat message style
- Fixed a bug where long chat messages would not soft wrap
2023-10-05 14:30:12 -07:00
Mikayla
c4870e1b6b
re-unify markdown parsing between hover_popover and chat 2023-10-05 14:22:41 -07:00
Conrad Irwin
f1c743286d Clear SelectionGoal on input 2023-10-05 09:02:52 -06:00
Julia
3d68fcad0b Detach completion confirmation task when selecting with mouse
Otherwise the spawn to resolve the additional edits never runs causing
autocomplete to never add imports automatically when clicking with the
mouse
2023-10-02 13:18:49 -04:00
Max Brunsfeld
a8b35eb8f5 Merge branch 'main' into allow-following-outside-of-projects 2023-09-28 11:58:28 -07:00
Max Brunsfeld
0c95e5a6ca Fix coloring of local selections when following
Co-authored-by: Conrad <conrad@zed.dev>
2023-09-28 11:37:47 -07:00
Max Brunsfeld
0f39b63801 Rename color_index to participant_index
Co-authored-by: Conrad <conrad@zed.dev>
2023-09-28 11:37:22 -07:00
Max Brunsfeld
545b5e0161 Assign unique color indices to room participants, use those instead of replica_ids
Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Antonio <antonio@zed.dev>
2023-09-28 11:06:09 -07:00
Joseph T. Lyons
3cf7164a54
Fix text transformation commands for multiple line, single selection cases (#3060)
If you highlight the following block of text (with a single selection):

```
The quick brown
fox jumps over
the lazy dog
```

and run `editor: convert to upper camel case`, you'll get:

```
TheQuickBrown
foxJumpsOver
theLazyDog
```

instead of:

```
TheQuickBrown
FoxJumpsOver
TheLazyDog
```

The same thing happens for `editor: convert to title case`. This happens
because [`to_case` crate](https://crates.io/crates/convert_case) doesn't
allow the user to define '\n' as a boundary. I wanted to fix this at the
lib level, so I filled [an
issue](https://github.com/rutrum/convert-case/issues/16) but I never
heard back. What's strange is VS Code and Sublime I think both exhibit
the same output as we do currently, but I don't personally think this
feels right (happy to hear opposing opinions). I'm just doing the naive
thing to hack around this limitation of the `to_case` crate.

I did some testing and it seems I only need to adjust `editor: convert
to title case` and `editor: convert to upper camel case`. The way the
other transformations are implemented in `to_case` don't seem to have
this issue.

Release Notes:

- Fixed a bug where running certain text transfomration commands on a
single selection covering multiple lines would not transform all
selected lines as expected.
2023-09-28 14:04:17 -04:00
Conrad Irwin
c63cc78ffd
vim: Fix ctrl-u/ctrl-d (#3044)
- vim: Fix ctrl-d/ctrl-u to match vim (when :set scrolloff=3)
2023-09-27 07:48:50 -06:00
Conrad Irwin
8e1bbf32be vim: Fix ctrl-u/ctrl-d
They should work by exactly half a screen, and also move the cursor.
2023-09-26 22:28:04 -06:00
Kirill Bulatov
7e2cef98a7 Hide inlay hints toggle if they are not supported by the current editor 2023-09-26 23:52:11 +02:00
Piotr Osiewicz
8c47f117db
editor: Start transaction in replace impl (#3036)
This fixes the undo with replace in project
/cc @maxbrunsfeld 

Release Notes:

- N/A
2023-09-26 19:21:15 +02:00
Conrad Irwin
d17d38fe70
vim: Command (#2951)
Release Notes:

- vim: Add v1 of command mode
([#279](https://github.com/zed-industries/community/issues/279)). The
goal was to cover 90% of what most people actually do, but it is very
incomplete. Known omissions are that ranges cannot be specified (except
that `:%s//` must always specify the % range), commands cannot take
arguments (you can `:w` but not `:w [file]`), and there is no history.
Please file feature requests on
https://github.com/zed-industries/community as you notice things that
could be better.
- `:` triggers zed's command palette. If you type a known vim command it
will run it, otherwise you get zed's normal fuzzy search. For this
release supported commands are limited to:
- - `:w[rite][!]`, `:wq[!]`, `:q[uit][!]`, `:wa[ll][!]`, `:wqa[ll][!]`,
`:qa[ll][!]`, `:[e]x[it][!]`, `:up[date]` to save/close tab(s) and
pane(s).
- - `:cq` to quit completely.
- - `:vs[plit]`, `:sp[lit]` to split vertically/horizontally
- - `:new`, `:vne[w]` to create a new file in a new pane above or to the
left
- - `:tabedit`, `:tabnew` to create a new file in a new tab.
- - `:tabn[ext]`, `:tabp[rev]` to go to previous/next tabs
- - `:tabc[lose]` to close tabs
- - `:cn[ext]`, `:cp[rev]`, `:ln[ext]`, `:lp[rev]` to go to the
next/prev diagnostics.
- - `:cc`, `:ll` to open the errors page
- - `:<number>` to jump to a line number.
- - `:$` to jump to end of file
- - `:%s/foo/bar/` (note that /g is always implied, the range must
always be %, and zed uses different regex syntax to vim)
- - `:/foo` and `:?foo` to jump to next/prev line matching foo
- - `:j[oin]`, to join the current line (no range is yet supported)
- - `:d[elete][l][p]`, to delete the current line (no range is yet
supported)
- - `:s[ort] [i]` to sort the current selection (case-insensitively)
- vim: Add `ctrl-w o` (closes everything except the current item) and
`ctrl-w n` (creates a new file in the pane above).
([#1884](https://github.com/zed-industries/community/issues/1884))
- all: Add a "Discard" option to prompt when saving a file with
conflicts (previously this only appeared on close, not on save).

Internal changes:
- The Picker will now wait for pending queries before confirming (to
handle people typing `: w enter` rapidly.
- workspace::save_item and Pane::save_item are now merged together, and
the behavior controlled by `workspace::SaveIntent`.
- Many actions related to closing/saving items now take an optional
`SaveIntent`.
-
2023-09-25 14:07:22 -05:00
Conrad Irwin
769c330b3d Merge branch 'vim-command' 2023-09-25 11:41:13 -06:00
Julia
80eaabd360 Activate correct item when clicking on a code action with the mouse 2023-09-25 13:31:00 -04:00
Julia
a278428bd5 Trigger scroll_to on code action list when moving selection 2023-09-25 11:13:50 -04:00
Kirill Bulatov
afa7045847 Tone down inlay hint update logs 2023-09-22 17:04:11 +03:00
Max Brunsfeld
4ffa167256 Allow following into channel notes regardless of project 2023-09-21 17:12:59 -07:00
Piotr Osiewicz
dbfa1d7263
[WIP] Replace in project (#2984)
Targeting Preview of 09.27.
This is still pending several touchups/clearups:
- We should watch multibuffer for changes and rescan the excerpts. This
should also update match count.
- Closing editor while multibuffer with 100's of changed files is open
leads to us prompting for save once per each file in the multibuffer.
One could in theory save in multibuffer before closing it (thus avoiding
unnecessary prompts), but it'd be cool to be able to "Save all"/"Discard
All".

Release Notes:

- Added "Replace in project" functionality
2023-09-21 16:27:58 +02:00
Conrad Irwin
6ad1f19a21 Add NewFileInDirection 2023-09-20 20:44:26 -06:00
Conrad Irwin
a4f96e6452 tests: wait deterministically after simulating_keystrokes 2023-09-20 20:44:26 -06:00
Mikayla
fe10875285
Fix panic on select all when query is empty 2023-09-20 17:10:23 -07:00
Mikayla
fdf5278bbf
Only autoscroll on select_next operations 2023-09-20 09:31:12 -07:00
Mikayla
8cc7a02390
Fix rebase 2023-09-20 08:34:18 -07:00
Mikayla
03d4191685
Fix infinite loop in select all matches 2023-09-20 08:25:21 -07:00
Mikayla
c074bfd441
Add select all command to the editor, equivalent to hitting cmd-d as many times as possible 2023-09-20 08:25:20 -07:00
Conrad Irwin
5bb8ba5028 Initialize workspace properly in tests
For vim command I'd like to be able to test that e.g. workspace::Save
works.
2023-09-19 20:49:29 -06:00
Piotr Osiewicz
616d328f3c
chore: Use aho-corasick 1.1 in direct dependencies (#2983)
Nothing too fancy, we've depended indirectly on 1.0/1.1 already, so this
is essentially bookkeeping.

Release Notes:
- N/A
2023-09-18 17:01:08 +02:00
Nate Butler
24974ee2fa Unify icons using multiple variants, remove all unused icons 2023-09-15 12:50:49 -04:00
Kirill Bulatov
8c1df5afa2 Empty both hint cache storages correctly 2023-09-15 10:33:32 +03:00
Kirill Bulatov
e7b5880af0 Combine both text and inlay highlights in randomized tests 2023-09-14 23:53:56 +03:00
Kirill Bulatov
f9b70718ac Store hints in the map, not the snapshot 2023-09-14 23:36:33 +03:00
Kirill Bulatov
4e9f0adcef Improve inlay hint cache lookup 2023-09-14 23:31:50 +03:00
Kirill Bulatov
8ae3f79235 Restructure inlay highlights data for proper access 2023-09-14 23:05:22 +03:00
Kirill Bulatov
9b43acfc88 Remove useless background highlights code 2023-09-14 22:18:30 +03:00
Kirill Bulatov
396efec6e1 Uncomment the rest of the tests 2023-09-14 22:18:26 +03:00
Kirill Bulatov
47e0535f1c Randomize inlay highlight range start 2023-09-14 22:08:12 +03:00
Kirill Bulatov
129fb62182 Consider offsets in inlay chunks 2023-09-14 22:08:12 +03:00
Kirill Bulatov
a9de6c3dba Properly handle inlay highlights in the InlayMap
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-09-14 22:08:12 +03:00
Kirill Bulatov
80b96eb05b Add inlay highlight test 2023-09-14 22:08:12 +03:00
Kirill Bulatov
42bd2be2f3 Implement inlay highlighting 2023-09-14 22:08:12 +03:00
Kirill Bulatov
890a587254 Use standalone inlay background highlights 2023-09-14 22:08:12 +03:00
Kirill Bulatov
9f5314e938 Unify highlights in *Map 2023-09-14 22:08:12 +03:00
Kirill Bulatov
6c00cd8a35 Do not combine inlay and text highlights on the *Map level 2023-09-14 22:08:12 +03:00
Piotr Osiewicz
1eb74acb3e
editor: Do not run brace completion on empty text. (#2965)
Users of keyboard layout with IME complained about the peculiar
behaviour where typing in "sss" and then removing all of it left behind
one 's' and also appended a closing brace. This was not reproducible on
a buffer without language, so I've suspected that brace insertion might
be a problem here. For whatever reason when the user removes the last
character from a run that triggered IME, we receive a notification about
an empty insertion. Sadly, brace completion does not handle an empty
input properly and we erroneously insert a closing brace when deleting
the followup characters. In fact, the brace inserted is always the
closing brace for the first entry in language's config.toml 'brackets'
field (see Scheme vs Markdown). This guard also allows for the proper
removal of the first character.

Closes community tickets zed-industries/community#877
zed-industries/community#1329

Z-2869

Release Notes:
- Fixed handling of bracket completion for international keyboard
layouts that use IME. This led to Zed erroneously inserting the `}`
character while removing the first character that triggered IME.
2023-09-14 20:24:21 +02:00
Antonio Scandurra
70c9b8f8fd Merge remote-tracking branch 'origin/main' into polish-codegen 2023-09-13 11:41:32 +02:00
Piotr Osiewicz
4cb8647702
Z 1200/replace in buffer (#2922)
This is still WIP, mostly pending styling. I added a pretty rudimentary
text field and no buttons whatsoever other than that. I am targeting a
Preview of 09.13, as I am gonna be on PTO for the next week.

I dislike the current implementation slightly because of `regex`'s crate
syntax and lack of support of backreferences. What strikes me as odd wrt
to syntax is that it will just replace a capture name with empty string
if that capture is missing from the regex. While this is perfectly fine
behaviour for conditionally-matched capture groups (e.g. `(foo)?`), I
think it should still error out if there's no group with a given name
(conditional or not).
Release Notes:

- Added "Replace" functionality to buffer search.
2023-09-12 18:46:54 +02:00
Nathan Sobo
e0fdc7d0aa Eliminate PaintContext 2023-09-11 09:00:59 -06:00
Nathan Sobo
a24d94cfda Eliminate LayoutContext 2023-09-11 08:47:00 -06:00
Antonio Scandurra
02078140c0 Extract code generation logic into its own module 2023-09-11 11:25:37 +02:00
Nathan Sobo
ebf8b32811 Checkpoint 2023-09-08 16:25:10 -06:00
Nathan Sobo
362b1a44be Merge branch 'main' into storybook 2023-09-08 14:18:44 -06:00
Nathan Sobo
53a50b8df4 Move refreshing to window 2023-09-08 13:27:29 -06:00
Conrad Irwin
5d782b6cf0
vim . to replay (#2936)
Release Notes:

- vim: Add `.` to replay
([#946](https://github.com/zed-industries/community/issues/946))
- vim: Fix `J` in visual mode, and with counts.
2023-09-08 11:52:35 -06:00
Conrad Irwin
5f897f45a8 Fix f,t on soft-wrapped lines
Also remove the (dangerously confusing) display_map.find_while
2023-09-08 10:16:46 -06:00
Conrad Irwin
1b1d7f22cc Add visual area repeating 2023-09-07 10:45:38 -06:00
Nathan Sobo
37ef28a3bf Merge branch 'main' into storybook 2023-09-07 07:56:57 -06:00
Nathan Sobo
5a778fbde6 Checkpoint 2023-09-06 14:16:15 -06:00
Conrad Irwin
20f98e4d17 vim . to replay
Co-Authored-By: maxbrunsfeld@gmail.com
2023-09-06 13:49:55 -06:00
Conrad Irwin
56db21d54b Split ContextMenu actions
This should have no user-visible impact.

For vim `.` to repeat it's important that actions are replayable.
Currently editor::MoveDown *sometimes* moves the cursor down, and
*sometimes* selects the next completion.

For replay we need to be able to separate the two.
2023-09-02 21:04:19 -06:00
Conrad Irwin
aa7b65bbaf Merge branch 'main' into vim-softwrap-word 2023-09-01 12:23:56 -06:00
Conrad Irwin
6d7949654b Fix accidental visual selection on scroll
As part of this fix partial page distance calculations to more closely
match vim.
2023-09-01 11:14:27 -06:00
Nathan Sobo
2fa9c037c8 Merge remote-tracking branch 'origin' into storybook 2023-09-01 10:08:48 -06:00
Kirill Bulatov
5bc5831032 Fix wrong assertion in the test 2023-08-31 14:31:43 +03:00
Kirill Bulatov
fff385a585 Fix project tests 2023-08-31 13:01:53 +03:00
Julia
ff3865a4ad Merge branch 'main' into multi-server-completions-tailwind 2023-08-30 22:58:37 -04:00
Max Brunsfeld
e0bdd857f1 Fix cursor colors of non-followed collaborators
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-08-30 14:14:18 -07:00
Antonio Scandurra
ea17d1638e
Introduce code generation (#2901)
![CleanShot 2023-08-28 at 12 24
36@2x](https://github.com/zed-industries/zed/assets/482957/f97cb399-1ac2-4fa9-94a7-137d1eec711c)


Release Notes:

- Added a new "Inline Assist" feature that lets you transform a
selection or generate new code at the cursor location by hitting
`ctrl-enter`.
2023-08-30 14:58:22 +02:00
Nathan Sobo
48d3e2d9b9 Move views_to_notify_if_ancestors_change to Window 2023-08-29 21:58:44 -06:00
Nathan Sobo
2e7356a53e Store new_parents on Window instead of layout context 2023-08-29 21:43:48 -06:00
Conrad Irwin
d3650594c3 Fix find_{,preceding}boundary to work on buffer text
Before this change the bounday could mistakenly have happened on a soft
line wrap.

Also fixes interaction with inlays better.
2023-08-29 18:03:29 -07:00
Kirill Bulatov
100870aa9c Do not blink the cursor if Zed window is focused away
co-authored-by: Max <max@zed.dev>
2023-08-29 21:33:03 +03:00
Conrad Irwin
dd577074f2
vim: Fix relative motions (#2888)
This changes vim motions to be relative to fold lines, not display
lines, to match the behaviour of vim.

This is necessary for relative line numbers to make sense (as the most
important thing is you can do `3j` to get th e line that is numbered 3).


Release Notes:

- vim: Fix handling of motions when `soft_wrap` is enabled in zed. Like
in vim `j,k,up,down,$,^,0,home,end` will all now navigate in file
coordinates not display coordinates.
- vim: Add `g {j,k,up,down,$,^,0,home,end}` to navigate in display
coordinates.
- vim: Add `z o` and `z c` to open and close folds.
- vim: Add `z f` in visual mode to fold selection.

Note: this may be a jarring change if you're grown used to the current
behaviour of `j` and `k`. You can make the issue less acute by setting
`"soft_wrap":"none"` in your settings; or you can manually copy the
bindings for `g j` to the binding for `j` (etc.) in your keymap.json to
preserve the existing behaviour.
2023-08-29 11:19:37 -07:00
Julia
15628af04b Style language server name in completion menu
Omit in buffers with one or zero running language servers with the
capability to provide completions

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-08-29 11:21:02 -04:00
Max Brunsfeld
791f6cf9e7 Update some tests to reflect code action debouncing 2023-08-28 17:45:32 -07:00
Max Brunsfeld
89eab78cf7 Debounce document highlight and code actions requests 2023-08-28 15:48:55 -07:00
Julia
ded6decb29 Initial unstyled language server short name in completions
Co-Authored-By: Kirill Bulatov <kirill@zed.dev>
2023-08-28 11:27:45 -04:00
Antonio Scandurra
52e1e014ad Allow redoing edits performed by inline assistant after cancelling it 2023-08-28 14:42:52 +02:00
Antonio Scandurra
8c4d2ccf80 Close inline assist when the associated transaction is undone 2023-08-28 14:23:42 +02:00
Antonio Scandurra
44f554f489 Merge remote-tracking branch 'origin/main' into ai-refactoring 2023-08-28 12:16:24 +02:00
Piotr Osiewicz
07b9c6c302
language: Make Buffer::new take an explicit ID (#2900)
See Linear description for the full explanation of the issue. This PR is
mostly a mechanical change, except for the one case where we do pass in
an explicit `next_id` instead of `model_id` in project.rs.

Release Notes:
- Fixed a bug where some results were not reported in project search in
presence of unnamed buffers.
2023-08-28 11:51:50 +02:00
Kirill Bulatov
38da2a587a Fix the tests 2023-08-27 19:41:15 +03:00
Kirill Bulatov
81e70905bb Do not allow cmd+click in invalid inlay context 2023-08-27 19:12:32 +03:00
Kirill Bulatov
693e91f335 Properly compare previous hover trigger point when hover changes 2023-08-27 18:23:40 +03:00
Kirill Bulatov
dad64edde1 Better highlight hint ranges 2023-08-27 15:14:45 +03:00
Kirill Bulatov
5cf51211b6 Use better names, simplify 2023-08-27 00:01:31 +03:00
Kirill Bulatov
73937876b6 Properly omit throttled hint queries 2023-08-26 21:12:04 +03:00
Kirill Bulatov
f8a8b998ce Properly react on excerpts drop 2023-08-26 15:21:45 +03:00
Kirill Bulatov
84284099e2 Properly handle padding when highlighting inlay hints 2023-08-26 15:04:48 +03:00
Kirill Bulatov
2a42a08f46 Invalidate skipped throttled hint fetch tasks' ranges 2023-08-26 14:47:42 +03:00
Kirill Bulatov
9bdf76f445 Properly handle hover-less areas hover 2023-08-26 14:42:20 +03:00
Kirill Bulatov
48659d3b3c Treat multibuffer edit events properly
Miltibuffer emits edit events even if it only got an excerpt
added/removed/etc.
Separate buffer edits and trigger hint invalidation refresh for them
only, also trigger hint new lines refresh on excerpt addition events.
2023-08-26 14:13:24 +03:00
Kirill Bulatov
3fc48fc277 Log LSP inlay hint path 2023-08-26 13:46:55 +03:00
Antonio Scandurra
55bf45d265 Add disabled style for prompt editor after confirming 2023-08-26 12:07:03 +02:00
Kirill Bulatov
e6fb909d89 Limit LSP non-invalidating queries 2023-08-26 13:06:50 +03:00
Antonio Scandurra
658d616b96 Allow multiple inline assistant highlights at once 2023-08-26 11:55:47 +02:00
Kirill Bulatov
2b007930a9 Remove query ranges for failed inlay hint requests 2023-08-26 12:09:12 +03:00
Kirill Bulatov
81c64647e8 Fix the test 2023-08-26 03:00:53 +03:00
Kirill Bulatov
e6c4802488 Properly clip request offsets 2023-08-26 02:54:50 +03:00
Kirill Bulatov
b2b0918790 Consider padding during hint highlight range mapping 2023-08-26 02:45:08 +03:00
Kirill Bulatov
665d86ea73 Defer navigation target buffer opening 2023-08-26 02:45:08 +03:00
Kirill Bulatov
ddd7ab116f Do not convert lsp::Location of hint labels before resolve 2023-08-26 02:45:08 +03:00
Max Brunsfeld
d6ffb68305
Fix bugs in autoscroll with 'fit' strategy (#2893)
This fixes a bug where text moved up and down by one pixel in the buffer
search query editor, while typing.

Release  notes:
* Fixed a bug where editors didn't auto-scroll when typing if all
cursors could not fit within the viewport.
2023-08-25 16:36:33 -07:00
Piotr Osiewicz
2495d6581e
Un serialize project search (#2857)
This is the first batch of improvements to current project search. There
are few things we can do better still, but I want to get this out in
next Preview.
Most of the slowness at this point seems to stem from updating UI too
often.

Release Notes:
- Improved project search by making it report results sooner.

---------

Co-authored-by: Julia Risley <julia@zed.dev>
2023-08-26 01:31:52 +02:00
Max Brunsfeld
a3b2c03b17 Fix bugs in autoscroll with 'fit' strategy
* Scroll to the newest cursor if all cursors can't fit in the viewport.
* Refuse to layout an editor less tall than one line height.

Co-authored-by: Nathan <nathan@zed.dev>
2023-08-25 16:13:12 -07:00
Julia
fc457d45f5 Add word_characters to language overrides & use for more things
Use word_characters to feed completion trigger characters as well and
also recognize kebab as a potential sub-word splitter. This is fine for
non-kebab-case languages because we'd only ever attempt to split a word
with a kebab in it in language scopes which are kebab-cased

Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-08-25 18:46:30 -04:00
Conrad Irwin
20aa2a4c54 vim: Fix relative line motion
Before this change up and down were in display co-ordinates, after this
change they are in fold coordinates (which matches the vim behaviour).

To make this work without causing usabliity problems, a bunch of extra
keyboard shortcuts now work:

- vim: `z {o,c}` to open,close a fold
- vim: `z f` to fold current visual selection
- vim: `g {j,k,up,down}` to move up/down a display line
- vim: `g {0,^,$,home,end}` to get to start/end of a display line

Fixes: zed-industries/community#1562
2023-08-25 14:40:04 -06:00
Conrad Irwin
bde67b2b9c Fix merge-conflict 2023-08-25 11:59:16 -06:00
Conrad Irwin
f18cdcba54 Fix relative line numbers in vim visual mode
In visual mode when your selection ends with a newline we show the
cursor at the end of the previous line (not the start of the current
line). We had only been accounting for this if the cursor was on-screen.
2023-08-25 11:50:41 -06:00
Conrad Irwin
8d5dc266a3 Fix relative line numbers when newest cursor offscreen 2023-08-25 11:50:41 -06:00
Conrad Irwin
790aa5d476 Add relative_line_mode
Co-Authored-By: joseph@zed.dev
2023-08-25 11:50:41 -06:00
Max Brunsfeld
404f76739c Format let-else statements 2023-08-25 10:11:32 -07:00
Kirill Bulatov
44c340b5f2 Properly invalidate the hint cache 2023-08-25 17:33:17 +03:00
Kirill Bulatov
2b95f0580e Fix the tests 2023-08-25 16:25:43 +03:00
Kirill Bulatov
c10c3e2b54 Only invalidate when doing first, visible range query 2023-08-25 15:16:55 +03:00
Kirill Bulatov
a63e1571dc Defer querying inlay hints for invisible editor ranges
This way, only the visible part gets frequently queried on typing (and
hint /refresh requests that follow), with queries for invisible ranges
cancelled eagerly.
2023-08-25 15:16:55 +03:00
Kirill Bulatov
0a18aa694f Use stricter inlay range checks to avoid stuck highlights
Often, hint ranges are separated by a single '<` char as in
`Option<Vec<u32>>`. When moving the caret from left to right, avoid
inclusive ranges to faster update the matching hint underline.
2023-08-25 14:46:39 +03:00
Antonio Scandurra
27c90f12f6 Merge remote-tracking branch 'origin/main' into ai-refactoring 2023-08-25 13:37:32 +02:00
Kirill Bulatov
e44516cc6c Add hover tests 2023-08-25 14:26:17 +03:00
Kirill Bulatov
f19c659ed6 Add link_go_to_definition test for inlays 2023-08-25 14:26:17 +03:00
Kirill Bulatov
abd2d012b1 Properly binary search cached inlay hints 2023-08-25 14:26:17 +03:00
Kirill Bulatov
3c55c933d4 Be more lenient with hint resolution, always return some hint 2023-08-25 14:26:17 +03:00
Kirill Bulatov
852427e87b Use inlay highlights in randomized tests 2023-08-25 14:26:17 +03:00
Kirill Bulatov
7cd60d6afb Simplify and restore client resolve capabilities 2023-08-25 14:26:17 +03:00
Kirill Bulatov
dcf570bb03 Fix resolve status conversion 2023-08-25 14:26:17 +03:00
Kirill Bulatov
bcaff0a18a Propagate inlay background highlights to data storage 2023-08-25 14:26:17 +03:00
Kirill Bulatov
4b78678923 Prepare background highlights for inlay highlights 2023-08-25 14:26:17 +03:00
Kirill Bulatov
12ffbe54fb Unify text and inlay highlights 2023-08-25 14:26:17 +03:00
Kirill Bulatov
420f8b7b15 Prepare for inlay and text highlight unification 2023-08-25 14:26:17 +03:00
Kirill Bulatov
4cc9f2f525 Highlight inlay hint parts on cmd-hover
Co-Authored-By: Antonio <antonio@zed.dev>
2023-08-25 14:26:17 +03:00
Kirill Bulatov
f8874a726c Attempt to highlight inlays 2023-08-25 14:26:17 +03:00
Kirill Bulatov
6c5761d05b Pass inlay highlight information 2023-08-25 14:26:17 +03:00
Kirill Bulatov
477fc865f5 Properly resolve inlay label parts' locations and buffers 2023-08-25 14:26:17 +03:00
Kirill Bulatov
7eab18ec89 Pass inlay go to definition data 2023-08-25 14:26:17 +03:00
Kirill Bulatov
ac86bbac75 Prepare for hover functionality refactoring 2023-08-25 14:26:17 +03:00
Kirill Bulatov
80e8714241 Send inlay hint resolve requests 2023-08-25 14:26:17 +03:00
Kirill Bulatov
3434990b70 Store inlay hint resolve data 2023-08-25 14:26:17 +03:00
Kirill Bulatov
d1cb0b3c27 Properly detect hovered inlay hint label part 2023-08-25 14:26:17 +03:00
Kirill Bulatov
d34491e822 Draft inlay hint part hover detection 2023-08-25 14:26:17 +03:00
Antonio Scandurra
66a496edd7 Allow generating code without editing it 2023-08-25 12:16:28 +02:00
Antonio Scandurra
c1bd035875 Rework inline assistant 2023-08-25 11:39:27 +02:00
Max Brunsfeld
a95dcfa8bc Make channel notes view searchable and navigable via pane history
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-08-24 17:18:18 -07:00
Max Brunsfeld
24141c2f16 Ensure collaborators cursor colors are the same in channel buffers as in projects
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-08-24 11:31:41 -07:00
Mikayla
199be8241c
Add following into channel notes
co-authored-by: max <max@zed.dev>
2023-08-24 11:25:20 -07:00
Antonio Scandurra
71a5964c18 Rename merge_transaction_into to merge_transactions 2023-08-24 14:26:42 +02:00
Max Brunsfeld
7e83138805
Start work on showing consistent replica ids for channel buffers
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-08-23 18:37:01 -07:00
Antonio Scandurra
e4f49746e1 Group modal assistant edits into the same transaction
Co-Authored-By: Kyle Caverly <kyle@zed.dev>
2023-08-23 17:09:15 +02:00
Nathan Sobo
1bc4f22373
Rework element system, phase 1 (#2881)
This is a deep cut. There's still more work to do until we start
building UI with this. I've approached this as additively as possible,
but I've made a few changes to the rest of the code that I think would
be good to upstream before proceeding too much further.

Most of the interesting pieces are in gpui/playground, which is a
standalone binary that opens a single window and renders a new kind of
element. The layout of these new elements is provided by the taffy
layout engine crate, which conforms to web conventions. The idea is that
playground is relatively cheap to build and work on. As concepts
coalesce in playground, we can drop them into gpui and start
transitioning.
2023-08-23 08:26:38 -06:00
Nathan Sobo
d375f7992d Merge branch 'main' into divs 2023-08-22 16:35:56 -06:00
Conrad Irwin
27ba77b16f Ensure editor clipboard contains \n too 2023-08-22 13:52:04 -06:00
Conrad Irwin
33d7fe02ee Rewrite paste
- vim: support P for paste before
- vim: support P in visual mode for paste without overriding clipboard
- vim: fix position when using `p` on text copied outside zed
- vim: fix indentation when using `p` on text copied from zed
2023-08-22 13:27:57 -06:00
Piotr Osiewicz
ccb3f6748c chore: fmt 2023-08-22 18:14:07 +02:00
Piotr Osiewicz
ccb9b5d278 Query char_kind for completion triggers.
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2023-08-22 18:12:05 +02:00
Piotr Osiewicz
007d1b09ac Z 2819 (#2872)
This PR adds new config option to language config called
`word_boundaries` that controls which characters should be recognised as
word boundary for a given language. This will improve our UX for
languages such as PHP and Tailwind.

Release Notes:

- Improved completions for PHP
[#1820](https://github.com/zed-industries/community/issues/1820)

---------

Co-authored-by: Julia Risley <julia@zed.dev>
2023-08-22 12:23:30 +03:00
Piotr Osiewicz
d27cebd977
Z 2819 (#2872)
This PR adds new config option to language config called
`word_boundaries` that controls which characters should be recognised as
word boundary for a given language. This will improve our UX for
languages such as PHP and Tailwind.

Release Notes:

- Improved completions for PHP
[#1820](https://github.com/zed-industries/community/issues/1820)

---------

Co-authored-by: Julia Risley <julia@zed.dev>
2023-08-22 10:35:20 +02:00
Conrad Irwin
168a213a44 Add test for word characters in vim 2023-08-21 22:37:14 -06:00
Piotr Osiewicz
42b0c5dfdd Remove comment;for real now 2023-08-22 01:04:55 +02:00
Piotr Osiewicz
bca2d02a61 Revert "Remove dead comment"
This reverts commit 046759a366.
2023-08-22 01:04:15 +02:00
Piotr Osiewicz
046759a366 Remove dead comment 2023-08-22 01:01:27 +02:00
Piotr Osiewicz
6137d88a54 Merge branch 'main' into Z-2819 2023-08-21 17:41:27 +02:00
Piotr Osiewicz
ab5bd0ac5a Use new char_kind (parameterized by language) 2023-08-21 17:39:38 +02:00
Piotr Osiewicz
3e8522b5f2 WIP: Saved state from Friday.
Co-authored-by: Julia Risley <julia@zed.dev>
2023-08-21 17:09:03 +02:00
Max Brunsfeld
1c46749ad7 Fix regression in Buffer::language_scope_at
Co-authored-by: Julia <julia@zed.dev>
2023-08-18 12:58:09 -07:00
Conrad Irwin
e3c0e93e46 Fix cursor adjustment on scroll
Fixes: zed-industries/community#1929

Also preserves visual modes correctly.
2023-08-18 11:23:43 -06:00
Conrad Irwin
d1aa82bb48
vim visual block (#2849)
Release notes:

- vim: add Visual Block mode
([#984](https://github.com/zed-industries/community/issues/984)),
([#1415](https://github.com/zed-industries/community/issues/1415)).
- vim: add support for `a<object>` and `i<object>` in visual modes
- vim: fix scroll shortcuts (`ctrl-{f,b,d,u,e,y}`) in visual modes
- allow `shift-enter` to type a newline.
2023-08-18 09:55:40 -06:00
Kirill Bulatov
269dad5a9c Respect completion resolve server capabilities
Only query for additional edits if the server supports it

Co-Authored-By: Julia Risley <julia@zed.dev>
2023-08-18 16:55:47 +03:00
Conrad Irwin
7598030102 Tidy-up 2023-08-16 22:29:28 -06:00
Kirill Bulatov
7334bdccbf Better multibuffer tests 2023-08-16 23:38:11 +03:00
Kirill Bulatov
f9131f657e Use InlayHint instead of Inlay where appropriate 2023-08-16 23:38:11 +03:00
Kirill Bulatov
9c6135f47a Test hints toggle 2023-08-16 23:38:11 +03:00
Kirill Bulatov
0f650acc23 Repaint inlays icon on inlays cache disabling/enabling
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2023-08-16 23:38:11 +03:00
Kirill Bulatov
0b93e490a5 Improve toggle UI, fix inlays update speed 2023-08-16 23:38:11 +03:00
Kirill Bulatov
5c3d563f0f Draft quick actions bar 2023-08-16 23:38:11 +03:00
Conrad Irwin
7f06191c9f Disable autoindent in visual block insert mode 2023-08-16 10:44:59 -06:00
Conrad Irwin
1b4dd49b1d Vim visual block mode
This isn't quite an exact emulation, as instead of using one selection
that is magically in "column mode", we emulate it with a bunch of zed
multi-selections (one per line).

I think this is better, as it requires fewer changes to the codebase,
and lets you see the impact of any changes immediately on all lines.

Fixes: zed-industries/community#984
2023-08-15 16:00:50 -06:00
Conrad Irwin
404b1aa65a
Fix vim selection to include entire range (#2787)
Update vim mode to have vim selection and editor selections match.
Before this we had to adjust between vim selections and real selections
when making changes; now we have to adjust when making selections.

Release Notes:

- vim: Ensure editor selection matches the vim selection
([#1796](https://github.com/zed-industries/community/issues/1796)).
- vim: Fix `s` in visual line mode
- vim: Add `o` and `shift-o` to toggle direction of visual selection
- vim: Fix `v` and `shift-v` to toggle back to normal mode
- vim: Fix block selections like `vi}` to contain correct whitespace
2023-08-15 08:36:17 -06:00
Mikayla Maki
22da42fc69
Add components example (#2846)
This PR is a continuation of the components UI exploration I've been
doing. It adds an example to the GPUI examples page and totally
restructures the generics on our MouseEventHandler.

Release Note:
- N/A
2023-08-15 03:17:50 -07:00
Mikayla
e5eed29c72
Add components example
Re-arrange generics on mouse event handler
Add TypeTag struct for dynamically tagged components
2023-08-15 03:06:43 -07:00
Conrad Irwin
fb90eada70 Merge branch 'main' into vim-visual-selection 2023-08-14 15:29:33 -06:00
Conrad Irwin
5b37cdcb04 Better tests 2023-08-14 15:03:16 -06:00
Nathan Sobo
740b105330 Merge branch 'main' into taffy
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2023-08-14 13:50:21 -06:00
Kirill Bulatov
e0d011e354 Better assert multibuffer edit test results 2023-08-14 20:12:35 +03:00
Kirill Bulatov
4b3273182a Do not filter out hints to be removed 2023-08-14 19:20:20 +03:00
Kirill Bulatov
336fbb3392 Clip offsets in inlay hint queries 2023-08-14 18:39:30 +03:00
Kirill Bulatov
558367dc8b Optimize query ranges tracking 2023-08-14 16:19:44 +03:00
Kirill Bulatov
87e6651ecb Fix hint tests, add a char boundary bug test 2023-08-14 16:01:02 +03:00
Kirill Bulatov
449c009639 Properly generate ranges to query 2023-08-14 11:25:02 +03:00
Kirill Bulatov
56f89739f8 Do not add duplicate hints to the cache 2023-08-14 11:25:02 +03:00
Kirill Bulatov
0e2a1fc149 Query inlay hints for parts of the file 2023-08-14 11:25:02 +03:00
Kirill Bulatov
708409e06d Query hints on every scroll 2023-08-14 11:25:02 +03:00
Kirill Bulatov
5d2750e0d4 Hide inlay cache fields 2023-08-14 11:25:02 +03:00
Nathan Sobo
65123e6eed Allow individual corner radii on drop shadows 2023-08-12 10:58:08 -06:00
Nathan Sobo
84dc4090bd Wire up per corner radii for quad
Still need to expose this in the styling layer and allow images
to have per corner radii.
2023-08-12 10:40:23 -06:00
Nathan Sobo
5e36040533 Put a Taffy layout engine on window 2023-08-12 00:58:11 -06:00
Piotr Osiewicz
ffffbbea1f
chore: use Cow instead of String for tooltips (#2838)
A QoL change to align `Tooltip` with other elements like `Label`
Release Notes:

- N/A
2023-08-11 15:29:55 +02:00
Nathan Sobo
0bf607cd2d WIP 2023-08-10 10:26:48 -06:00
Nathan Sobo
c95aecdd53 Merge branch 'main' into cells 2023-08-08 21:23:57 -06:00
Nathan Sobo
db96fb1307 Merge remote-tracking branch 'origin/main' into paint-context 2023-08-08 18:27:16 -06:00
Nathan Sobo
54ca5f1d44
Replace context methods that take a window id with methods on window handles (#2832)
With this PR, I've eliminated almost all references to window ids
outside of the internals of GPUI. All public methods taking these ids
are now defined on `AnyWindowHandle`, which provides a more coherent
narrative around windows as a concept.
2023-08-08 17:51:37 -06:00
Piotr Osiewicz
1aff642981 Do not highlgiht selections at all over the threshold 2023-08-08 13:09:27 +02:00
Nathan Sobo
f0da6b05fd Remove TestAppContext::add_view
Instead, we now call this on window handles.
2023-08-07 22:46:48 -06:00
Nathan Sobo
d687c3d81f Merge remote-tracking branch 'origin/main' into window-handles 2023-08-07 22:07:20 -06:00
Nathan Sobo
f2be3181a9 Move window-related methods from TestAppContext to AnyWindowHandle 2023-08-07 20:23:04 -06:00
Nathan Sobo
486f5bc6ca Get compiling 2023-08-07 19:08:58 -06:00
Piotr Osiewicz
371c669e00 Address review feedback.
Rename selected_rows to background_highlight_row_ranges.
Do not return any ranges if there are more than 50k results
2023-08-08 02:47:49 +02:00
Piotr Osiewicz
b0fc6da55b Use display maps 2023-08-08 02:37:27 +02:00
Piotr Osiewicz
241d3951b8 Remove redundant argument 2023-08-08 02:25:30 +02:00
Piotr Osiewicz
42e1221357 Add upper bound limit. Remove dbg! statements 2023-08-08 02:17:11 +02:00
Piotr Osiewicz
fa16895976 Do not query start of range if it's end is the same as the previous hunk's 2023-08-08 00:27:38 +02:00
Piotr Osiewicz
ca21626064 Baseline: Improve selection rendering for large quantities from 270ms to 90ms 2023-08-07 23:32:27 +02:00
Conrad Irwin
19eb280351 Fix selection background too
Refactor code to centralize the logic too
2023-08-07 19:01:04 +01:00
Nathan Sobo
adc50469ff WIP 2023-08-06 12:45:31 -06:00
Joseph T. Lyons
1abb6a0176 Expand empty selections to cover full word and fix bugs 2023-08-05 11:31:21 -04:00
Joseph T. Lyons
12e8f417e4 Add more convert to case commands
ConvertToTitleCase
ConvertToSnakeCase
ConvertToKebabCase
ConvertToUpperCamelCase
ConvertToLowerCamelCase
2023-08-04 22:45:26 -04:00
Joseph T. Lyons
8c98b02e45 Add convert to {upper,lower} case commands
Co-Authored-By: Julia <30666851+ForLoveOfCats@users.noreply.github.com>
2023-08-04 15:10:33 -04:00
Conrad Irwin
22927fa1d7 Fix visual selection cursor in multibuffers 2023-08-04 14:39:16 +01:00
Nathan Sobo
379652f074 Merge branch 'main' into cells 2023-08-03 19:33:04 -06:00
Nathan Sobo
d3c1966d96
WIP: Return WindowHandle<V: View> from AppContext::add_window (#2820)
Instead of returning a usize for the window id, I'm instead returning a
`WindowHandle<V: View>` where `V` is the type of the window's root view.
@as-cii helped me with a cool technique using generic associated types
where methods on `WindowHandle` can return either T or Option<T>
depending on the `BorrowWindowContext::Result` associated type.

Some example usage...

```rs
let window = cx.add_window(|cx| MyView::new(cx));
let my_view = window.root(cx); // If cx is TestAppContext, returns MyView. Otherwise returns Option<MyView>, because the window could be closed.
```


This isn't insanely beneficial on its own, but I think it will help
clean up our testing story. I'm planning on making `window` more useful
in tests for laying out elements, etc.

- [x] Rework tests that call `add_window` 😅 to expect only a window in
return.
- [x] Get tests passing
- [x] 🚬  test
2023-08-03 18:45:51 -06:00
Nathan Sobo
485c0a482e Don't refcount window handles 2023-08-03 17:11:47 -06:00
Nathan Sobo
afcc0d621b WIP 2023-08-03 17:03:39 -06:00
Joseph T. Lyons
ee1b4a52cc
Add PathExt trait (#2823)
This PR adds a `PathExt` trait. It pulls in our existing `compact()`
function, as a method, and then adds a method, and testing, for
`icon_suffix()`. A test was added to fix:

- https://github.com/zed-industries/community/issues/1877

Release Notes:

- Fixed a bug where file icons would not be registered for files with
with `.` characters in their name
([#1877](https://github.com/zed-industries/community/issues/1877)).
2023-08-03 18:57:43 -04:00
Nathan Sobo
884cee6dfd Get tests compiling returning WindowHandle<V: View> from add_window 2023-08-02 14:05:03 -06:00
Max Brunsfeld
a127b0d3e6 Fix warnings surfaced in Rust 1.71 2023-08-02 09:19:23 -07:00
Conrad Irwin
5f6535e92b TEMP 2023-08-02 15:06:46 +01:00
Joseph T. Lyons
eb26fb2d45 Fix variable names 2023-08-01 11:52:53 -04:00
Mikayla Maki
88474a6048
Clip wrap guides from under the scrollbar 2023-07-31 10:54:29 -07:00
Mikayla Maki
d58f031696
disable wrap guides in the assitant panel 2023-07-28 22:27:36 -07:00
Conrad Irwin
645c149344 Fix visual selection of trailing newline 2023-07-28 22:38:39 -06:00
Mikayla Maki
d3b89e16f2
Make wrap guides respect scroll position 2023-07-28 14:56:13 -07:00
Conrad Irwin
9cb0ce7745 Review 2023-07-28 15:36:14 -06:00
Conrad Irwin
5edcb74760 Add support for visual ranges ending with a newline
These primarily happen when first entering visual mode, but can also
be created with objects like `vi{`.

Along the way fix the way ranges like `vi{` are selected to be more
similar to nvim.
2023-07-28 15:26:40 -06:00
Conrad Irwin
b53fb8633e Fix vim selection to include entire range
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2023-07-28 15:26:40 -06:00
Conrad Irwin
5d8370e2a1
Don't highlight project search matches either (#2807)
@JosephTLyons this is probably worth merging alongside #2803

- vim: Fix a bug where focusing project search results unexpectedly
entered visual mode
2023-07-28 12:25:32 -06:00
Conrad Irwin
fac0e2dd56 Don't highlight project search matches either 2023-07-28 12:17:32 -06:00
Conrad Irwin
ade8d4d167
Fix jumping to definition in a new file (#2803)
This is broken because vim currently sets settings only on the active
editor. Fix this by correcting the range on the currently active editor.

It would be nice (at some point) to refactor how vim sets settings, but
that's for another day.

Release Notes:

- vim: Fix bug when jumping to definition in new file accidentally
entered visual mode.
2023-07-27 19:10:01 -06:00
Conrad Irwin
1935307b4f Fix jumping to definition in a new file
This is broken because vim currently sets settings only on the active
editor. Fix this by correcting the range on the currently active editor.

It would be nice (at some point) to refactor how vim sets settings, but
that's for another day.
2023-07-27 18:10:17 -06:00
Mikayla Maki
354c020612
Block extra drag events in original drag handlers 2023-07-26 14:57:46 -07:00
Nathan Sobo
c602d98680 WIP 2023-07-26 13:34:57 -06:00
Nathan Sobo
1b03c5d69c Pass PaintContext to Element::paint
I want to use this on another branch, but it's a sweeping change,
so this prepares the ground for it. This can always be reverted if
it doesn't work out.
2023-07-25 17:32:31 -06:00
Joseph T. Lyons
4085df5146 Add tests for manipulate_lines() 2023-07-25 15:17:16 -04:00
Joseph T. Lyons
bf2ca57f55 Remove { and } from single-line closure 2023-07-25 14:48:11 -04:00
Joseph T. Lyons
93ec73da29 Fix code computing new selections
Co-Authored-By: Mikayla Maki <mikayla.c.maki@gmail.com>
2023-07-25 14:04:25 -04:00
Joseph T. Lyons
299818cde0 Fix rand import and tweak callbacks
Co-Authored-By: Julia <30666851+ForLoveOfCats@users.noreply.github.com>
2023-07-25 11:44:13 -04:00
Joseph T. Lyons
1a84382881 WIP 2023-07-25 10:33:20 -04:00
Kirill Bulatov
c538504b9c Do not scroll when selecting all 2023-07-22 00:17:02 +03:00
Mikayla Maki
05a8409363
bump the brightness of the active wrap guide 2023-07-20 16:45:41 -07:00
Mikayla Maki
a9bfe97361
Add wrap guides and associated settings 2023-07-20 16:39:13 -07:00
Conrad Irwin
372f66c88a
Add workspace::ActivatePaneInDirection (#2757)
This change adds support for choosing a pane based on direction; and
adds default keybindings (`cmd+k cmd+{left,right,up,down}`) and vim
keybindings.

Release Notes:

- Add support for navigating to the next pane in a given direction using
`cmd+k cmd-{up,down,left,right}`
([#476](https://github.com/zed-industries/community/issues/476),
[#478](https://github.com/zed-industries/community/issues/478))
- Vim: adds support for many window related shortcuts: `ctrl-w
{h,j,k,l,up,down,left,right,w,W,p}` for navigating around panes, `ctrl-w
{q,c}` for closing panes and `ctrl-w {v,s}` for splitting panes.
2023-07-20 11:17:13 -06:00
Kirill Bulatov
0237276557 Fully revert the line height change 2023-07-20 15:39:22 +03:00
Kirill Bulatov
0e6048a85d Keep basic line height for single line editors 2023-07-20 13:42:11 +03:00
Conrad Irwin
e1379f0ef0 Add support for activating a pane by direction
Contributes: zed-industries/community#476
Contributes: zed-industries/community#478
2023-07-19 18:29:11 -06:00
Mikayla Maki
cb97f5a69c
fmt 2023-07-19 16:56:49 -07:00
Mikayla Maki
aa67413abc
Raise minimum line height to 1.1
Disable buffer_line_height setting in non-buffer editors
2023-07-19 16:55:28 -07:00
Mikayla Maki
5ceb258b3e
Mute mics by default
Fix bug when file ends in line with 1 more digit displayed than previous lines
Remove stale UI elements from voice call development
2023-07-19 12:34:24 -07:00
Conrad Irwin
98b8008bcc Merge branch 'main' into vim-search 2023-07-19 09:48:25 -06:00
Kirill Bulatov
3058a96dee Clean up stale conflicting hints 2023-07-19 15:29:00 +03:00
Kirill Bulatov
9aeb970f09 Ignore empty hover contents, trim final hover label text 2023-07-18 22:53:44 +03:00
Conrad Irwin
c9bf407431 Avoid optional on select_match 2023-07-17 12:49:59 -06:00
Conrad Irwin
f887a17ffe Merge branch 'main' into vim-search 2023-07-17 09:27:02 -06:00
Alex Viscreanu
c7669317ec
feat(workspace): allow alternative actions to open files and symbols in split
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2023-07-14 21:49:15 +02:00
Kirill Bulatov
cde5b3952d
Select all matches (#2717)
Closes https://github.com/zed-industries/community/issues/75
Closes https://github.com/zed-industries/community/issues/1749

The PR 

* changes keybindings for `Editor && mode == auto_height` context:
before, `alt-enter` and `alt-shift-enter` added new lines in such
editors, including the one from buffer search.

New bindings are the same as in `Editor && mode == full` context.

* adds `search::SelectAllMatches` action and binds it to `Alt + Enter`
by default, to select all matches of a buffer search

The behavior mimics VSCode: we do not move the screen even if all
selections are out of the visible range (Cmd+G will navigate there) and
allow reselecting the results from both pane and search field, as long
as the search is not dismissed.

Release Notes:

- Added `search::SelectAllMatches` (`Alt + Enter` default) action to
place carets and select all buffer search results
([#75](https://github.com/zed-industries/community/issues/75),
[#1749](https://github.com/zed-industries/community/issues/1749)).
2023-07-14 21:37:04 +03:00
Max Brunsfeld
2f2ef7c165 Use workspace dependencies for tree-sitter grammars 2023-07-14 09:25:51 -07:00
Kirill Bulatov
ccc78000bd Preserve serach index for multicaret selection editor events 2023-07-14 14:47:12 +03:00
Kirill Bulatov
29cbeb39bd Allow selecting all search matches in buffer 2023-07-14 14:47:12 +03:00
Mikayla Maki
77c4fc98bd
Add line height settings for the editor 2023-07-13 16:14:33 -07:00
Mikayla Maki
b7ed467690
WIP: Resizing splits (#2715)
We're finally doing the thing. 


TODO:
- [x] Choose an approach 
- Decided to add a new element just for the pane axis, containing a
slimmed down copy of the flex code.
- [x] Wire through callbacks and pointers so that data goes where it
needs to
- [x] Do the flex juggling math on resize
- [x] Update the flexes when updating the split tree
- [x] Restore the active_pane_magnification setting
- [x] Serialize an axis' flexes

Release Notes:
- Made the center pane group splits resizable. Note that resizing is
disabled if the `active_pane_magnification` setting is changed from
default.
2023-07-13 15:29:34 -07:00
Mikayla Maki
d5f7ad08fa
Styled and refined behavior for split resizing 2023-07-13 11:28:21 -07:00
Kirill Bulatov
0c7949bdee Force resolve all completions, to ensure their edits are up-to-date
co-authored-by: Max Brunsfeld <max@zed.dev>
2023-07-12 21:10:01 +03:00
Kirill Bulatov
c732aa1617 Do not resolve completions if extra edits are available 2023-07-12 20:28:16 +03:00