From 742c60441a713dcecf0071ff19e9d52be51c8954 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Wed, 21 May 2003 15:18:37 +0000 Subject: gtktext_insert: fix indenting of one line, takes that as a pretext to redo whole function identing without tabs --- perl-install/ugtk2.pm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'perl-install') diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm index 53b2eb81d..d7091b4ec 100644 --- a/perl-install/ugtk2.pm +++ b/perl-install/ugtk2.pm @@ -526,22 +526,22 @@ sub gtktext_append { gtktext_insert(@_, append => 1) } sub gtktext_insert { my ($textview, $t, %opts) = @_; my $buffer = $textview->get_buffer; + $opts{append} or $buffer->set_text('', -1); if (ref($t) eq 'ARRAY') { - $opts{append} or $buffer->set_text('', -1); - foreach my $token (@$t) { - my ($iter1, $iter2); - my $c = $buffer->get_char_count; - $buffer->insert($iter1 = $buffer->get_end_iter, $token->[0], -1); + foreach my $token (@$t) { + my ($iter1, $iter2); + my $c = $buffer->get_char_count; + $buffer->insert($iter1 = $buffer->get_end_iter, $token->[0], -1); $iter1->free; - if ($token->[1]) { - my $tag = $buffer->create_tag(undef); - $tag->set(%{$token->[1]}); - $buffer->apply_tag($tag, $iter1 = $buffer->get_iter_at_offset($c), $iter2 = $buffer->get_end_iter); + if ($token->[1]) { + my $tag = $buffer->create_tag(undef); + $tag->set(%{$token->[1]}); + $buffer->apply_tag($tag, $iter1 = $buffer->get_iter_at_offset($c), $iter2 = $buffer->get_end_iter); $iter1->free; $iter2->free; - } - } + } + } } else { - $buffer->set_text($t, -1); + $buffer->set_text($t, -1); } #- the following line is needed to move the cursor to the beginning, so that if the #- textview has a scrollbar, it won't scroll to the bottom when focusing (#3633) -- cgit v1.2.1