Commit Graph

2422 Commits

Author SHA1 Message Date
Conrad Irwin
f09da1a1c8
vim hml (#7298)
- Add a setting for `vertical_scroll_offset`
- Fix H/M/L in vim with scrolloff



Release Notes:

- Added a settings for `vertical_scroll_offset`
- vim: Fix H/M/L with various values of vertical_scroll_offset

---------

Co-authored-by: Vbhavsar <vbhavsar@gmail.com>
Co-authored-by: fdionisi <code@fdionisi.me>
2024-02-02 19:24:36 -07:00
Antonio Scandurra
a0b52cc69a
Scope line layout cache to each window (#7235)
This improves a performance problem we were observing when having
multiple windows updating at the same time, where each window would
invalidate the other window's layout cache.

Release Notes:

- Improved performance when having multiple Zed windows open.

Co-authored-by: Max Brunsfeld <max@zed.dev>
2024-02-02 09:11:20 -08:00
Thorsten Ball
11bd28870a
editor: Add MoveUpByLines and MoveDownByLines actions (#7208)
This adds four new actions:

- `editor::MoveUpByLines`
- `editor::MoveDownByLines`
- `editor::SelectUpByLines`
- `editor::SelectDownByLines`

They all take a count by which to move the cursor up and down.
(Requested by Adam here:
https://twitter.com/adamwathan/status/1753017094248018302)


Example `keymap.json` entries:

```json
{
  "context": "Editor",
  "bindings": [
    "alt-up":         [ "editor::MoveUpByLines",     { "lines": 3 } ],
    "alt-down":       [ "editor::MoveDownByLines",   { "lines": 3 } ],
    "alt-shift-up":   [ "editor::SelectUpByLines",   { "lines": 3 } ],
    "alt-shift-down": [ "editor::SelectDownByLines", { "lines": 3 } ]
  ]
}
```

They are *not* bound by default, so as to not conflict with the
`alt-up/down` bindings that already exist.

Release Notes:

- Added four new actions: `editor::MoveUpByLines`,
`editor::MoveDownByLines`, `editor::SelectUpByLines`,
`editor::SelectDownByLines` that can take a line count configuration and
move the cursor up by the count.

### Demo



https://github.com/zed-industries/zed/assets/1185253/e78d4077-5bd5-4d72-a806-67695698af5d




https://github.com/zed-industries/zed/assets/1185253/0b086ec9-eb90-40a2-9009-844a215e6378
2024-02-02 08:48:04 -07:00
Thorsten Ball
01ddf840f5
completions: do not render empty multi-line documentation (#7279)
I ran into this a lot with Go code: the documentation would be empty so
we'd display a big box with nothing in it.

I think it's better if we only display the box if we have documentation.

Release Notes:

- Fixed documentation box in showing up when using auto-complete even if
documentation was empty.

## Before

![screenshot-2024-02-02-14 00
18@2x](https://github.com/zed-industries/zed/assets/1185253/e4915d51-a573-41f4-aa5d-21de6d1b0ff1)

## After

![screenshot-2024-02-02-14 01
58@2x](https://github.com/zed-industries/zed/assets/1185253/74b244af-3fc7-45e9-8cb3-7264e34b7ab7)
2024-02-02 16:42:43 +01:00
Bennet Bo Fenner
ce4c15dca6
Show diagnostics in scrollbar (#7175)
This PR implements support for displaying diagnostics in the scrollbar,
similar to what is already done for search results, symbols, git diff,
...

For example, changing a field name (`text`) without changing the
references looks like this in `buffer.rs` (note the red lines in the
scrollbar):

![image](https://github.com/zed-industries/zed/assets/53836821/c46f0d55-32e3-4334-8ad7-66d1578d5725)

As you can see, the errors, warnings, ... are displayed in the scroll
bar, which helps to identify possible problems with the current file.

Relevant issues: #4866, #6819

Release Notes:

- Added diagnostic indicators to the scrollbar
2024-02-02 12:10:42 +02:00
Conrad Irwin
69e0ea92e4
Links to channel notes (#7262)
Release Notes:

- Added outline support for Markdown files
- Added the ability to link to channel notes:
https://zed.dev/channel/zed-283/notes#Roadmap
2024-02-01 22:22:02 -07:00
Max Brunsfeld
21f4da6bf2
Correctly log LSP adapter name on LSP request error (#7232)
Previously, we were logging the language server's binary filename
instead.

Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Antonio <antonio@zed.dev>
2024-02-01 14:17:09 -08:00
Kirill Bulatov
944a1f8fb0
Send lsp_types::InitializeParams with Zed version (#7216)
Based on the great work in
https://github.com/zed-industries/zed/pull/7130 , now sends this data

```
[crates/lsp/src/lsp.rs:588] ClientInfo { name: name.to_string(), version: Some(version.to_string()) } = ClientInfo {
    name: "Zed Dev",
    version: Some(
        "0.122.0",
    ),
}
```

with every LSP server initialization.

Release Notes:

- Added Zed name and version to LSP InitializeParams requests
2024-02-01 18:39:28 +02:00
Marshall Bowers
a588a7dd4d
Fix some typos in comments (#7169)
This PR fixes a couple typos I found in some comments/doc comments.

Release Notes:

- N/A
2024-01-31 16:21:33 -05:00
Conrad Irwin
dcca48482b
disallow opening private files (#7165)
- Disallow sharing gitignored files through collab
- Show errors when failing to open files
- Show a warning to followers when view is unshared

/cc @mikaylamaki, let's update this to use your `private_files` config
before merge.


Release Notes:

- Added the ability to prevent sharing private files over collab.

---------

Co-authored-by: Piotr <piotr@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-31 12:05:51 -08:00
Mikayla Maki
f98d636203
WIP: Add a setting to visually redact enviroment variables (#7124)
Release Notes:

- Added bash syntax highlighting to `.env` files. 
- Added a `private_files` setting for configuring which files should be
considered to contain environment variables or other sensitive
information.
- Added a `redact_private_values` setting to add or remove censor bars
over variable values in files matching the `private_files` patterns.
-(internal) added a new `redactions.scm` query to our language support,
allowing different config file formats to indicate where environment
variable values can be identified in the syntax tree, added this query
to `bash`, `json`, `toml`, and `yaml` files.

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-01-31 11:42:09 -08:00
Conrad Irwin
689d43047d
Don't panic when collaborating with older Zed versions (#7162)
Older Zed versions may send a buffer id of 0, which is no-longer
supported. (as of #6993)

This doesn't fix that, but it does ensure that we don't panic in the
workspace by maintaining the invariant that from_proto_state returns
Some(Task) if the variant matches.

It also converts the panic to an error should something similar happen
again in the future.


Release Notes:

- N/A
2024-01-31 11:46:03 -07:00
Julia
7cb97e57f9 Add debounce for re-querying completion documentation 2024-01-31 09:50:26 -05:00
d1y
c3d4fa4336
Permalink add Gitee host support (#7134)
China's largest git code hosting platform
About Gitee: https://gitee.com/about_us

Release Notes:

- Added Gitee host support   with Git-Permalink
2024-01-31 08:54:03 +01:00
Marshall Bowers
e338f34097
Sort dependencies in Cargo.toml files (#7126)
This PR sorts the dependency lists in our `Cargo.toml` files so that
they are in alphabetical order.

This should make them easier to visually scan when looking for a
dependency.

Apologies in advance for any merge conflicts 🙈 

Release Notes:

- N/A
2024-01-30 21:41:29 -05:00
Marshall Bowers
176f63e86e
Add ability to copy a permalink to a line (#7119)
This PR adds the ability to copy the permalink to a line from within
Zed.

This functionality is available through the `editor: copy permalink to
line` action in the command palette:

<img width="589" alt="Screenshot 2024-01-30 at 7 07 46 PM"
src="https://github.com/zed-industries/zed/assets/1486634/332282cb-211f-4f16-9eb1-415bcfee9b7b">

Executing this action will create a permalink to the currently selected
line(s) and copy it to the clipboard.

Here is an example line:

```
56c80e8011/src/lib.rs (L25)
```

Currently, both GitHub and GitLab are supported.

### Notes and known limitations

- In order to determine where to permalink to, we read the URL of the
`origin` remote in Git. This feature will not work if the `origin`
remote is not present.
- Attempting to permalink to a ref that is not pushed to the origin will
result in the link 404ing.
- Attempting to permalink when Git is in a dirty state may not generate
the right link.
- For instance, modifying a file (e.g., adding new lines) and grabbing a
permalink to it will result in incorrect line numbers.

Release Notes:

- Added the ability to copy a permalink to a line
([#6777](https://github.com/zed-industries/zed/issues/6777)).
- Available via the `editor: copy permalink to line` action in the
command palette.
2024-01-30 19:20:15 -05:00
Felix Salazar
cbcaca4153
Show highlighted symbol in the scrollbar (#7029)
Release Notes:

- Added highlighted symbols to the scrollbar; partially mentioned in:
  - https://github.com/zed-industries/zed/issues/5308
  - https://github.com/zed-industries/zed/issues/4866
2024-01-30 13:57:42 -08:00
Piotr Osiewicz
e6ebe7974d
gpui: Add Global marker trait (#7095)
This should prevent a class of bugs where one queries the wrong type of
global, which results in oddities at runtime.

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-01-30 14:08:20 -05:00
Thorsten Ball
7b8bd97652
vim: implement <space> in normal mode (#7011)
This fixes #6815 by implementing `<space>` in normal mode in Vim. Turns
out that `<space>` behaves like a reverse `<backspace>` (which we
already had): it goes to the right and, if at end of line, to the next
line.

That means I had to touch `movement::right`, which is used in a few
places, but it's documentation said that it would go to the next line,
which it did *not*. So I changed the behaviour.

But I would love another pair of eyes on this, because I don't want to
break non-Vim behaviour.

Release Notes:

- Added support for `<space>` in Vim normal mode: `<space>` goes to the
right and to next line if at end of line.
([#6815](https://github.com/zed-industries/zed/issues/6815)).
2024-01-30 10:47:39 +01:00
Marshall Bowers
0cb8b0e451
Clean up Cargo.toml files (#7044)
This PR cleans up some inconsistencies in the `Cargo.toml` files that
were driving me crazy.

Release Notes:

- N/A
2024-01-29 23:47:20 -05:00
Vishal Bhavsar
31e9526544
vim: Add support for moving to first, middle and last visible lines (H, L, M) (#6919)
This change implements the vim
[motion](https://github.com/vim/vim/blob/master/runtime/doc/motion.txt)
commands to move the cursor to the top, middle and bottom of the visible
view. This feature is requested in
https://github.com/zed-industries/zed/issues/4941.

This change takes inspiration from
[crates/vim/src/normal/scroll.rs](https://github.com/zed-industries/zed/blob/main/crates/vim/src/normal/scroll.rs).

A note on the behavior of these commands: Because
`NeovimBackedTestContext` requires compatibility with nvim, the current
implementation causes slightly non-standard behavior: it causes the
editor to scroll a few lines. The standard behavior causes no scrolling.
It is easy enough to account for the margin by adding
`VERTICAL_SCROLL_MARGIN`. However, doing so will cause test failures due
to the disparity between nvim and zed states. Perhaps
`NeovimBackedTestContext` should have a switch to be more tolerant for
such cases.

Release Notes:

- Added support for moving to top, middle and bottom of the screen in
vim mode (`H`, `M`, and `L`)
([#4941](https://github.com/zed-industries/zed/issues/4941)).
2024-01-29 20:58:24 -07:00
Piotr Osiewicz
5ab715aac9 text: Wrap BufferId into a newtype 2024-01-29 20:00:47 +01:00
Piotr Osiewicz
0a0a866dd5
Licenses: change license fields in Cargo.toml to AGPL-3.0-or-later. (#5535)
Release Notes:
- N/A
2024-01-27 13:51:16 +01:00
Mikayla Maki
b5fa5beee4
Fix typos discovered by codespell (#6718)
> codespell --skip="*.json,*.rtf" \

--ignore-words-list=crate,delet,inout,iterm,jumo,lightening,othe,ser,tabe,te,tese,thi,updat
* https://github.com/codespell-project/codespell/blob/master/README.rst

Release Notes:

- N/A
2024-01-25 10:57:18 -08:00
Piotr Osiewicz
e9edad1d51
language: Accept multiple values in line_comment language knob. (#6713)
This opens up a possibility of supporting multiple comment continuation
flavours in editor, e.g. doc comments for Rust (which we seize as well
in this commit). Only the first `line_comment` value is used for
Editor::ToggleComments

Fixes: https://github.com/zed-industries/zed/issues/6692

Release Notes:
- Added support for doc-comment continuations in Rust language.
2024-01-25 19:25:21 +01:00
Christian Clauss
cff2e8bbe0 Fix typos discovered by codespell 2024-01-25 18:32:32 +01:00
Thorsten Ball
0a78c67647 Improve performance of select-all-matches
This fixes #6440.

The previous approach was calling select-next-match in a loop, which
leaves optimizations on the table when you already know that you want to
select all of the matches.

So what we did here is to optimize the code for the "give me all
matches" case:

1. Find all results in the current buffer
2. Build up *all* selections
3. Sort selections & throw away overlapping ones (keep oldest)
4. Unfold if necessary
5. Render selections

On my M3 Max searching for `<span` in the test file [1] from the ticket,
it

previously took: ~1.07s
now takes: ~4ms

[1]: https://github.com/standardebooks/edgar-allan-poe_poetry/blob/master/src/epub/text/poetry.xhtml

Co-authored-by: Antonio <antonio@zed.dev>
2024-01-25 13:35:22 +01:00
Conrad Irwin
f185aca25a Use the correct snapshot when calculating mouse positions 2024-01-24 19:10:53 -07:00
Conrad Irwin
4e085b2052 Show hovered cursors less flickerily 2024-01-23 22:32:22 -07:00
Conrad Irwin
a3968c5cc5
Fix rendering of diagnostic blocks (#4232)
- Distinct colors to make it not confusing
- Avoid overflowing the edge of the editor when the message is long


Release Notes:

- Improved display of diagnostic blocks (F8)
2024-01-23 16:39:57 -07:00
Mikayla Maki
be4d314858
Revert "Improve completion, action and shared project popovers' layout" (#4233)
Reverts zed-industries/zed#4226

Unfortunately there where some worse states possible after this PR.
Reverting until after the launch, as the problems it addresses are still
bad.

![Screenshot 2024-01-23 at 3 20
59 PM](https://github.com/zed-industries/zed/assets/2280405/d25ab0d5-db49-44cb-b865-e320a97616ce)
2024-01-23 15:34:48 -08:00
Conrad Irwin
450cf9dd06 Fix rendering of diagnostic blocks
- Distinct colors to make it not confusing
- Avoid overflowing the edge of the editor when the message is long
2024-01-23 16:28:58 -07:00
Piotr Osiewicz
f2ff7fa4d5
chore: Change AGPL-licensed crates to GPL (except for collab) (#4231)
- [x] Fill in GPL license text.
- [x] live_kit_client depends on live_kit_server as non-dev dependency,
even though it seems to only be used for tests. Is that an issue?

Release Notes:
- N/A
2024-01-24 00:26:58 +01:00
Mikayla Maki
9f6072c6b6
Revert "Improve completion, action and shared project popovers' layout" 2024-01-23 15:26:11 -08:00
Kirill Bulatov
bf35b78380 Allow both action and completion lists to occupy max width and height of its element 2024-01-23 22:42:06 +02:00
Kirill Bulatov
513ddf1861 Change background for the max width of the completion/action elements 2024-01-23 22:12:29 +02:00
Kirill Bulatov
4c039d0f02 Fix code actions being too small 2024-01-23 21:39:22 +02:00
Kirill Bulatov
74bdb48359 Make completions menu to occupy more space
* make completion elements as wide as the longest element
* make completion docs scrollable

co-authored-by: Piotr <piotr@zed.dev>
2024-01-23 21:26:40 +02:00
Piotr Osiewicz
21e6b09361
Remove license-file from Cargo.toml as it is apparently redundant (#4218)
Release Notes:

- N/A
2024-01-23 17:40:30 +01:00
Piotr Osiewicz
678bdddd7d
chore: Add crate licenses. (#4158)
- GPUI and all dependencies: Apache 2
- Everything else: AGPL

Here's a script that I've generated for it:
https://gist.github.com/osiewicz/6afdd6626e517da24a2092807e6f0b6e

Release Notes:
- N/A

---------

Co-authored-by: David <david@zed.dev>
2024-01-23 16:56:22 +01:00
Thorsten Ball
030b20ace9 Fix scroll jitter by ignoring autoscroll events if following
When following someone else we saw jitter because
`ScrollPositionChanged` events were battling `SelectionsChanged` events,
both of which were scrolling the viewport.

This ignores the ScrollPositionChanged if autoscrolling is on.

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Julia <julia@zed.dev>
2024-01-23 16:16:21 +01:00
Thorsten Ball
c8c605d23a Fix horizontal scroll going too far to the left
Previously one could scroll infinitely to the left. This clams it to 0.

Co-authored-by: Antonio <antonio@zed.dev>
2024-01-23 12:28:50 +01:00
Conrad Irwin
ce0833eadf
Fix off-by-one highlighting in hover tooltip (#4206)
rust analyzer has a tendency to return markdown of the form:

```rust
 // <-- note the leading space
blah blah blah
```

This is clearly defectuous, so we used to .trim() the output.

Unfortunately we trim after applying syntax highlighting, so that causes
the output to look goofy.

Fix this by updating the highlighting when we trim.

[[PR Description]]

Release Notes:

- Fixed a bug where syntax highlighting was off in hover tooltips
2024-01-22 23:12:08 -07:00
Julia
f2eb78bbfc
Avoid overwriting mouse wheel scroll with selection auto-scroll (#4207)
Release Notes:

- Fixed an issue where mouse wheel events could be ignored while
selecting text near the top or bottom of the editor with the mouse.
2024-01-22 19:07:03 -05:00
Julia
a2aa47aba2 Avoid overwriting mouse wheel scroll with selection auto-scroll 2024-01-22 18:12:25 -05:00
Conrad Irwin
fd8d2d41b0 One off 2024-01-22 15:53:12 -07:00
Conrad Irwin
98d514f5bf Fix off-by-one highlighting in hover tooltip
rust analyzer has a tendency to return markdown of the form:

```rust
 // <-- note the leading space
blah blah blah
```

This is clearly defectuous, so we used to .trim() the output.

Unfortunately we trim after applying syntax highlighting, so that causes
the output to look goofy.

Fix this by updating the highlighting when we trim.
2024-01-22 15:23:37 -07:00
Conrad Irwin
53b47c15ac Hide editor hovers when a menu is open 2024-01-22 13:33:13 -07:00
Julia
2c3d9805a4 Store a z-index id per-layer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2024-01-22 10:16:59 -05:00
Kirill Bulatov
7aa3d9d1fb Fix lightning bolt hover and git gutter mark overlapping 2024-01-22 16:01:32 +02:00
Antonio Scandurra
f76a2502bb Show diagnostics on hover 2024-01-22 12:01:53 +01:00
Mikayla
c05edee2b5
Port the rest of the app 2024-01-21 20:26:33 -08:00
Conrad Irwin
3b84291343
Updates to chat after Hack#2 (#4175)
Release Notes:

- Channels: Improved font sizes in chat
- Channels: Added a link preview when hovering over links in chat
- Channels: Fixed rendering of newlines in chat messages
- Added a new setting "use_autoclose" (defaulting to true) that lets you
disable autoclose per language.
([#1420](https://github.com/zed-industries/community/issues/1420))
([#1903](https://github.com/zed-industries/community/issues/1903))
2024-01-20 20:03:37 -07:00
Conrad Irwin
29ac1fd081 Merge remote-tracking branch 'origin/main' into chat-font-size 2024-01-20 14:51:53 -07:00
Conrad Irwin
778856c101 Add a setting "use_autoclose" to control autoclose
Also disable autoclose for Chat
2024-01-20 13:33:03 -07:00
Mikayla
33105486aa
Make platform input handler private
Automatically record the context on non-view input handlers
Simplify the async window context update() method
2024-01-20 06:56:19 -08:00
Max Brunsfeld
0858db9ebb
Autocomplete mentions (#4171)
Release Notes:

- Added autocomplete for @-mentions in the chat panel.
2024-01-19 17:03:56 -08:00
Max Brunsfeld
8fb0270b4a Make applying of additional completion edits go through the CompletionProvider 2024-01-19 16:56:28 -08:00
Max Brunsfeld
739d1179e3 Stop propagation when confirming a completion 2024-01-19 16:02:51 -08:00
Max Brunsfeld
4fb3e6d812 Ensure editors context menus get at least 3 lines of height 2024-01-19 15:47:42 -08:00
Mikayla
eaa0e93112
Fix hover popovers showing up over zoomed panels 2024-01-19 14:52:49 -08:00
Conrad Irwin
af30a9b814 Show cursors sligthly longer 2024-01-19 14:38:17 -07:00
Max Brunsfeld
139986d080 Start work on autocomplete for chat mentions
Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Marshall <marshall@zed.dev>
2024-01-19 13:12:57 -08:00
Max Brunsfeld
1ceccdf03b Move the details of completion-resolution logic into Project
Co-authored-by: Conrad <conrad@zed.dev>
2024-01-19 11:52:28 -08:00
Joseph T. Lyons
595428a8b1 Rename show cursors to display cursor names 2024-01-19 11:37:57 -05:00
Joseph T. Lyons
cb1b7915ee
Allow cursors to be shown via a command (#4153) 2024-01-19 11:09:49 -05:00
Joseph T. Lyons
bcc13e151c Change struct field name 2024-01-19 07:52:28 -05:00
Kirill Bulatov
a4a0a02dc3
Avoid gutter resizes on line number increase/decrease (#4135) 2024-01-19 10:25:55 +02:00
Joseph T. Lyons
0062cc000b Allow cursors to be shown via a command 2024-01-19 02:58:30 -05:00
Conrad Irwin
276032398b Fix overflow in hover handler 2024-01-18 16:53:05 -07:00
Conrad Irwin
e513020fbb Fine tune 2024-01-18 15:59:13 -07:00
Kirill Bulatov
bf8e57098d Avoid gutter resizes on line number increase/decrease
Reserves 4 characters for the line number in the gutter to avoid editor bounds jumping when editing small files like commit messages.
2024-01-18 23:11:05 +02:00
Conrad Irwin
bfee008bb2 Merge branch 'main' into cursors 2024-01-18 14:03:27 -07:00
Piotr Osiewicz
9506fa461f Start documenting display_map module 2024-01-18 16:38:06 +01:00
Mikayla Maki
933fb87013
Fix editor selection issue (#4110)
Release Notes:

- Fixes a bug where, editor selections would update in the wrong pane
when split.
2024-01-17 17:16:56 -08:00
Mikayla Maki
aa7351041d
Add typo detection to CI (#4107)
Adding the typos crate to our CI will take some doing, as we have
several tests which rely on typos in various ways (e.g. checking state
as the user types), but I thought I'd take a first stab at fixing what
it finds.

Release Notes:

- N/A
2024-01-17 17:13:47 -08:00
Mikayla
edb204511c
Fix selection bug in editor causing selections to be un-ended 2024-01-17 16:30:01 -08:00
Mikayla
078fd35f4f
WIP 2024-01-17 15:52:54 -08:00
Piotr Osiewicz
6cbc49e5f0
Editor docs (#4097)
Release Notes:

- N/A

---------

Co-authored-by: Kirill <kirill@zed.dev>
2024-01-18 00:48:37 +01:00
Mikayla
57400e9687
Fix typos detected by crate-ci/typos 2024-01-17 14:31:21 -08:00
Conrad Irwin
ef0432da0d Hide cursors by default, but show some 2024-01-17 10:14:20 -07:00
Julia
2fbf42d7df
Z index shenanigans (#4089)
Release Notes:

- Fixed a bug allowing certain UI elements to render incorrectly when
overlapping.
2024-01-17 09:48:08 -05:00
Julia
977832a04e Refresh window, bypassing view cache, when opening hover or context menu 2024-01-17 09:40:16 -05:00
Conrad Irwin
0ca9f286c6 Show cursors for remote participants 2024-01-16 21:54:49 -07:00
Thorsten Ball
1cbdf2ba22 Fix overlapping block headers when using custom line height
This fixes block headers overlapping over text in the buffer when using
a custom line height of 1.25.

It fixes the issue by making the parent container a v-flex,
vertically-justifying the content and moving from relative padding to
absolute padding for the header itself.

Co-authored-by: antonio <antonio@zed.dev>
Co-authored-by: julia <julia@zed.dev>
Co-authored-by: marshall <marshall@zed.dev>
2024-01-16 17:20:27 +01:00
Kirill Bulatov
ec3cfc33d6
Adds a way to select items under multiple carets (#4067)
Deals with https://github.com/zed-industries/community/issues/2374

Release Notes:

- Added a way to select items under multiple carets with
`editor::SelectNext` and `editor::SelectPrevious` commands
2024-01-16 11:08:48 +02:00
Kirill Bulatov
25abe8f981 Fix the tests 2024-01-16 10:58:27 +02:00
Kirill Bulatov
fbb363e83a Add tests 2024-01-16 10:07:31 +02:00
Max Brunsfeld
8f262892a0 Notify editors on buffer font size changes 2024-01-15 14:53:24 -08:00
Kirill Bulatov
55671eac40 Select next/previous word for multiple carets if possible 2024-01-15 23:42:36 +02:00
Joseph T. Lyons
ba9a9f4f17 Add more open events
project search
diagnostics
welcome page
2024-01-15 16:26:04 -05:00
Kirill Bulatov
92add99260 Add LSP logs into the end of the editor, not after its caret
Also prevent tabs from being added in readonly editors
2024-01-15 22:12:52 +02:00
Marshall Bowers
90f4c70a82
Rename h_stack and v_stack to h_flex and v_flex, respectively (#4053)
This PR renames the `h_stack` and `v_stack` to `h_flex` and `v_flex`,
respectively.

We were previously using `h_stack` and `v_stack` to match SwiftUI, but
`h_flex` and `v_flex` fit better with the web/flexbox terminology that
the rest of GPUI uses.

Additionally, we were already calling the utility functions used to
implement `h_stack` and `v_stack` by the new names.

Release Notes:

- N/A
2024-01-15 11:34:06 -05:00
Kirill Bulatov
fc294ce0b1
Disable copilot for feedback and lsp log editors (#4048)
LSP log editor caused recursive flood of messages, and feedback editor
is better with people writing their own feedback.

Release Notes:

- Fixed hanging due to excessive logs when browsing Copilot LSP logs
2024-01-15 15:59:27 +02:00
Kirill Bulatov
253c8dbe8e Disable copilot for feedback and lsp log editors
LSP log editor caused recursive flood of messages, and feedback editor is better with people writing their own feedback.
2024-01-15 15:49:23 +02:00
Thorsten Ball
80c0d09b15
Fix editor stealing click events from copy-error button (#4046)
This fixes the click event on the "copy error message" button by
changing the `editor` element to ignore mouse-down events when the
default was prevented. That's similar to how `div` does it.

Release Notes:

- Fixed a bug that prevented "copy error message" button from being
clicked.
2024-01-15 14:03:15 +01:00
Thorsten Ball
74f3366f42 Fix editor stealing click events from copy-error button
Co-authored-by: Antonio <antonio@zed.dev>
2024-01-15 13:47:09 +01:00
Antonio Scandurra
4ff514ca7e Merge remote-tracking branch 'origin/main' into cache
# Conflicts:
#	crates/gpui/src/elements/div.rs
2024-01-15 11:37:46 +01:00
Mikayla
3a836b8026
Remove some comments 2024-01-12 20:10:40 -08:00
Max Brunsfeld
7dc28aad78 Forbid paste, undo, redo on read-only editors 2024-01-12 10:38:05 -08:00