Commit Graph
171 Commits
Author SHA1 Message Date
Conrad Irwin 2d9db0fed1 Flesh out v1.0 of vim : 2023-09-20 20:44:41 -06:00
Conrad Irwin f4d4a2f41b vim fixes for find&replace (#2995)
* allow replacing with the empty string to delete
* fix <enter> for ReplaceNext (in vim mode)

Release Notes:

- allow replacement to be empty
2023-09-20 16:42:39 -06:00
Conrad Irwin 2da664ed17 vim fixes for find&replace
* allow replacing with the empty string to delete
* fix <enter> for ReplaceNext
2023-09-19 20:48:01 -06:00
Piotr Osiewicz 4525509804 buffer/replace: Advance match index on each replace. (#2992)
Release Notes:
- Fixed "Replace next" not advancing the match index.
2023-09-19 23:56:22 +02: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
Kirill Bulatov 8d3c251cc2 Rework inlay hover model (#2969)
Fixes
```
thread 'main' panicked at 'byte index 2 is not a char boundary; it is inside '…' (bytes 0..3) of `…)`'
```
panics like
https://zed-industries.slack.com/archives/C04S6T1T7TQ/p1694535396473329

by reworking the inlay hover model:
* avoid storing "hardcoded" coordinates of hovered inlay labels (such as
`InlayOffset`), instead, remember `inlay_id` and apply required
highlights there when hint with the same id is handled
* add randomized tests on inlay highlights
* sped up inlay hint cache lookup by inlay_id

As a downside, background highlights are no long appearing on inlay
hints, but Zed does not receive any tooltips for inlays anyway (r-a does
not send them for some reason, other LSP seem to have no such feature?),
so it does not matter now.
Nontheless, if the logic for displaying hint pop-ups is present and
works for harcoded tooltips in r-a, only background highlight is missing
now.

Release Notes:

- Fixed inlay hint highlights causing panic for certain cases with
"large" characters
2023-09-15 10:40:02 +03:00
Piotr Osiewicz a1353b8bb9 search_bar: Add toggle_replace_on_a_pane. (#2966)
This allows users to add a keybind to ToggleReplace from Editor/Pane
contexts.

Release Notes:
- Fixed replace in buffer not reacting to keyboard shortcuts outside of
search bar<preview-only>.
2023-09-14 23:25:27 +02:00
Kirill Bulatov 890a587254 Use standalone inlay background highlights 2023-09-14 22:08:12 +03:00
Piotr OsiewiczandMax a63b78d5a0 Replace in buffer adjustments (#2960)
This PR addresses feedback from @maxbrunsfeld on new replace in buffer.
It fixes:
- missing padding surrounding replace input.
- missing padding around replace buttons.
- missing `.notify` call which made the replace fields not show up
immediately sometimes.

Release Notes:
- N/A

---------

Co-authored-by: Max <max@zed.dev>
2023-09-12 22:08:39 +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
Nate Butler f0ab27a83d Reorder "Select All" button 2023-08-29 14:04:17 -04:00
Max Brunsfeld 3eee282a6b Overhaul search bar layout
* Use a single row, instead of centering the search bar within a double-row toolbar.
* Search query controls on the left, navigation on the right
* Semantic is the final mode, for greater stability between buffer and project search.
* Prevent query editor from moving when toggling path filters
2023-08-28 14:20:09 -07:00
Max Brunsfeld 04354675ca Remove search dismiss button 2023-08-28 10:35:23 -07: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
Mikayla 48553d7c8f Revert "Remove semantic search UI"
This reverts commit c0f042b39a.
2023-08-18 16:18:28 -07:00
Mikayla c0f042b39a Remove semantic search UI 2023-08-17 17:28:09 -07:00
Mikayla 21fa6090b8 Add action button component for rendering the search options 2023-08-17 17:28:09 -07:00
Mikayla 8630557ece Add action button component for rendering the search options 2023-08-17 15:30:40 -07:00
Mikayla afebe3faf8 Merge branch 'main' into project_search_design 2023-08-17 01:56:05 -07:00
Kirill Bulatov 1938fd85e8 Do not leak pane handles 2023-08-16 23:38:11 +03:00
Kirill Bulatov 5c3d563f0f Draft quick actions bar 2023-08-16 23:38:11 +03:00
KCaverlyandPiotr 2a7df106e1 adjusted icon sizes downwards
Co-authored-by: Piotr <piotr@zed.dev>
2023-08-16 14:01:06 +01:00
KCaverlyandPiotr 6f78a1633d fix editor height in buffer search, but the dancing is back
Co-authored-by: Piotr <piotr@zed.dev>
2023-08-16 13:51:41 +01:00
KCaverlyandPiotr a59535efa1 remove redundant and unneeded styling
Co-authored-by: Piotr <piotr@zed.dev>
2023-08-16 12:55:32 +01:00
KCaverly d727ba18f2 Merge branch 'main' of github.com:zed-industries/zed into project_search_design 2023-08-16 12:43:04 +01:00
KCaverlyandPiotr 11ecb7b604 reorganize search bar, enable filters and disable select all during invalid states
Co-authored-by: Piotr <piotr@zed.dev>
2023-08-16 11:35:09 +01:00
KCaverly 32bec2e401 left align buffer search with new structure 2023-08-15 23:18:03 +01:00
KCaverlyandmaxbrunsfeld 1e8a7c7caa refactor buffer_search to reduce redundancy and simplying height management
Co-authored-by: maxbrunsfeld <max@zed.dev>
2023-08-15 20:04:14 +01: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
Piotr OsiewiczandKyle db36a5fe2d Refactor buffer search UI rendering in a quest to find the meaning of life.
Co-authored-by: Kyle <kyle@zed.dev>
2023-08-14 15:27:57 +02:00
Piotr OsiewiczandKyle ff4370f88e buffer: Extract columns to separate objects.
Co-authored-by: Kyle <kyle@zed.dev>
2023-08-14 15:14:57 +02:00
Piotr OsiewiczandKyle 4aa5df4cda Extract columns into separate objects.
Co-authored-by: Kyle <kyle@zed.dev>
2023-08-14 15:13:17 +02:00
Piotr OsiewiczandKyle f4121b42da Add more padding to dismiss button.
Add a style for mode buttons group margin

Co-authored-by: Kyle <kyle@zed.dev>
2023-08-14 15:01:01 +02:00
Piotr OsiewiczandKyle b72a42ec29 buffer: fix alignment of editor icon.
Co-authored-by: Kyle <kyle@zed.dev>
2023-08-14 14:31:14 +02:00
Piotr Osiewicz ae229d4c52 Align "Select all" to the center 2023-08-14 12:31:11 +02:00
Piotr Osiewicz 94ac84a908 Fix borders being cut off in buffer search 2023-08-14 12:28:35 +02:00
Piotr Osiewicz 8bb3bfa6a8 Style buffer modes like project modes 2023-08-14 12:25:59 +02:00
Piotr Osiewicz 1c35db7e97 project_search: style filters button like the rest of the buttons 2023-08-14 12:20:59 +02:00
Piotr Osiewicz b586601cab Style nav buttons 2023-08-13 01:29:35 +02:00
Piotr Osiewicz c0356fdf16 Decrease row count for buffer search bar 2023-08-11 23:47:16 +02:00
Piotr Osiewicz da3a4174ce Bump row_count for buffer search 2023-08-10 13:01:20 +02:00
Piotr Osiewicz c58cf396d3 Add cycle mode command for buffer search 2023-08-09 18:02:21 +02:00
Piotr Osiewicz 28a57662af buffer: Add magnifying glass icon 2023-08-09 13:47:48 +02:00
Piotr Osiewicz 7ef5656f6a Merge branch 'main' into project_search_design 2023-08-09 12:30:48 +02:00
Piotr Osiewicz d34da2db69 fix dismiss tooltip for project search 2023-08-09 01:37:17 +02:00
Piotr Osiewicz 22f630e985 chore: remove unused function 2023-08-09 01:30:45 +02:00
Piotr Osiewicz f978acdd34 buffer: use shared func for nav button rendering 2023-08-09 01:29:22 +02:00
Piotr Osiewicz e2b8e6ce63 chore: fix compiler warnings 2023-08-09 01:16:24 +02:00
Piotr Osiewicz a583d1c6cc Do not display match count when query is empty 2023-08-09 01:15:17 +02:00
Piotr Osiewicz b282bdfe5a buffer: finish up moving things around 2023-08-09 01:09:07 +02:00