Commit Graph
5172 Commits
Author SHA1 Message Date
Joseph T. Lyons ad2c456b9a Add more convert to case commands
ConvertToTitleCase
ConvertToSnakeCase
ConvertToKebabCase
ConvertToUpperCamelCase
ConvertToLowerCamelCase
2023-08-04 22:45:26 -04:00
Joseph T. LyonsandJulia 4907349c6f 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 75e0b60845 Fix visual selection cursor in multibuffers 2023-08-04 14:39:16 +01:00
Nathan Sobo 242765b6ad Merge branch 'main' into cells 2023-08-03 19:33:04 -06:00
Nathan Sobo 1d54e24f21 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 40f28de681 Don't refcount window handles 2023-08-03 17:11:47 -06:00
Nathan Sobo aaa63b400b WIP 2023-08-03 17:03:39 -06:00
Joseph T. Lyons 6cd508c88b 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 680c0185e4 Get tests compiling returning WindowHandle<V: View> from add_window 2023-08-02 14:05:03 -06:00
Max Brunsfeld a318f5465e Fix warnings surfaced in Rust 1.71 2023-08-02 09:19:23 -07:00
Conrad Irwin 9fa277f4b3 TEMP 2023-08-02 15:06:46 +01:00
Joseph T. Lyons 1488d195eb Fix variable names 2023-08-01 11:52:53 -04:00
Mikayla Maki 3b8b4d6163 Clip wrap guides from under the scrollbar 2023-07-31 10:54:29 -07:00
Mikayla Maki 73452341cb disable wrap guides in the assitant panel 2023-07-28 22:27:36 -07:00
Conrad Irwin 2921cd77ca Fix visual selection of trailing newline 2023-07-28 22:38:39 -06:00
Mikayla Maki b548f8327a Make wrap guides respect scroll position 2023-07-28 14:56:13 -07:00
Conrad Irwin f15afdcb45 Review 2023-07-28 15:36:14 -06:00
Conrad Irwin adc89d3418 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 IrwinandMax Brunsfeld 737efc0c9d 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 5e07c1b2e2 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 636b03eeb8 Don't highlight project search matches either 2023-07-28 12:17:32 -06:00
Conrad Irwin 809da56c22 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 02d753213b 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 1d6fc91933 Block extra drag events in original drag handlers 2023-07-26 14:57:46 -07:00
Nathan Sobo b5c787ad8a WIP 2023-07-26 13:34:57 -06:00
Nathan Sobo d43ef7e00b 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 a8b628ce9f Add tests for manipulate_lines() 2023-07-25 15:17:16 -04:00
Joseph T. Lyons 3a8579b79b Remove { and } from single-line closure 2023-07-25 14:48:11 -04:00
Joseph T. LyonsandMikayla Maki e3dae4eacb 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. LyonsandJulia f702d3536a 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 385367b6c9 WIP 2023-07-25 10:33:20 -04:00
Kirill Bulatov 41ce4a33e0 Do not scroll when selecting all 2023-07-22 00:17:02 +03:00
Mikayla Maki fdc4bc9cbc bump the brightness of the active wrap guide 2023-07-20 16:45:41 -07:00
Mikayla Maki 167d34be50 Add wrap guides and associated settings 2023-07-20 16:39:13 -07:00
Conrad Irwin b4b1df5fee 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 ce4edb3375 Fully revert the line height change 2023-07-20 15:39:22 +03:00
Kirill Bulatov e39b713496 Keep basic line height for single line editors 2023-07-20 13:42:11 +03:00
Conrad Irwin 6ab5bd0aff 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 37fc9cccca fmt 2023-07-19 16:56:49 -07:00
Mikayla Maki 5c35215148 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 72f550e68d 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 8ff6450c40 Merge branch 'main' into vim-search 2023-07-19 09:48:25 -06:00
Kirill Bulatov 913027995f Clean up stale conflicting hints 2023-07-19 15:29:00 +03:00
Kirill Bulatov 699c5ceb68 Ignore empty hover contents, trim final hover label text 2023-07-18 22:53:44 +03:00
Conrad Irwin 63c6387539 Avoid optional on select_match 2023-07-17 12:49:59 -06:00
Conrad Irwin 41775f1244 Merge branch 'main' into vim-search 2023-07-17 09:27:02 -06:00
Alex ViscreanuandMikayla Maki ef7952c045 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 9b283a6f4d 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 0bde85d0af Use workspace dependencies for tree-sitter grammars 2023-07-14 09:25:51 -07:00
Kirill Bulatov 9a9be65585 Preserve serach index for multicaret selection editor events 2023-07-14 14:47:12 +03:00