aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-06-08 21:03:15 +0200
committerAnton Khirnov <anton@khirnov.net>2021-06-08 21:03:15 +0200
commit16e0bae05dd051e266f5579912c13c6da2441aa1 (patch)
treebd6427635ea51577c81f809c30ddd586750ed925
parentf44da2513c1ae4330ea698e9144fe52f9943ad44 (diff)
Fix typed-text overlay placement.
-rw-r--r--reselect7
1 files changed, 4 insertions, 3 deletions
diff --git a/reselect b/reselect
index 081a44f..760d9b8 100644
--- a/reselect
+++ b/reselect
@@ -147,6 +147,8 @@ sub on_action {
$self->get_rend("prompt", urxvt::OVERLAY_RSTYLE), 0);
$url_picker->{prompt}->set(0, 0, $prompt);
+ $url_picker->{prompt_len} = length $prompt;
+
$url_picker->{results} = $results;
$url_picker->{buffer} = '';
my ($crow,$ccol) = $self->screen_cur;
@@ -193,9 +195,8 @@ sub on_key_press {
sub update {
my ($self, $p) = @_;
- $p->{typing} = $self->overlay(
- 8, -1, length($p->{buffer}), 1, $self->get_rend("input", urxvt::DEFAULT_RSTYLE), 0
- );
+ $p->{typing} = $self->overlay($p->{prompt_len}, -1, length($p->{buffer}), 1,
+ $self->get_rend("input", urxvt::DEFAULT_RSTYLE), 0);
$p->{typing}->set(0,0,$p->{buffer});
my $results = $p->{results};