1use super::{Bias, DisplayPoint, DisplaySnapshot, SelectionGoal, ToDisplayPoint};
2use crate::{char_kind, CharKind, ToPoint};
3use language::Point;
4use std::ops::Range;
5
6pub fn left(map: &DisplaySnapshot, mut point: DisplayPoint) -> DisplayPoint {
7 if point.column() > 0 {
8 *point.column_mut() -= 1;
9 } else if point.row() > 0 {
10 *point.row_mut() -= 1;
11 *point.column_mut() = map.line_len(point.row());
12 }
13 map.clip_point(point, Bias::Left)
14}
15
16pub fn right(map: &DisplaySnapshot, mut point: DisplayPoint) -> DisplayPoint {
17 let max_column = map.line_len(point.row());
18 if point.column() < max_column {
19 *point.column_mut() += 1;
20 } else if point.row() < map.max_point().row() {
21 *point.row_mut() += 1;
22 *point.column_mut() = 0;
23 }
24 map.clip_point(point, Bias::Right)
25}
26
27pub fn up(
28 map: &DisplaySnapshot,
29 start: DisplayPoint,
30 goal: SelectionGoal,
31 preserve_column_at_start: bool,
32) -> (DisplayPoint, SelectionGoal) {
33 up_by_rows(map, start, 1, goal, preserve_column_at_start)
34}
35
36pub fn down(
37 map: &DisplaySnapshot,
38 start: DisplayPoint,
39 goal: SelectionGoal,
40 preserve_column_at_end: bool,
41) -> (DisplayPoint, SelectionGoal) {
42 down_by_rows(map, start, 1, goal, preserve_column_at_end)
43}
44
45pub fn up_by_rows(
46 map: &DisplaySnapshot,
47 start: DisplayPoint,
48 row_count: u32,
49 goal: SelectionGoal,
50 preserve_column_at_start: bool,
51) -> (DisplayPoint, SelectionGoal) {
52 let mut goal_column = if let SelectionGoal::Column(column) = goal {
53 column
54 } else {
55 map.column_to_chars(start.row(), start.column())
56 };
57
58 let prev_row = start.row().saturating_sub(row_count);
59 let mut point = map.clip_point(
60 DisplayPoint::new(prev_row, map.line_len(prev_row)),
61 Bias::Left,
62 );
63 if point.row() < start.row() {
64 *point.column_mut() = map.column_from_chars(point.row(), goal_column);
65 } else if preserve_column_at_start {
66 return (start, goal);
67 } else {
68 point = DisplayPoint::new(0, 0);
69 goal_column = 0;
70 }
71
72 let mut clipped_point = map.clip_point(point, Bias::Left);
73 if clipped_point.row() < point.row() {
74 clipped_point = map.clip_point(point, Bias::Right);
75 }
76 (clipped_point, SelectionGoal::Column(goal_column))
77}
78
79pub fn down_by_rows(
80 map: &DisplaySnapshot,
81 start: DisplayPoint,
82 row_count: u32,
83 goal: SelectionGoal,
84 preserve_column_at_end: bool,
85) -> (DisplayPoint, SelectionGoal) {
86 let mut goal_column = if let SelectionGoal::Column(column) = goal {
87 column
88 } else {
89 map.column_to_chars(start.row(), start.column())
90 };
91
92 let new_row = start.row() + row_count;
93 let mut point = map.clip_point(DisplayPoint::new(new_row, 0), Bias::Right);
94 if point.row() > start.row() {
95 *point.column_mut() = map.column_from_chars(point.row(), goal_column);
96 } else if preserve_column_at_end {
97 return (start, goal);
98 } else {
99 point = map.max_point();
100 goal_column = map.column_to_chars(point.row(), point.column())
101 }
102
103 let mut clipped_point = map.clip_point(point, Bias::Right);
104 if clipped_point.row() > point.row() {
105 clipped_point = map.clip_point(point, Bias::Left);
106 }
107 (clipped_point, SelectionGoal::Column(goal_column))
108}
109
110pub fn line_beginning(
111 map: &DisplaySnapshot,
112 display_point: DisplayPoint,
113 stop_at_soft_boundaries: bool,
114) -> DisplayPoint {
115 let point = display_point.to_point(map);
116 let soft_line_start = map.clip_point(DisplayPoint::new(display_point.row(), 0), Bias::Right);
117 let line_start = map.prev_line_boundary(point).1;
118
119 if stop_at_soft_boundaries && display_point != soft_line_start {
120 soft_line_start
121 } else {
122 line_start
123 }
124}
125
126pub fn indented_line_beginning(
127 map: &DisplaySnapshot,
128 display_point: DisplayPoint,
129 stop_at_soft_boundaries: bool,
130) -> DisplayPoint {
131 let point = display_point.to_point(map);
132 let soft_line_start = map.clip_point(DisplayPoint::new(display_point.row(), 0), Bias::Right);
133 let indent_start = Point::new(
134 point.row,
135 map.buffer_snapshot.indent_size_for_line(point.row).len,
136 )
137 .to_display_point(map);
138 let line_start = map.prev_line_boundary(point).1;
139
140 if stop_at_soft_boundaries && soft_line_start > indent_start && display_point != soft_line_start
141 {
142 soft_line_start
143 } else if stop_at_soft_boundaries && display_point != indent_start {
144 indent_start
145 } else {
146 line_start
147 }
148}
149
150pub fn line_end(
151 map: &DisplaySnapshot,
152 display_point: DisplayPoint,
153 stop_at_soft_boundaries: bool,
154) -> DisplayPoint {
155 let soft_line_end = map.clip_point(
156 DisplayPoint::new(display_point.row(), map.line_len(display_point.row())),
157 Bias::Left,
158 );
159 if stop_at_soft_boundaries && display_point != soft_line_end {
160 soft_line_end
161 } else {
162 map.next_line_boundary(display_point.to_point(map)).1
163 }
164}
165
166pub fn previous_word_start(map: &DisplaySnapshot, point: DisplayPoint) -> DisplayPoint {
167 find_preceding_boundary(map, point, |left, right| {
168 (char_kind(left) != char_kind(right) && !right.is_whitespace()) || left == '\n'
169 })
170}
171
172pub fn previous_subword_start(map: &DisplaySnapshot, point: DisplayPoint) -> DisplayPoint {
173 find_preceding_boundary(map, point, |left, right| {
174 let is_word_start = char_kind(left) != char_kind(right) && !right.is_whitespace();
175 let is_subword_start =
176 left == '_' && right != '_' || left.is_lowercase() && right.is_uppercase();
177 is_word_start || is_subword_start || left == '\n'
178 })
179}
180
181pub fn next_word_end(map: &DisplaySnapshot, point: DisplayPoint) -> DisplayPoint {
182 find_boundary(map, point, |left, right| {
183 (char_kind(left) != char_kind(right) && !left.is_whitespace()) || right == '\n'
184 })
185}
186
187pub fn next_subword_end(map: &DisplaySnapshot, point: DisplayPoint) -> DisplayPoint {
188 find_boundary(map, point, |left, right| {
189 let is_word_end = (char_kind(left) != char_kind(right)) && !left.is_whitespace();
190 let is_subword_end =
191 left != '_' && right == '_' || left.is_lowercase() && right.is_uppercase();
192 is_word_end || is_subword_end || right == '\n'
193 })
194}
195
196/// Scans for a boundary preceding the given start point `from` until a boundary is found, indicated by the
197/// given predicate returning true. The predicate is called with the character to the left and right
198/// of the candidate boundary location, and will be called with `\n` characters indicating the start
199/// or end of a line.
200pub fn find_preceding_boundary(
201 map: &DisplaySnapshot,
202 from: DisplayPoint,
203 mut is_boundary: impl FnMut(char, char) -> bool,
204) -> DisplayPoint {
205 let mut start_column = 0;
206 let mut soft_wrap_row = from.row() + 1;
207
208 let mut prev = None;
209 for (ch, point) in map.reverse_chars_at(from) {
210 // Recompute soft_wrap_indent if the row has changed
211 if point.row() != soft_wrap_row {
212 soft_wrap_row = point.row();
213
214 if point.row() == 0 {
215 start_column = 0;
216 } else if let Some(indent) = map.soft_wrap_indent(point.row() - 1) {
217 start_column = indent;
218 }
219 }
220
221 // If the current point is in the soft_wrap, skip comparing it
222 if point.column() < start_column {
223 continue;
224 }
225
226 if let Some((prev_ch, prev_point)) = prev {
227 if is_boundary(ch, prev_ch) {
228 return prev_point;
229 }
230 }
231
232 prev = Some((ch, point));
233 }
234 DisplayPoint::zero()
235}
236
237/// Scans for a boundary preceding the given start point `from` until a boundary is found, indicated by the
238/// given predicate returning true. The predicate is called with the character to the left and right
239/// of the candidate boundary location, and will be called with `\n` characters indicating the start
240/// or end of a line. If no boundary is found, the start of the line is returned.
241pub fn find_preceding_boundary_in_line(
242 map: &DisplaySnapshot,
243 from: DisplayPoint,
244 mut is_boundary: impl FnMut(char, char) -> bool,
245) -> DisplayPoint {
246 let mut start_column = 0;
247 if from.row() > 0 {
248 if let Some(indent) = map.soft_wrap_indent(from.row() - 1) {
249 start_column = indent;
250 }
251 }
252
253 let mut prev = None;
254 for (ch, point) in map.reverse_chars_at(from) {
255 if let Some((prev_ch, prev_point)) = prev {
256 if is_boundary(ch, prev_ch) {
257 return prev_point;
258 }
259 }
260
261 if ch == '\n' || point.column() < start_column {
262 break;
263 }
264
265 prev = Some((ch, point));
266 }
267
268 prev.map(|(_, point)| point).unwrap_or(from)
269}
270
271/// Scans for a boundary following the given start point until a boundary is found, indicated by the
272/// given predicate returning true. The predicate is called with the character to the left and right
273/// of the candidate boundary location, and will be called with `\n` characters indicating the start
274/// or end of a line.
275pub fn find_boundary(
276 map: &DisplaySnapshot,
277 from: DisplayPoint,
278 mut is_boundary: impl FnMut(char, char) -> bool,
279) -> DisplayPoint {
280 let mut prev_ch = None;
281 for (ch, point) in map.chars_at(from) {
282 if let Some(prev_ch) = prev_ch {
283 if is_boundary(prev_ch, ch) {
284 return map.clip_point(point, Bias::Right);
285 }
286 }
287
288 prev_ch = Some(ch);
289 }
290 map.clip_point(map.max_point(), Bias::Right)
291}
292
293/// Scans for a boundary following the given start point until a boundary is found, indicated by the
294/// given predicate returning true. The predicate is called with the character to the left and right
295/// of the candidate boundary location, and will be called with `\n` characters indicating the start
296/// or end of a line. If no boundary is found, the end of the line is returned
297pub fn find_boundary_in_line(
298 map: &DisplaySnapshot,
299 from: DisplayPoint,
300 mut is_boundary: impl FnMut(char, char) -> bool,
301) -> DisplayPoint {
302 let mut prev = None;
303 for (ch, point) in map.chars_at(from) {
304 if let Some((prev_ch, _)) = prev {
305 if is_boundary(prev_ch, ch) {
306 return map.clip_point(point, Bias::Right);
307 }
308 }
309
310 prev = Some((ch, point));
311
312 if ch == '\n' {
313 break;
314 }
315 }
316
317 // Return the last position checked so that we give a point right before the newline or eof.
318 map.clip_point(prev.map(|(_, point)| point).unwrap_or(from), Bias::Right)
319}
320
321pub fn is_inside_word(map: &DisplaySnapshot, point: DisplayPoint) -> bool {
322 let ix = map.clip_point(point, Bias::Left).to_offset(map, Bias::Left);
323 let text = &map.buffer_snapshot;
324 let next_char_kind = text.chars_at(ix).next().map(char_kind);
325 let prev_char_kind = text.reversed_chars_at(ix).next().map(char_kind);
326 prev_char_kind.zip(next_char_kind) == Some((CharKind::Word, CharKind::Word))
327}
328
329pub fn surrounding_word(map: &DisplaySnapshot, position: DisplayPoint) -> Range<DisplayPoint> {
330 let position = map
331 .clip_point(position, Bias::Left)
332 .to_offset(map, Bias::Left);
333 let (range, _) = map.buffer_snapshot.surrounding_word(position);
334 let start = range
335 .start
336 .to_point(&map.buffer_snapshot)
337 .to_display_point(map);
338 let end = range
339 .end
340 .to_point(&map.buffer_snapshot)
341 .to_display_point(map);
342 start..end
343}
344
345pub fn split_display_range_by_lines(
346 map: &DisplaySnapshot,
347 range: Range<DisplayPoint>,
348) -> Vec<Range<DisplayPoint>> {
349 let mut result = Vec::new();
350
351 let mut start = range.start;
352 // Loop over all the covered rows until the one containing the range end
353 for row in range.start.row()..range.end.row() {
354 let row_end_column = map.line_len(row);
355 let end = map.clip_point(DisplayPoint::new(row, row_end_column), Bias::Left);
356 if start != end {
357 result.push(start..end);
358 }
359 start = map.clip_point(DisplayPoint::new(row + 1, 0), Bias::Left);
360 }
361
362 // Add the final range from the start of the last end to the original range end.
363 result.push(start..range.end);
364
365 result
366}
367
368#[cfg(test)]
369mod tests {
370 use super::*;
371 use crate::{test::marked_display_snapshot, Buffer, DisplayMap, ExcerptRange, MultiBuffer};
372 use settings::SettingsStore;
373
374 #[gpui::test]
375 fn test_previous_word_start(cx: &mut gpui::AppContext) {
376 init_test(cx);
377
378 fn assert(marked_text: &str, cx: &mut gpui::AppContext) {
379 let (snapshot, display_points) = marked_display_snapshot(marked_text, cx);
380 assert_eq!(
381 previous_word_start(&snapshot, display_points[1]),
382 display_points[0]
383 );
384 }
385
386 assert("\nˇ ˇlorem", cx);
387 assert("ˇ\nˇ lorem", cx);
388 assert(" ˇloremˇ", cx);
389 assert("ˇ ˇlorem", cx);
390 assert(" ˇlorˇem", cx);
391 assert("\nlorem\nˇ ˇipsum", cx);
392 assert("\n\nˇ\nˇ", cx);
393 assert(" ˇlorem ˇipsum", cx);
394 assert("loremˇ-ˇipsum", cx);
395 assert("loremˇ-#$@ˇipsum", cx);
396 assert("ˇlorem_ˇipsum", cx);
397 assert(" ˇdefγˇ", cx);
398 assert(" ˇbcΔˇ", cx);
399 assert(" abˇ——ˇcd", cx);
400 }
401
402 #[gpui::test]
403 fn test_previous_subword_start(cx: &mut gpui::AppContext) {
404 init_test(cx);
405
406 fn assert(marked_text: &str, cx: &mut gpui::AppContext) {
407 let (snapshot, display_points) = marked_display_snapshot(marked_text, cx);
408 assert_eq!(
409 previous_subword_start(&snapshot, display_points[1]),
410 display_points[0]
411 );
412 }
413
414 // Subword boundaries are respected
415 assert("lorem_ˇipˇsum", cx);
416 assert("lorem_ˇipsumˇ", cx);
417 assert("ˇlorem_ˇipsum", cx);
418 assert("lorem_ˇipsum_ˇdolor", cx);
419 assert("loremˇIpˇsum", cx);
420 assert("loremˇIpsumˇ", cx);
421
422 // Word boundaries are still respected
423 assert("\nˇ ˇlorem", cx);
424 assert(" ˇloremˇ", cx);
425 assert(" ˇlorˇem", cx);
426 assert("\nlorem\nˇ ˇipsum", cx);
427 assert("\n\nˇ\nˇ", cx);
428 assert(" ˇlorem ˇipsum", cx);
429 assert("loremˇ-ˇipsum", cx);
430 assert("loremˇ-#$@ˇipsum", cx);
431 assert(" ˇdefγˇ", cx);
432 assert(" bcˇΔˇ", cx);
433 assert(" ˇbcδˇ", cx);
434 assert(" abˇ——ˇcd", cx);
435 }
436
437 #[gpui::test]
438 fn test_find_preceding_boundary(cx: &mut gpui::AppContext) {
439 init_test(cx);
440
441 fn assert(
442 marked_text: &str,
443 cx: &mut gpui::AppContext,
444 is_boundary: impl FnMut(char, char) -> bool,
445 ) {
446 let (snapshot, display_points) = marked_display_snapshot(marked_text, cx);
447 assert_eq!(
448 find_preceding_boundary(&snapshot, display_points[1], is_boundary),
449 display_points[0]
450 );
451 }
452
453 assert("abcˇdef\ngh\nijˇk", cx, |left, right| {
454 left == 'c' && right == 'd'
455 });
456 assert("abcdef\nˇgh\nijˇk", cx, |left, right| {
457 left == '\n' && right == 'g'
458 });
459 let mut line_count = 0;
460 assert("abcdef\nˇgh\nijˇk", cx, |left, _| {
461 if left == '\n' {
462 line_count += 1;
463 line_count == 2
464 } else {
465 false
466 }
467 });
468 }
469
470 #[gpui::test]
471 fn test_next_word_end(cx: &mut gpui::AppContext) {
472 init_test(cx);
473
474 fn assert(marked_text: &str, cx: &mut gpui::AppContext) {
475 let (snapshot, display_points) = marked_display_snapshot(marked_text, cx);
476 assert_eq!(
477 next_word_end(&snapshot, display_points[0]),
478 display_points[1]
479 );
480 }
481
482 assert("\nˇ loremˇ", cx);
483 assert(" ˇloremˇ", cx);
484 assert(" lorˇemˇ", cx);
485 assert(" loremˇ ˇ\nipsum\n", cx);
486 assert("\nˇ\nˇ\n\n", cx);
487 assert("loremˇ ipsumˇ ", cx);
488 assert("loremˇ-ˇipsum", cx);
489 assert("loremˇ#$@-ˇipsum", cx);
490 assert("loremˇ_ipsumˇ", cx);
491 assert(" ˇbcΔˇ", cx);
492 assert(" abˇ——ˇcd", cx);
493 }
494
495 #[gpui::test]
496 fn test_next_subword_end(cx: &mut gpui::AppContext) {
497 init_test(cx);
498
499 fn assert(marked_text: &str, cx: &mut gpui::AppContext) {
500 let (snapshot, display_points) = marked_display_snapshot(marked_text, cx);
501 assert_eq!(
502 next_subword_end(&snapshot, display_points[0]),
503 display_points[1]
504 );
505 }
506
507 // Subword boundaries are respected
508 assert("loˇremˇ_ipsum", cx);
509 assert("ˇloremˇ_ipsum", cx);
510 assert("loremˇ_ipsumˇ", cx);
511 assert("loremˇ_ipsumˇ_dolor", cx);
512 assert("loˇremˇIpsum", cx);
513 assert("loremˇIpsumˇDolor", cx);
514
515 // Word boundaries are still respected
516 assert("\nˇ loremˇ", cx);
517 assert(" ˇloremˇ", cx);
518 assert(" lorˇemˇ", cx);
519 assert(" loremˇ ˇ\nipsum\n", cx);
520 assert("\nˇ\nˇ\n\n", cx);
521 assert("loremˇ ipsumˇ ", cx);
522 assert("loremˇ-ˇipsum", cx);
523 assert("loremˇ#$@-ˇipsum", cx);
524 assert("loremˇ_ipsumˇ", cx);
525 assert(" ˇbcˇΔ", cx);
526 assert(" abˇ——ˇcd", cx);
527 }
528
529 #[gpui::test]
530 fn test_find_boundary(cx: &mut gpui::AppContext) {
531 init_test(cx);
532
533 fn assert(
534 marked_text: &str,
535 cx: &mut gpui::AppContext,
536 is_boundary: impl FnMut(char, char) -> bool,
537 ) {
538 let (snapshot, display_points) = marked_display_snapshot(marked_text, cx);
539 assert_eq!(
540 find_boundary(&snapshot, display_points[0], is_boundary),
541 display_points[1]
542 );
543 }
544
545 assert("abcˇdef\ngh\nijˇk", cx, |left, right| {
546 left == 'j' && right == 'k'
547 });
548 assert("abˇcdef\ngh\nˇijk", cx, |left, right| {
549 left == '\n' && right == 'i'
550 });
551 let mut line_count = 0;
552 assert("abcˇdef\ngh\nˇijk", cx, |left, _| {
553 if left == '\n' {
554 line_count += 1;
555 line_count == 2
556 } else {
557 false
558 }
559 });
560 }
561
562 #[gpui::test]
563 fn test_surrounding_word(cx: &mut gpui::AppContext) {
564 init_test(cx);
565
566 fn assert(marked_text: &str, cx: &mut gpui::AppContext) {
567 let (snapshot, display_points) = marked_display_snapshot(marked_text, cx);
568 assert_eq!(
569 surrounding_word(&snapshot, display_points[1]),
570 display_points[0]..display_points[2]
571 );
572 }
573
574 assert("ˇˇloremˇ ipsum", cx);
575 assert("ˇloˇremˇ ipsum", cx);
576 assert("ˇloremˇˇ ipsum", cx);
577 assert("loremˇ ˇ ˇipsum", cx);
578 assert("lorem\nˇˇˇ\nipsum", cx);
579 assert("lorem\nˇˇipsumˇ", cx);
580 assert("lorem,ˇˇ ˇipsum", cx);
581 assert("ˇloremˇˇ, ipsum", cx);
582 }
583
584 #[gpui::test]
585 fn test_move_up_and_down_with_excerpts(cx: &mut gpui::AppContext) {
586 init_test(cx);
587
588 let family_id = cx
589 .font_cache()
590 .load_family(&["Helvetica"], &Default::default())
591 .unwrap();
592 let font_id = cx
593 .font_cache()
594 .select_font(family_id, &Default::default())
595 .unwrap();
596
597 let buffer = cx.add_model(|cx| Buffer::new(0, "abc\ndefg\nhijkl\nmn", cx));
598 let multibuffer = cx.add_model(|cx| {
599 let mut multibuffer = MultiBuffer::new(0);
600 multibuffer.push_excerpts(
601 buffer.clone(),
602 [
603 ExcerptRange {
604 context: Point::new(0, 0)..Point::new(1, 4),
605 primary: None,
606 },
607 ExcerptRange {
608 context: Point::new(2, 0)..Point::new(3, 2),
609 primary: None,
610 },
611 ],
612 cx,
613 );
614 multibuffer
615 });
616 let display_map =
617 cx.add_model(|cx| DisplayMap::new(multibuffer, font_id, 14.0, None, 2, 2, cx));
618 let snapshot = display_map.update(cx, |map, cx| map.snapshot(cx));
619
620 assert_eq!(snapshot.text(), "\n\nabc\ndefg\n\n\nhijkl\nmn");
621
622 // Can't move up into the first excerpt's header
623 assert_eq!(
624 up(
625 &snapshot,
626 DisplayPoint::new(2, 2),
627 SelectionGoal::Column(2),
628 false
629 ),
630 (DisplayPoint::new(2, 0), SelectionGoal::Column(0)),
631 );
632 assert_eq!(
633 up(
634 &snapshot,
635 DisplayPoint::new(2, 0),
636 SelectionGoal::None,
637 false
638 ),
639 (DisplayPoint::new(2, 0), SelectionGoal::Column(0)),
640 );
641
642 // Move up and down within first excerpt
643 assert_eq!(
644 up(
645 &snapshot,
646 DisplayPoint::new(3, 4),
647 SelectionGoal::Column(4),
648 false
649 ),
650 (DisplayPoint::new(2, 3), SelectionGoal::Column(4)),
651 );
652 assert_eq!(
653 down(
654 &snapshot,
655 DisplayPoint::new(2, 3),
656 SelectionGoal::Column(4),
657 false
658 ),
659 (DisplayPoint::new(3, 4), SelectionGoal::Column(4)),
660 );
661
662 // Move up and down across second excerpt's header
663 assert_eq!(
664 up(
665 &snapshot,
666 DisplayPoint::new(6, 5),
667 SelectionGoal::Column(5),
668 false
669 ),
670 (DisplayPoint::new(3, 4), SelectionGoal::Column(5)),
671 );
672 assert_eq!(
673 down(
674 &snapshot,
675 DisplayPoint::new(3, 4),
676 SelectionGoal::Column(5),
677 false
678 ),
679 (DisplayPoint::new(6, 5), SelectionGoal::Column(5)),
680 );
681
682 // Can't move down off the end
683 assert_eq!(
684 down(
685 &snapshot,
686 DisplayPoint::new(7, 0),
687 SelectionGoal::Column(0),
688 false
689 ),
690 (DisplayPoint::new(7, 2), SelectionGoal::Column(2)),
691 );
692 assert_eq!(
693 down(
694 &snapshot,
695 DisplayPoint::new(7, 2),
696 SelectionGoal::Column(2),
697 false
698 ),
699 (DisplayPoint::new(7, 2), SelectionGoal::Column(2)),
700 );
701 }
702
703 fn init_test(cx: &mut gpui::AppContext) {
704 cx.set_global(SettingsStore::test(cx));
705 theme::init((), cx);
706 language::init(cx);
707 crate::init(cx);
708 }
709}