ZIm/crates/assistant_tools/src
Finn Evers 358c324e26
editor: Use default gutter margin instead of horizontal_padding for horizontal content padding (#30138)
This PR changes the way a horizontal margin is added in editors. It
removes the possibility to set a custom `horizontal_padding` for an
editor and utilizes the default `gutter_dimension` instead.

This change is made to ensure that no issues with soft-wrapping occurs
for any editor that has a `horizontal_margin` set (see #26893 for more
context on the implications here`. Furthermore, it ensures that the text
actually renders properly when scrolling horizontally and is not
cut-off.

### Horizontal padding:

| `main` | This PR |
| --- | --- |
| ![main
padding](https://github.com/user-attachments/assets/4e7ea020-f92d-4f28-8cc1-89d0b0350683)
| ![PR
padding](https://github.com/user-attachments/assets/a05bae17-c384-431b-bb79-a1fffe7a29d7)
|

### Editor horizontally scrolled:

| `main` | This PR |
| --- | --- |
| ![main
scrolled](https://github.com/user-attachments/assets/1a30156f-6c08-4cf9-94aa-9d087c0408cc)
| ![pr
scrolled](https://github.com/user-attachments/assets/d0daa72e-3b02-479b-aea0-41e1a376c567)
|

Notice the difference at the horizontal borders.

The margin added for the `edit_file_tool` was 4 pixels. The `descent`,
whilst not exactly, is roughly the same here and also scales with the
font size nicely. Furthermore, it seems that the
`gutter_dimensions.margin` should be present anyway, given the following
comment


0b00256f58/crates/editor/src/element.rs (L6887-L6889)

so ensuring this property is actually set and not 0 seems to be
reasonable given the circumstances.

Please note though that this will apply to all editors in the app.
Again, this seems like it should be the case anyway, just wanted to
mention this again.

Should the fix like this not be wanted, I can change this here so that
the `horizontal_margin` is better accounted for when soft-wrapping in an
editor. Feel free to let me know in this case.

Release Notes:

- N/A
2025-05-07 18:23:54 +00:00
..
batch_tool Add Batch tool call for calling multiple tools (#27621) 2025-03-27 18:21:26 -04:00
code_action_tool Add code action tool and rename tool (#28453) 2025-04-09 22:38:01 -04:00
code_symbols_tool Add Code Symbols tool (#27733) 2025-03-31 05:13:13 +00:00
contents_tool Add contents_tool (#28738) 2025-04-15 00:54:25 -04:00
copy_path_tool Add copy-path tool (#27371) 2025-03-24 21:21:55 -04:00
create_directory_tool Add Create Directory Tool (#27505) 2025-03-26 11:59:03 -04:00
delete_path_tool Delete tool uses paths instead of globs (#26715) 2025-03-16 11:58:25 +01:00
diagnostics_tool Systematically optimize agentic editing performance (#28961) 2025-04-19 02:47:59 +00:00
edit_agent Fix agent reading and editing files over SSH (#30144) 2025-05-07 17:07:01 +00:00
edit_file_tool Fix agent reading and editing files over SSH (#30144) 2025-05-07 17:07:01 +00:00
fetch_tool assistant_tools: Add fetch tool (#26999) 2025-03-18 16:25:51 +00:00
find_path_tool agent: Improve initial file search quality (#29317) 2025-04-23 21:24:41 -03:00
grep_tool Rename regex search tool to grep and accept an include glob pattern (#29100) 2025-04-20 00:53:30 +00:00
list_directory_tool agent: Improve initial file search quality (#29317) 2025-04-23 21:24:41 -03:00
move_path_tool Add move_path tool (#27366) 2025-03-24 14:45:19 +00:00
open_tool Add eval for open_tool (#29801) 2025-05-02 15:56:07 +00:00
read_file_tool Systematically optimize agentic editing performance (#28961) 2025-04-19 02:47:59 +00:00
rename_tool Add code action tool and rename tool (#28453) 2025-04-09 22:38:01 -04:00
symbol_info_tool Add symbol info tool (#27742) 2025-03-31 00:23:03 -04:00
templates Add new editing eval scenario and improve it substantially (#29997) 2025-05-06 12:22:42 +00:00
terminal_tool agent: Discourage long-running commands (#29627) 2025-04-29 19:21:16 -03:00
thinking_tool Add thinking tool (#26675) 2025-03-14 16:26:22 -04:00
ui agent: Render path search results with ToolCard (#28894) 2025-04-25 14:42:51 -03:00
assistant_tools.rs Fix agent reading and editing files over SSH (#30144) 2025-05-07 17:07:01 +00:00
copy_path_tool.rs Fix agent reading and editing files over SSH (#30144) 2025-05-07 17:07:01 +00:00
create_directory_tool.rs Fix agent reading and editing files over SSH (#30144) 2025-05-07 17:07:01 +00:00
delete_path_tool.rs Fix agent reading and editing files over SSH (#30144) 2025-05-07 17:07:01 +00:00
diagnostics_tool.rs Fix agent reading and editing files over SSH (#30144) 2025-05-07 17:07:01 +00:00
edit_agent.rs Avoid panicking when edit agent emits an empty old_text tag (#30030) 2025-05-06 18:20:10 +00:00
edit_file_tool.rs editor: Use default gutter margin instead of horizontal_padding for horizontal content padding (#30138) 2025-05-07 18:23:54 +00:00
fetch_tool.rs Fix agent reading and editing files over SSH (#30144) 2025-05-07 17:07:01 +00:00
find_path_tool.rs Fix agent reading and editing files over SSH (#30144) 2025-05-07 17:07:01 +00:00
grep_tool.rs Fix agent reading and editing files over SSH (#30144) 2025-05-07 17:07:01 +00:00
list_directory_tool.rs Fix agent reading and editing files over SSH (#30144) 2025-05-07 17:07:01 +00:00
move_path_tool.rs Fix agent reading and editing files over SSH (#30144) 2025-05-07 17:07:01 +00:00
now_tool.rs Fix agent reading and editing files over SSH (#30144) 2025-05-07 17:07:01 +00:00
open_tool.rs Fix agent reading and editing files over SSH (#30144) 2025-05-07 17:07:01 +00:00
read_file_tool.rs Fix agent reading and editing files over SSH (#30144) 2025-05-07 17:07:01 +00:00
schema.rs agent: Improve compatibility when using MCP servers with Gemini models (#28700) 2025-04-14 21:55:25 +02:00
templates.rs Introduce a new StreamingEditFileTool (#29733) 2025-05-01 17:37:43 +02:00
terminal_tool.rs Fix agent reading and editing files over SSH (#30144) 2025-05-07 17:07:01 +00:00
thinking_tool.rs Fix agent reading and editing files over SSH (#30144) 2025-05-07 17:07:01 +00:00
ui.rs agent: Refine the web search tool call UI (#29190) 2025-04-22 09:51:57 -03:00
web_search_tool.rs Fix agent reading and editing files over SSH (#30144) 2025-05-07 17:07:01 +00:00