This PR introduces several enhancements (along with fixing a couple of
bugs) in the search bar UI (copied from [this
comment](https://github.com/zed-industries/zed/issues/7663#issuecomment-1937659091)):
- Moving the Replace field under the Search field makes it easier to
compare texts and avoid typos. Also, less eyes movements.
- Use red (error) color to indicate that nothing matched. VSCode, IDEA
do this. Again, it helps to get a quicker feedback on typos without
moving your eyes.
- Much less moving parts and no place for flickering.
- Better fits to narrow panes.
- The Close button that allows to close the search bar with the mouse.
- Better keyboard handling (tab, shift+tab in the replacement mode),
autofocus on the Replace field.
How it looks:
https://github.com/zed-industries/zed/assets/2101250/93b0edb4-4311-4a7f-9f43-b30c4d1aede5
Implementation details:
- Using `Self::on_query_editor_event` looked suspicious
[here](2880135037/crates/search/src/buffer_search.rs (L491))
because it triggered searching on the replacement text changes. I've
created a separate method for the replacement editor.
- These changes don't affect the project search bar. If the PR is
accepted, the same changes may be implemented there.
Fixed issues:
- #7661
- #7663
Release Notes:
- Buffer search bar UI enhancements.
Partially fixes#4321, since Azure OpenAI API can be converted to OpenAI
API.
Release Notes:
- Added `assistant.openai_api_url` setting to allow OpenAI API URL to be
configured.
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Current limitations:
* Not able to navigate into JAR files
Release Notes:
- Added Clojure language support
---------
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Alacritty seems to support only regex search out of the box.
This PR just escapes all special regex chars to make non regex search
work as expected.
Disclaimer: New to Rust.
Release Notes:
-Fixed text search not working correctly in terminal ([#4880](https://github.com/zed-industries/zed/issues/4880))
1. The client-side comparison was wrong
2. The server never told the client about the version it remembered
3. The server generated broken timestamps in some cases
Release Notes:
- Fixed the notes/chat appearing as unread too often
**or**
- N/A
Fixes: #7605
When repeating some cursor movements in Vim mode (e.g. `99999999 w`),
Zed tries to repeat the movement that many times, even if further
actions don't have any effect. This causes Zed to hang.
This commit makes those movements like other actions (like moving the
cursor left/right), stopping the repeat movement if a boundary of the
text is reached/the cursor can't move anymore.
Release Notes:
- Fixed [#7605](https://github.com/zed-industries/zed/issues/7605).
Fixes: #7311
Co-Authored-By: WindSoilder <WindSoilder@outlook.com>
Release Notes:
- Added a highlight on yanked text in vim normal mode
**or**
- N/A
Co-authored-by: WindSoilder <WindSoilder@outlook.com>
- Open channel notes and chat on channel click
- WIP
- Fix compile error
- Don't join live kit until requested
- Track in_call state separately from in_room
Release Notes:
- Improved channels: you can now be in a channel without joining the
audio call automatically
**or**
- N/A
---------
Co-authored-by: Nathan Sobo <nathan@zed.dev>
Fix found by @h3mosphere (thanks!)
Solves the Vulkan validation on start on some platforms about the
mismatched surface size, e.g.
```
VUID-VkSwapchainCreateInfoKHR-imageExtent-01274(ERROR / SPEC): msgNum: 2094043421 - Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 ] Object 0: handle = 0x55dff99554c0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x7cd0911d | vkCreateSwapchainKHR() called with imageExtent = (1920,1080), which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): currentExtent = (1920,1016), minImageExtent = (1920,1016), maxImageExtent = (1920,1016). The Vulkan spec states: imageExtent must be between minImageExtent and maxImageExtent, inclusive, where minImageExtent and maxImageExtent are members of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-imageExtent-01274)
```
Release Notes:
- N/A
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Before the change to `script/clippy`, bash ignored first `clippy`
invocation failure and CI moved on with Linux errors and warnings
emitted.
Release Notes:
- N/A
---------
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
The current LSP headers reader implementation assumes a specific order
(i.e., `Content-Length` first, and then `Content-Type`). Unfortunately,
this assumption is not always valid, as no specification enforces the
rule. @caius and I encountered this issue while implementing the
Terraform LSP, where `Content-Type` comes first, breaking the
implementation in #6929.
This PR introduces a `read_headers` function, which asynchronously reads
the incoming pipe until the headers' delimiter (i.e., '\r\n\r\n'),
adding it to the message buffer, and returning an error when delimiter's
not found.
I added a few tests but only considered scenarios where headers are
delivered at once (which should be the case?). I'm unsure if this
suffices or if I should consider more scenarios; I would love to hear
others' opinions.
Release Notes:
- N/A
---------
Co-authored-by: Caius <caius@caius.name>
Previously we only looked at the global settings, this changes that to
start looking in local settings first and then fall back to global ones.
Fixes#4279.
Release Notes:
- Fixed language server configurations not being picked up from local,
worktree-specific settings.
([#4279](https://github.com/zed-industries/zed/issues/4279)).
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Bennet <bennetbo@gmx.de>
This fixes two annoyances when composing text and autoclose is enabled.
Example: use a Brazilian keyboard and type `"`, which triggers a
dead-key state.
Previously when a user would type `"<space>` to get a quote, we'd end up
with 4 quotes.
When text was selected and a user then typed `"<space>` the selected
text would be deleted.
This commit fixes both of these issues.
Fixes https://github.com/zed-industries/zed/issues/4298
Release Notes:
- Fixed autoclose behavior not working when composing text via IME (e.g.
using quotes on a Brazilian keyboard)
([#4298](https://github.com/zed-industries/zed/issues/4298)).
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: bennetbo <bennetbo@gmx.de>
Dims text by a certain factor - this respects theme opacity. The amount
is documented in the code. As far as I can tell, all other terminals
also dim text using this same method. Dim only affects the foreground.
<img width="755" alt="SCR-20240209-mfls"
src="https://github.com/zed-industries/zed/assets/52195359/c32f2aff-1142-4333-a05d-6aca425cb235">
Release Notes:
- Added terminal text dimming (fixes#7497)
On macOS, this will enable or disable the Metal HUD at runtime. Note
that this only works when Zed is bundled because it requires to set the
`MetalHudEnabled` key in the Info.plist.
Release Notes:
- Added a new `ToggleGraphicsProfiler` command that can be used as an
action (or via the `Help -> Toggle Graphics Profiler` menu) to
investigate graphics performance.
Previously we wouldn't handle Backspace in dead key state correctly:
instead of removing what was typed, we'd insert the text that was in the
dead key state.
Example: on a US English layout, press `opt-u` to end up in a dead key
state with `¨` waiting for the next character to be typed. Type
`backspace`. The `¨` should be removed, but it's not.
With this change, the `backspace` is interpreted instead of being
ignored.
Release Notes:
- Fixed backspace not working for dead keys (i.e. when typing accents or
umlauts)
---------
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Conrad <conrad@zed.dev>
This is a rebase of @gabydds text_system updates. with some small
cleanups.
Currently cannot test this as build is not working in linux. Im just
putting it up here before I forget about it.
---------
Co-authored-by: gabydd <gabydinnerdavid@gmail.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Release Notes:
- N/A
Hello everyone,
glad to be contributing to this awesome project! This just fixes a
simple todo!(linux) in gpui.
I also considered setting the window title in the hello world example,
let me know if I should add it in this PR as well.
Best Regards,
Christian Bergschneider
This is a refactor, follow-up to the work we've been doing on loading
WASM language extensions.
Release Notes:
- N/A
---------
Co-authored-by: Marshall <marshall@zed.dev>
This PR extends our Tree-sitter highlights for Python to allow
highlighting docstrings differently from other strings.
Docstrings in Python will now use `string.doc` instead of just `string`,
which will allow for them to be styled independently of other strings.
If no `string.doc` is present in the theme, then it will fall back to
using the `string` styles.
<img width="272" alt="Screenshot 2024-02-08 at 1 52 21 PM"
src="https://github.com/zed-industries/zed/assets/1486634/034cffa0-91c0-4924-8ccc-3a385cf31126">
This is slightly different than the approach I took in #7585 in that we
are still treating docstrings as strings by default (which appears to be
the more common behavior), but allowing theme authors to hook in and
style them separately, if desired.
Release Notes:
- Added ability add custom styles for Python docstrings using
`string.doc`
([#7346](https://github.com/zed-industries/zed/issues/7346)).
Release Notes:
- Fixed a bug that caused Zed to render at 60fps even on ProMotion
displays.
- Fixed a bug that could saturate the main thread event loop in certain
circumstances.
---------
Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Max <max@zed.dev>
With https://github.com/zed-industries/zed/pull/6882 basic syntax
highlighting support for Terraform has arrived in Zed. To fully support
all features of the language server (when it lands), it's necessary to
handle `*.tfvars` slightly differently.
TL;DR: [terraform-ls](https://github.com/hashicorp/terraform-ls) expects
`terraform` as language id for `*.tf` files and `terraform-vars` as
language id for `*.tfvars` files because the allowed configuration
inside the files is different. Duplicating the Terraform language
configuration was the only way I could see to achieve this.
---
In the
[LSP](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentItem),
text documents have a language identifier to identify a document on the
server side to avoid reinterpreting the file extension.
The Terraform language server currently uses two different language
identifiers:
* `terraform` - for `*.tf` files
* `terraform-vars` - for `*.tfvars` files
Both file types contain HCL and can be highlighted using the same
grammar and tree-sitter configuration files. The difference in the file
content is that `*.tfvars` files only allow top-level attributes and no
blocks. [_So you could argue that `*.tfvars` can use a stripped down
version of the grammar_]. To set the right context (which affects
completion, hover, validation...) for each file, we need to send a
different language id.
The only way I could see to achieve this with the current architecture
was to copy the Terraform language configuration with a different `name`
and different `path_suffixes`. Everything else is the same.
A Terraform LSP adapter implementation would then map the language
configurations to their specific language ids:
```rust
fn language_ids(&self) -> HashMap<String, String> {
HashMap::from_iter([
("Terraform".into(), "terraform".into()),
("Terraform Vars".into(), "terraform-vars".into()),
])
}
```
I think it might be helpful in the future to have another way to map
file extensions to specific language ids without having to create a new
language configuration.
### UX Before
![CleanShot 2024-02-07 at 23 00
56@2x](https://github.com/zed-industries/zed/assets/45985/2c40f477-99a2-4dc1-86de-221acccfcedb)
### UX After
![CleanShot 2024-02-07 at 22 58
40@2x](https://github.com/zed-industries/zed/assets/45985/704c9cca-ae14-413a-be1f-d2439ae1ae22)
Release Notes:
- N/A
---
* Part of https://github.com/zed-industries/zed/issues/5098
Fixes text in the terminal displaying as bold when it's actually just
dim. I think it was just a simple oversight because the original code
`|`'s together the BOLD and DIM_BOLD flags, which is the same as
DIM_BOLD, which is wrong because it should only be BOLD :p
Release Notes:
- Fixed#4464
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
This PR removes an unneeded `maybe!` from `get_permalink_to_line`.
As this is a `Result`-returning function, we don't need the inner level
of wrapping.
Release Notes:
- N/A