Skip to content

Commit 717c56f

Browse files
committed
Remove unneeded 'use's from RichText/TreeView
1 parent 83146bf commit 717c56f

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

lib/Terminal/Widgets/RichText.rakumod

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# ABSTRACT: A text widget that has clickable lines / a selected line.
22

3-
use Text::MiscUtils::Layout;
4-
53
use Terminal::Widgets::Events;
6-
use Terminal::Widgets::SpanStyle;
7-
use Terminal::Widgets::SpanBuffer;
84
use Terminal::Widgets::Focusable;
95
use Terminal::Widgets::SpanWrappingAndHighlighting;
106

@@ -19,8 +15,7 @@ class Terminal::Widgets::RichText
1915
$!wrap = $wrap if $wrap;
2016
}
2117

22-
#| Replace the contents of this RichText widget.
23-
method set-text(SpanContent $content) {
18+
method set-text($content) {
2419
self!set-text: $content;
2520
}
2621

lib/Terminal/Widgets/TreeView.rakumod

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# ABSTRACT: A text widget that has clickable lines / a selected line.
22

3-
use Text::MiscUtils::Layout;
4-
53
use Terminal::Widgets::Events;
6-
use Terminal::Widgets::SpanStyle;
7-
use Terminal::Widgets::SpanBuffer;
84
use Terminal::Widgets::Focusable;
95
use Terminal::Widgets::SpanWrappingAndHighlighting;
106

@@ -386,7 +382,8 @@ class Terminal::Widgets::TreeView
386382
self.x-scroll + $x, $rel-y);
387383
$!cursor-x = $x min self!chars-in-line(@!lines[$line-index]) - 1;
388384

389-
my $prefix-len = duospace-width(self!dn-get-prefix($dn));
385+
my $locale = $.terminal.locale;
386+
my $prefix-len = $locale.width(self!dn-get-prefix($dn));
390387
if $!cursor-x < $prefix-len {
391388
self!toggle-expand-dn($dn);
392389
}

0 commit comments

Comments
 (0)