Skip to content

Commit

Permalink
Post-rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeoneToIgnore committed Sep 2, 2024
1 parent 158bb16 commit a0dfae7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
8 changes: 4 additions & 4 deletions crates/editor/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10577,9 +10577,7 @@ impl Editor {
settings::SoftWrap::PreferredLineLength => {
SoftWrap::Column(settings.preferred_line_length)
}
language_settings::SoftWrap::Bounded => {
SoftWrap::Bounded(settings.preferred_line_length)
}
settings::SoftWrap::Bounded => SoftWrap::Bounded(settings.preferred_line_length),
}
}

Expand Down Expand Up @@ -10617,7 +10615,9 @@ impl Editor {
} else {
let soft_wrap = match self.soft_wrap_mode(cx) {
SoftWrap::None | SoftWrap::PreferLine => settings::SoftWrap::EditorWidth,
SoftWrap::EditorWidth | SoftWrap::Column(_) | SoftWrap::Bounded(_) => settings::SoftWrap::PreferLine,
SoftWrap::EditorWidth | SoftWrap::Column(_) | SoftWrap::Bounded(_) => {
settings::SoftWrap::PreferLine
}
};
self.soft_wrap_mode_override = Some(soft_wrap);
}
Expand Down
9 changes: 7 additions & 2 deletions crates/project/src/lsp_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,14 @@ impl LspStore {
.filter(|_| {
maybe!({
let language_name = buffer.read(cx).language_at(position)?.name();
let abs_path_in_a_worktree = buffer.read(cx).file().and_then(|file| {
let worktree_id = file.worktree_id();
let abs_path = file.abs_path_in_worktree(cx).ok()?;
Some((worktree_id, abs_path))
});
Some(
AllLanguageSettings::get_global(cx)
.language(Some(&language_name))
.language(abs_path_in_a_worktree, Some(&language_name), cx)
.linked_edits,
)
}) == Some(true)
Expand Down Expand Up @@ -791,7 +796,7 @@ impl LspStore {
cx: &mut ModelContext<Self>,
) -> Task<Result<Option<Transaction>>> {
let options = buffer.update(cx, |buffer, cx| {
lsp_command::lsp_formatting_options(language_settings(
lsp_command::lsp_formatting_options(&language_settings(
buffer.language_at(position).as_ref(),
buffer.file(),
cx,
Expand Down
2 changes: 2 additions & 0 deletions crates/settings/src/settings_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ pub enum SoftWrap {
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,
}

/// A set of strongly-typed setting values defined via multiple JSON files.
Expand Down

0 comments on commit a0dfae7

Please sign in to comment.