LSP debug logs: Default to soft wrap + fold long lines + autoscroll (#22996)
Closes #18737 Release notes: - Improved LSP debug logs by defaulting to soft wrap and folding a suffix of long lines. Also adds autoscroll, so if the cursor is on the last line of the logs they will scroll like `tail`.
This commit is contained in:
parent
40ecc38dd2
commit
bbbd1e9902
2 changed files with 27 additions and 2 deletions
|
@ -10901,6 +10901,20 @@ impl Editor {
|
|||
self.fold_creases(ranges, true, cx);
|
||||
}
|
||||
|
||||
pub fn fold_ranges<T: ToOffset + Clone>(
|
||||
&mut self,
|
||||
ranges: Vec<Range<T>>,
|
||||
auto_scroll: bool,
|
||||
cx: &mut ViewContext<Self>,
|
||||
) {
|
||||
let display_map = self.display_map.update(cx, |map, cx| map.snapshot(cx));
|
||||
let ranges = ranges
|
||||
.into_iter()
|
||||
.map(|r| Crease::simple(r, display_map.fold_placeholder.clone()))
|
||||
.collect::<Vec<_>>();
|
||||
self.fold_creases(ranges, auto_scroll, cx);
|
||||
}
|
||||
|
||||
pub fn fold_creases<T: ToOffset + Clone>(
|
||||
&mut self,
|
||||
creases: Vec<Crease<T>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue