Is there a way to FULLY turn off soft wrap? #26344
Unanswered
swpalmer-cl
asked this question in
General Q&A
Replies: 2 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() |
Beta Was this translation helpful? Give feedback.
0 replies
-
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. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Beta Was this translation helpful? Give feedback.
All reactions