vim: gq (#18156)
Closes #ISSUE Release Notes: - vim: Added gq/gw for rewrapping lines
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user