Is there a way to FULLY turn off soft wrap? #26344
Replies: 11 comments
|
There is currently no way to completely disable softwrap. in settings /// Controls the soft-wrapping behavior in the editor.
#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum SoftWrap {
/// Prefer a single line generally, unless an overly long line is encountered.
None,
/// Deprecated: use None instead. Left to avoid breaking existing users' configs.
/// Prefer a single line generally, unless an overly long line is encountered.
PreferLine,
/// Soft wrap lines that exceed the editor width.
EditorWidth,
/// Soft wrap lines at the preferred line length.
PreferredLineLength,
/// Soft wrap line at the preferred line length or the editor width (whichever is smaller).
Bounded,
}in editor #[derive(Copy, Clone, Debug)]
pub enum SoftWrap {
/// Prefer not to wrap at all.
///
/// Note: this is currently internal, as actually limited by [`crate::MAX_LINE_LEN`] until it wraps.
/// The mode is used inside git diff hunks, where it's seems currently more useful to not wrap as much as possible.
GitDiff,
/// Prefer a single line generally, unless an overly long line is encountered.
None,
/// Soft wrap lines that exceed the editor width.
EditorWidth,
/// Soft wrap lines at the preferred line length.
Column(u32),
/// Soft wrap line at the preferred line length or the editor width (whichever is smaller).
Bounded(u32),
}implement const MAX_LINE_LEN: usize = 1024;let wrap_width = match editor.soft_wrap_mode(cx) {
SoftWrap::GitDiff => None,
SoftWrap::None => Some((MAX_LINE_LEN / 2) as f32 * em_advance),
SoftWrap::EditorWidth => Some(editor_width),
SoftWrap::Column(column) => Some(column as f32 * em_advance),
SoftWrap::Bounded(column) => {
Some(editor_width.min(column as f32 * em_advance))
}
}; let chunks = snapshot.highlighted_chunks(row..row + DisplayRow(1), true, style);
LineWithInvisibles::from_chunks(
chunks,
&style,
MAX_LINE_LEN,
1,
snapshot.mode,
text_width,
is_row_soft_wrapped,
window,
cx,
)
.pop()
.unwrap() |
|
Recently I had same problem when opened CSV file with 800+ columns. I did not want soft wrap, but even with disabled - it still needs multiple lines instead of one to render one row. Not usable in this case. |
|
Is there a way to fully turn this off? This issue has been bothering me for a long time. |
This comment was marked as spam.
This comment was marked as spam.
|
Also want a way to turn text wrapping completely off. |
This comment was marked as spam.
This comment was marked as spam.
|
Thanks for reaching out. We want to better support our community, and the best way for us to do that is through our official Discord. The team is active there and happy to help. We’re closing the “Help and General Q&A” category on GitHub Discussions and directing all support questions to Discord going forward. |
|
How is this performance-limited? I can understand soft-wrap slowing down on very long lines (e.g. #16120), but what's the problem here? |
This comment was marked as low quality.
This comment was marked as low quality.
|
It might be worth clarifying in the docs, because |
|
***@***.***
|
Uh oh!
There was an error while loading. Please reload this page.
Toggling soft wrap seems to just change the number of lines used for soft wrap. I want soft wrap OFF. One line on the screen per line in the file, horizontal scrolling to see the rest.
Instead with soft wrap on I get six lines in the editor to show the complete line from my file and then with soft wrap off I get two lines in the editor rather than one.
All reactions