From: root Date: Sun, 15 Jan 2006 05:14:12 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=57dd0b58aba6cefeabe52027a3b3d8991d39b99f;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/Changes b/Changes index 3f7cb586..a130e04a 100644 --- a/Changes +++ b/Changes @@ -12,11 +12,18 @@ WISH: just for fun, do shade and tint with XRender. WISH: support tex fonts 9.0 -TODO: scroll lines into scrollback when tscroll==0, regardless of bscrol + - use the scrollback buffer even when the scroll region doesn't + span the whole screen, as long as it starts at row 0. + - selection popup now shows selection in dec/hex/oct. + - perl/selection: matching on unicode characters in the selection + code was O(n²), which equals infinity in some degenerate cases + :-> Matching is now done on UTF-8, which makes it almost instant. + - perl/selection, perl/selection-autotransform: regexes are now + being interpreted in the locale urxvt was started. + - applied many patches by Emanuele Giaquinta that clean the code up + and fix more bugs in the utmp logging code. - add tsl/fsl and related capabilities to the terminfo description, to set the window title. - - selection popup now shows selection in dec/hex/oct. - - fix some bugs in the utmp logging code. 7.0 Fri Jan 13 14:02:18 CET 2006 - added sections for DISTRIBUTION MAINTAINERS and about diff --git a/src/logging.C b/src/logging.C index 36a9501f..5363d57d 100644 --- a/src/logging.C +++ b/src/logging.C @@ -46,11 +46,11 @@ #ifdef UTMP_SUPPORT #if HAVE_STRUCT_UTMP -int rxvt_write_bsd_utmp (int utmp_pos, struct utmp *wu); -void rxvt_update_wtmp (const char *fname, const struct utmp *putmp); +static int rxvt_write_bsd_utmp (int utmp_pos, struct utmp *wu); +static void rxvt_update_wtmp (const char *fname, const struct utmp *putmp); #endif -void rxvt_update_lastlog (const char *fname, const char *pty, const char *host); +static void rxvt_update_lastlog (const char *fname, const char *pty, const char *host); /* * BSD style utmp entry @@ -73,15 +73,13 @@ rxvt_term::makeutent (const char *pty, const char *hostname) #ifdef HAVE_STRUCT_UTMPX struct utmpx *utx = &this->utx; #endif -#ifdef HAVE_UTMP_PID int i; -#endif struct passwd *pwent = getpwuid (getuid ()); if (!strncmp (pty, "/dev/", 5)) pty += 5; /* skip /dev/ prefix */ -#ifdef HAVE_UTMP_PID +#if defined(HAVE_UTMP_PID) || defined(HAVE_STRUCT_UTMPX) if (!strncmp (pty, "pty", 3) || !strncmp (pty, "tty", 3)) strncpy (ut_id, pty + 3, sizeof (ut_id)); else if (sscanf (pty, "pts/%d", &i) == 1) @@ -169,7 +167,6 @@ rxvt_term::makeutent (const char *pty, const char *hostname) #if defined(HAVE_STRUCT_UTMP) && !defined(HAVE_UTMP_PID) { - int i; # ifdef HAVE_TTYSLOT i = ttyslot (); if (rxvt_write_bsd_utmp (i, ut)) @@ -330,8 +327,8 @@ rxvt_term::cleanutent () /* * Write a BSD style utmp entry */ -#ifdef HAVE_UTMP_H -int +#if defined(HAVE_STRUCT_UTMP) && !defined(HAVE_UTMP_PID) +static int rxvt_write_bsd_utmp (int utmp_pos, struct utmp *wu) { int fd; @@ -351,7 +348,7 @@ rxvt_write_bsd_utmp (int utmp_pos, struct utmp *wu) * Update a BSD style wtmp entry */ #if defined(WTMP_SUPPORT) && !defined(HAVE_UPDWTMP) && defined(HAVE_STRUCT_UTMP) -void +static void rxvt_update_wtmp (const char *fname, const struct utmp *putmp) { int fd, gotlock, retry; @@ -392,7 +389,7 @@ rxvt_update_wtmp (const char *fname, const struct utmp *putmp) /* ------------------------------------------------------------------------- */ #ifdef LASTLOG_SUPPORT -void +static void rxvt_update_lastlog (const char *fname, const char *pty, const char *host) { # ifdef HAVE_STRUCT_LASTLOGX diff --git a/src/perl/selection b/src/perl/selection index d5fdd8b2..ca71f9c3 100644 --- a/src/perl/selection +++ b/src/perl/selection @@ -14,6 +14,7 @@ sub on_init { for (my $idx = 0; defined (my $res = $self->x_resource ("selection.pattern-$idx")); $idx++) { no re 'eval'; # just to be sure + $res = utf8::encode $self->locale_decode ($res); push @{ $self->{patterns} }, qr/$res/; } @@ -67,6 +68,12 @@ sub on_sel_extend { my @matches; + # not doing matches in unicode mode helps speed + # enourmously here. working in utf-8 should be + # equivalent due to the magic of utf-8 encoding. + utf8::encode $text; + study $text; # _really_ helps, too :) + for my $regex (@mark_patterns, @{ $self->{patterns} }) { while ($text =~ /$regex/g) { if ($-[1] <= $markofs and $markofs <= $+[1]) { diff --git a/src/perl/selection-autotransform b/src/perl/selection-autotransform index 48e3c02c..22d5bbb6 100644 --- a/src/perl/selection-autotransform +++ b/src/perl/selection-autotransform @@ -20,6 +20,7 @@ sub on_init { } for (my $idx = 0; defined (my $res = urxvt::untaint $self->x_resource ("selection-autotransform.$idx")); $idx++) { + $res = $self->locale_decode ($res); my $transform = eval "sub { $res }"; if ($transform) { diff --git a/src/screen.C b/src/screen.C index 56c2dfb2..77d35759 100644 --- a/src/screen.C +++ b/src/screen.C @@ -615,15 +615,48 @@ rxvt_term::scr_scroll_text (int row1, int row2, int count) if (count > 0 && row1 == 0 - && row2 == nrow - 1 && (current_screen == PRIMARY || OPTION (Opt_secondaryScroll))) { nsaved = min (nsaved + count, saveLines); HOOK_INVOKE ((this, HOOK_SCROLL_BACK, DT_INT, count, DT_INT, nsaved, DT_END)); + // scroll everything up 'count' lines term_start = (term_start + count) % total_rows; + { + // severe bottommost scrolled line + line_t &l = ROW(row2 - count); + l.touch (); + l.is_longer (0); + } + + // erase newly scorlled-in lines + for (int i = count; i; --i ) + { + // basically this is a slightly optimized scr_blank_screen_mem + // it is worth the effort on slower machines + line_t &l = ROW(nrow - i); + + scr_blank_line (l, 0, l.l, rstyle); + + l.l = 0; + l.f = 0; + } + + // now copy lines below the scroll region bottom to the + // bottom of the screen again, so they look as if they + // hadn't moved. + for (int i = nrow; --i > row2; ) + { + line_t &l1 = ROW(i - count); + line_t &l2 = ROW(i); + + ::swap (l1, l2); + l2.touch (); + } + + // move and/or clear selection, if any if (selection.op && current_screen == selection.screen) { selection.beg.row -= count; @@ -639,18 +672,7 @@ rxvt_term::scr_scroll_text (int row1, int row2, int count) } } - for (int i = count; i--; ) - { - // basically thi is a slightly optimized scr_blank_screen_mem - // it is worth the effort on slower machines - line_t &l = ROW(row2 - i); - - scr_blank_line (l, 0, l.l, rstyle); - - l.l = 0; - l.f = 0; - } - + // finally move the view window, if desired if (OPTION (Opt_scrollWithBuffer) && view_start != 0 && view_start != saveLines)