Skip to content

Handle soft wrap modes when computing wrap width#46422

Merged
Anthony-Eid merged 4 commits intozed-industries:mainfrom
mchisolm0:fix-respecting-soft-wrap
Feb 5, 2026
Merged

Handle soft wrap modes when computing wrap width#46422
Anthony-Eid merged 4 commits intozed-industries:mainfrom
mchisolm0:fix-respecting-soft-wrap

Conversation

@mchisolm0
Copy link
Copy Markdown
Collaborator

@mchisolm0 mchisolm0 commented Jan 9, 2026

Partially closes #44748

Release Notes:

  • git: Fixed the git panel commit editor not respecting soft wrap settings
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jan 9, 2026
@mchisolm0
Copy link
Copy Markdown
Collaborator Author

I believe this is almost identical to the logic in prepaint. Would it be worth pulling out the logic in case soft wrap options change? link to prepaint version of the logic

Also, I believe the areas this change could impact already override soft wrap behavior. For example, the AutoHeight Editors I saw for the agent UI seem to use MessageEditor link to soft wrap override.

I have tested the prompt message editor and the inline message editor to make sure even with the below settings, the text still wraps to the editor width.

{
  "soft_wrap": "preferred_line_length",
  "preferred_line_length": 72,
}
@cole-miller
Copy link
Copy Markdown
Member

Hi @mchisolm0, thanks--this change makes sense to me, I like the idea of extracting the logic but happy to merge either with or without that.


match soft_wrap {
SoftWrap::GitDiff => None,
SoftWrap::None => Some(wrap_width_for(MAX_LINE_LEN as u32 / 2)),
Copy link
Copy Markdown
Collaborator Author

@mchisolm0 mchisolm0 Feb 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I overlooked handling SoftWrap::None initially in the first commit.

The goal is to have the the git panel commit message editor, the main editor, and any other AutoHeight editors match soft wrap behavior, right?

@mchisolm0
Copy link
Copy Markdown
Collaborator Author

Hi @cole-miller thanks! 😁 I have tested the change with each soft wrap setting in multiple places I expected it to affect.

Is it expected behavior that this change would impact anything in the agent thread view?

I thought my previous testing showed it did not. This time I noticed on Nightly with opencode ACP, a code block in the agent thread seemed to be soft wrapping to my preferred line length but the dev build did not. I think it is unrelated and I can not reproduce it. I just wanted to mention it and ask.

@mchisolm0 mchisolm0 marked this pull request as ready for review February 1, 2026 07:43
@Anthony-Eid Anthony-Eid enabled auto-merge (squash) February 5, 2026 08:20
@Anthony-Eid Anthony-Eid merged commit 053a8fe into zed-industries:main Feb 5, 2026
29 checks passed
rtfeldman pushed a commit that referenced this pull request Feb 5, 2026
Partially closes #44748 

Release Notes:

- Fixed the git side panel to respect soft wrap settings

---------

Co-authored-by: Anthony Eid <anthony@zed.dev>
naaiyy added a commit to Glass-HQ/Glass that referenced this pull request Feb 16, 2026
Key changes:
- Thermal state detection (zed-industries#45638) - GPUI detects system thermal state, throttles to ~60fps when overheating
- Checkerboard shader for side-by-side diff (zed-industries#48417) - visual pattern for diff backgrounds
- cosmic-text v0.17 (zed-industries#48504) - fixes font ligatures on Linux
- Middle click tab close (zed-industries#44916) - on_aux_click/is_middle_click API additions
- Soft wrap modes for wrap width (zed-industries#46422)
- Tab switcher mode similar to vim/helix buffer picker (zed-industries#47079)
- Multi_buffer optimization batch (zed-industries#48519)
- TreeMap for diagnostics (zed-industries#48482) - performance improvement
- Semantic token follow-up fixes (zed-industries#48485)
- Claude Opus 4.6 and 1M context window model variants (zed-industries#48508)
- Anthropic adaptive thinking types (zed-industries#48517)
- Side-by-side diff: hunk gutter highlights restored, toolbar buttons for SplittableEditor
- Shell quote bypass fix in terminal permission system (zed-industries#48436)
- Project panel: Collapse All improvements (zed-industries#47328, zed-industries#48443)
- Edit prediction: trailing newlines fix, cursor position in global coords
- Properly discard tokens on language server stop (zed-industries#48490)
- AgentTool::NAME const instead of hardcoded strings (zed-industries#48506)

Conflict resolution:
- collab/editor_tests.rs: deleted (collab removed)
- vim (helix, motion, increment): deleted (vim removed)
- GPUI (17 files): deleted from Glass (handled in Obsydian-HQ/gpui)
- editor/items.rs: merged imports (added BufferId, kept Theme)
- project_diff.rs: removed old native_button toggle (upstream uses toolbar buttons now)
- lsp_store.rs: added SemanticTokenConfig, removed GlobalLogStore/LanguageServerKind
- project_panel.rs: merged UI imports (added ContextMenuEntry, ScrollAxes)
- Keymaps: took upstream JetBrains bindings

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

4 participants