From: root Date: Sun, 22 Jan 2006 11:57:06 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=69b0e1cef5889518c88a6f5fe2d4b78fb770fac0;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/src/encoding.h b/src/encoding.h index 95920244..2d1657f4 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -65,7 +65,7 @@ codeset codeset_from_name (const char *name); enum { ZERO_WIDTH_CHAR = 0x200b, REPLACEMENT_CHAR = 0xfffd, - NOCHAR = 0xfffe, // must be invalid in ANY codeset (!) + NOCHAR = 0xffff, // must be invalid in ANY codeset (!) }; struct rxvt_codeset_conv { diff --git a/src/perl/readline b/src/perl/readline index b73aef3a..1ff1b852 100644 --- a/src/perl/readline +++ b/src/perl/readline @@ -23,7 +23,7 @@ sub on_button_press { } my $skipped = substr $line->t, $cur, $ofs - $cur; - $skipped =~ s/$urxvt::NOCHAR//g; + $skipped =~ s/\x{ffff}//g; $self->tt_write ($move x length $skipped); } diff --git a/src/perl/selection b/src/perl/selection index fc4d2e38..df943f00 100644 --- a/src/perl/selection +++ b/src/perl/selection @@ -112,7 +112,7 @@ sub on_sel_extend { # convert back from UTF-8 offset space to character space { - my $length = substr $text, $ofs, $len; + my $length = substr "$text ", $ofs, $len; utf8::decode $length; $len = length $length; } diff --git a/src/rxvt.C b/src/rxvt.C index 9d4b829a..4eddc573 100644 --- a/src/rxvt.C +++ b/src/rxvt.C @@ -32,12 +32,16 @@ try { rxvt_init (); +#if ENABLE_PERL stringvec *envv = new stringvec; for (char **var = environ; *var; var++) envv->push_back (strdup (*var)); envv->push_back (0); +#else + stringvec *envv = 0; +#endif rxvt_term *t = new rxvt_term; diff --git a/src/rxvt.h b/src/rxvt.h index a9496d51..4be268a0 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -171,13 +171,21 @@ extern char **rxvt_environ; // the original environ pointer inline void set_environ (stringvec *envv) { +#if ENABLE_PERL + assert (envv); +#else if (envv) +#endif environ = (char **)envv->begin (); } inline void set_environ (char **envv) { +#if ENABLE_PERL + assert (envv); +#else if (envv) +#endif environ = envv; } diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs index 6a324935..fdb5e512 100644 --- a/src/rxvtperl.xs +++ b/src/rxvtperl.xs @@ -1533,10 +1533,20 @@ rxvt_term::screen_cur (...) rc.row = SvIV (ST (1)); rc.col = SvIV (ST (2)); - if (ix == 2 && rc.col == 0) + if (ix == 2) { - rc.row--; - rc.col = THIS->ncol; + if (rc.col == 0) + { + // col == 0 means end of previous line + rc.row--; + rc.col = THIS->ncol; + } + else if (IN_RANGE_EXC (rc.row, THIS->top_row, THIS->nrow) + && rc.col > ROW(rc.row).l) + { + // col >= length means while line and add newline + rc.col = THIS->ncol; + } } clamp_it (rc.col, 0, THIS->ncol); diff --git a/src/urxvt.pm b/src/urxvt.pm index 98356b1f..b285638b 100644 --- a/src/urxvt.pm +++ b/src/urxvt.pm @@ -563,7 +563,7 @@ our $RESNAME; our $RESCLASS; our $RXVTNAME; -our $NOCHAR = chr 0xfffe; +our $NOCHAR = chr 0xffff; =head2 Variables in the C Package @@ -720,6 +720,8 @@ BEGIN { }; } +no warnings 'utf8'; + my $verbosity = $ENV{URXVT_PERL_VERBOSITY}; sub verbose { @@ -745,7 +747,7 @@ sub extension_package($) { or die "$path: $!"; my $source = - "package $pkg; use strict; use utf8;\n" + "package $pkg; use strict; use utf8; no warnings 'utf8';\n" . "#line 1 \"$path\"\n{\n" . (do { local $/; <$fh> }) . "\n};\n1"; @@ -1418,8 +1420,8 @@ line, starting at column C<$start_col> (default C<0>), which is useful to replace only parts of a line. The font index in the rendition will automatically be updated. -C<$text> is in a special encoding: tabs and wide characters that use -more than one cell when displayed are padded with C<$urxvt::NOCHAR> +C<$text> is in a special encoding: tabs and wide characters that use more +than one cell when displayed are padded with C<$urxvt::NOCHAR> (chr 65535) characters. Characters with combining characters and other characters that do not fit into the normal tetx encoding will be replaced with characters in the private use area.