Closes #ISSUE

Release Notes:

- vim: Added gq/gw for rewrapping lines
This commit is contained in:
Conrad Irwin
2024-09-20 13:02:39 -06:00
committed by GitHub
parent 7dac5594cd
commit 45388805ad
7 changed files with 177 additions and 3 deletions
+5 -1
View File
@@ -6705,6 +6705,10 @@ impl Editor {
}
pub fn rewrap(&mut self, _: &Rewrap, cx: &mut ViewContext<Self>) {
self.rewrap_impl(true, cx)
}
pub fn rewrap_impl(&mut self, only_text: bool, cx: &mut ViewContext<Self>) {
let buffer = self.buffer.read(cx).snapshot(cx);
let selections = self.selections.all::<Point>(cx);
let mut selections = selections.iter().peekable();
@@ -6725,7 +6729,7 @@ impl Editor {
continue;
}
let mut should_rewrap = false;
let mut should_rewrap = !only_text;
if let Some(language_scope) = buffer.language_scope_at(selection.head()) {
match language_scope.language_name().0.as_ref() {