From a698d88a47ebfdbef75b3c02a7a13bd53799a96d Mon Sep 17 00:00:00 2001 From: root Date: Fri, 20 Jan 2006 22:49:33 +0000 Subject: [PATCH] *** empty log message *** --- Changes | 2 + MANIFEST | 1 + doc/rxvt.1.html | 7 ++-- doc/rxvt.1.man.in | 9 +++-- doc/rxvt.1.txt | 7 ++-- doc/rxvtperl.3.html | 84 ++++++++++++++++++++++++++++++++++++----- doc/rxvtperl.3.man.in | 88 +++++++++++++++++++++++++++++++++++++------ doc/rxvtperl.3.txt | 58 ++++++++++++++++++++++++---- src/encoding.h | 4 +- src/perl/readline | 16 ++++++-- src/rxvt.h | 1 - src/rxvtperl.xs | 5 +++ src/urxvt.pm | 34 ++++++++++++++--- 13 files changed, 266 insertions(+), 50 deletions(-) diff --git a/Changes b/Changes index d68f0c6c..355e9f53 100644 --- a/Changes +++ b/Changes @@ -19,6 +19,8 @@ WISH: support tex fonts 7.2 - removed support for obsolete offix dnd protocol. - added "tabbed" extension that provides a crude tabbed terminal. + - added "readline" extension that allows cursor positioning + via mouse clicks. - fixed the automove-background extension to ignore coordinates in non-synthetic events. diff --git a/MANIFEST b/MANIFEST index ad41eb39..db761e99 100644 --- a/MANIFEST +++ b/MANIFEST @@ -164,6 +164,7 @@ src/perl/searchable-scrollback src/perl/automove-background src/perl/mark-urls src/perl/tabbed +src/perl/readline src/perl/example-refresh-hooks src/perl/block-graphics-to-ascii src/perl/digital-clock diff --git a/doc/rxvt.1.html b/doc/rxvt.1.html index 23846d0d..b486059d 100644 --- a/doc/rxvt.1.html +++ b/doc/rxvt.1.html @@ -1585,9 +1585,10 @@ the selection.

Insertion:
-Pressing and releasing the Middle mouse button (or Shift-Insert) in -an rxvt window causes the current text selection to be -inserted as if it had been typed on the keyboard. +Pressing and releasing the Middle mouse button in an rxvt window +causes the value of the PRIMARY selection (Shift for CLIPBOARD) to be inserted +as if it had been typed on the keyboard. +Shift-Insert causes the value of the PRIMARY selection to be inserted too.

diff --git a/doc/rxvt.1.man.in b/doc/rxvt.1.man.in index eaac805d..daa15b2e 100644 --- a/doc/rxvt.1.man.in +++ b/doc/rxvt.1.man.in @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3 .\" .\" Standard preamble: .\" ======================================================================== @@ -1201,9 +1201,10 @@ selection, and trailing whitespace is visually underlined and removed from the selection. .IP "\fBInsertion\fR:" 4 .IX Item "Insertion:" -Pressing and releasing the Middle mouse button (or \fBShift-Insert\fR) in -an \fB@@RXVT_NAME@@\fR window causes the current text selection to be -inserted as if it had been typed on the keyboard. +Pressing and releasing the Middle mouse button in an \fB@@RXVT_NAME@@\fR window +causes the value of the \s-1PRIMARY\s0 selection (Shift for \s-1CLIPBOARD\s0) to be inserted +as if it had been typed on the keyboard. +\&\fBShift-Insert\fR causes the value of the \s-1PRIMARY\s0 selection to be inserted too. .SH "CHANGING FONTS" .IX Header "CHANGING FONTS" Changing fonts (or font sizes, respectively) via the keypad is not yet diff --git a/doc/rxvt.1.txt b/doc/rxvt.1.txt index 1142ee76..5a71cdf2 100644 --- a/doc/rxvt.1.txt +++ b/doc/rxvt.1.txt @@ -1036,9 +1036,10 @@ TEXT SELECTION AND INSERTION removed from the selection. Insertion: - Pressing and releasing the Middle mouse button (or Shift-Insert) in - an rxvt window causes the current text selection to be inserted as - if it had been typed on the keyboard. + Pressing and releasing the Middle mouse button in an rxvt window + causes the value of the PRIMARY selection (Shift for CLIPBOARD) to + be inserted as if it had been typed on the keyboard. Shift-Insert + causes the value of the PRIMARY selection to be inserted too. CHANGING FONTS Changing fonts (or font sizes, respectively) via the keypad is not yet diff --git a/doc/rxvtperl.3.html b/doc/rxvtperl.3.html index 4381c11e..c49caa78 100644 --- a/doc/rxvtperl.3.html +++ b/doc/rxvtperl.3.html @@ -152,7 +152,7 @@ runtime.

Binds a popup menu to Ctrl-Button3 that lets you convert the selection text into various other formats/action (such as uri unescaping, perl -evalution, web-browser starting etc.), depending on content. +evaluation, web-browser starting etc.), depending on content.

Other extensions can extend this popup menu by pushing a code reference @@ -248,6 +248,23 @@ every error message as a selection pattern, and the second line transforms the message into vi commands to load the file.

+
readline
+
+
+A support package that tries to make editing with readline easier. At the +moment, it reacts to clicking with the left mouse button by trying to +move the text cursor to this position. It does so by generating as many +cursor-left or cursor-right keypresses as required (the this only works +for programs that correctly support wide characters). +
+
+

It only works when clicking into the same line (possibly extended over +multiple rows) as the text cursor and on the primary screen, to reduce the +risk of misinterpreting. The normal selection isn't disabled, so quick +successive clicks might interfere with selection creation in harmless +ways.

+
+

tabbed
@@ -257,8 +274,9 @@ displays a ``[NEW]'' button, which, when clicked, will add a new tab, followed b button per tab.
-

Clicking a button will activate that tab. Pressing Shift-Left and -Shift-Right will switch to the tab left or right of the current one.

+

Clicking a button will activate that tab. Pressing Shift-Left and +Shift-Right will switch to the tab left or right of the current one, +while Shift-Down creates a new tab.

mark-urls
@@ -636,6 +654,8 @@ focus out processing.

on_configure_notify $term, $event
+
on_property_notify $term, $event
+
on_key_press $term, $event, $keysym, $octets
on_key_release $term, $event, $keysym
@@ -656,8 +676,8 @@ the hook returns true, then the even will be ignored by rxvt-unicode.

The event is a hash with most values as named by Xlib (see the XEvent -manpage), with the additional members row and col, which are the row -and column under the mouse cursor.

+manpage), with the additional members row and col, which are the +(real, not screen-based) row and column under the mouse cursor.

on_key_press additionally receives the string rxvt-unicode would @@ -1143,6 +1163,12 @@ confused by changes in cursor position or scrolling. Its useful inside a on_add_lines hook, though.

+
$term->scr_change_screen ($screen)
+
+
+Switch to given screen - 0 primary, 1 secondary. +
+

$term->cmd_parse ($octets)
@@ -1249,6 +1275,12 @@ Return the modifier masks corresponding to the ``ISO Level 3 Shift'' (often AltGr), the meta key (often Alt) and the num lock key, if applicable.

+
$screen = $term->current_screen
+
+
+Returns the currently displayed screen (0 primary, 1 secondary). +
+

$view_start = $term->view_start ([$newvalue])
@@ -1284,11 +1316,11 @@ to replace only parts of a line. The font index in the rendition will automatically be updated.

-

$text is in a special encoding: tabs and wide characters that use more -than one cell when displayed are padded with urxvt::NOCHAR characters -(chr 65535). 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.

+

$text is in a special encoding: tabs and wide characters that use +more than one cell when displayed are padded with $urxvt::NOCHAR +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.

You have to obey this encoding when changing text. The advantage is @@ -1433,6 +1465,38 @@ Calls XUngrab for the most recent grab. Is called automatically on evaluation errors, as it is better to lose the grab in the error case as the session.

+

+
$atom = $term->XInternAtom ($atom_name[, $only_if_exists])
+
+
$atom_name = $term->XGetAtomName ($atom)
+
+
@atoms = $term->XListProperties ($window)
+
+
($type,$format,$octets) = $term->XGetWindowProperty ($window, $property)
+
+
$term->XChangeWindowProperty ($window, $property, $type, $format, $octets)
+
+
$term->XDeleteProperty ($window, $property)
+
+
$window = $term->DefaultRootWindow
+
+
$term->XReparentWindow ($window, $parent, [$x, $y])
+
+
$term->XMapWindow ($window)
+
+
$term->XUnmapWindow ($window)
+
+
$term->XMoveResizeWindow ($window, $x, $y, $width, $height)
+
+
($x, $y, $child_window) = $term->XTranslateCoordinates ($src, $dst, $x, $y)
+
+
$term->XChangeInput ($window, $add_events[, $del_events])
+
+
+Various X or X-related functions. The $term object only serves as +the source of the display, otherwise those functions map more-or-less +directory onto the X functions of the same name. +

diff --git a/doc/rxvtperl.3.man.in b/doc/rxvtperl.3.man.in index b7cc04f5..785ec7f4 100644 --- a/doc/rxvtperl.3.man.in +++ b/doc/rxvtperl.3.man.in @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3 .\" .\" Standard preamble: .\" ======================================================================== @@ -231,7 +231,7 @@ runtime. .IX Item "selection-popup (enabled by default)" Binds a popup menu to Ctrl\-Button3 that lets you convert the selection text into various other formats/action (such as uri unescaping, perl -evalution, web-browser starting etc.), depending on content. +evaluation, web-browser starting etc.), depending on content. .Sp Other extensions can extend this popup menu by pushing a code reference onto \f(CW\*(C`@{ $term\-\*(C'\fR{selection_popup_hook} }>, that is called whenever the @@ -309,6 +309,19 @@ To expand the example above to typical perl error messages (\*(L"\s-1XXX\s0 at The first line tells the selection code to treat the unchanging part of every error message as a selection pattern, and the second line transforms the message into vi commands to load the file. +.IP "readline" 4 +.IX Item "readline" +A support package that tries to make editing with readline easier. At the +moment, it reacts to clicking with the left mouse button by trying to +move the text cursor to this position. It does so by generating as many +cursor-left or cursor-right keypresses as required (the this only works +for programs that correctly support wide characters). +.Sp +It only works when clicking into the same line (possibly extended over +multiple rows) as the text cursor and on the primary screen, to reduce the +risk of misinterpreting. The normal selection isn't disabled, so quick +successive clicks might interfere with selection creation in harmless +ways. .IP "tabbed" 4 .IX Item "tabbed" This transforms the terminal into a tabbar with additional terminals, that @@ -316,8 +329,9 @@ is, it implements what is commonly refered to as \*(L"tabbed terminal\*(R". The displays a \*(L"[\s-1NEW\s0]\*(R" button, which, when clicked, will add a new tab, followed by one button per tab. .Sp -Clicking a button will activate that tab. Pressing Shift-Left and -Shift-Right will switch to the tab left or right of the current one. +Clicking a button will activate that tab. Pressing \fBShift-Left\fR and +\&\fBShift-Right\fR will switch to the tab left or right of the current one, +while \fBShift-Down\fR creates a new tab. .IP "mark-urls" 4 .IX Item "mark-urls" Uses per-line display filtering (\f(CW\*(C`on_line_update\*(C'\fR) to underline urls and @@ -607,6 +621,9 @@ focus out processing. .el .IP "on_configure_notify \f(CW$term\fR, \f(CW$event\fR" 4 .IX Item "on_configure_notify $term, $event" .PD 0 +.ie n .IP "on_property_notify $term\fR, \f(CW$event" 4 +.el .IP "on_property_notify \f(CW$term\fR, \f(CW$event\fR" 4 +.IX Item "on_property_notify $term, $event" .ie n .IP "on_key_press $term\fR, \f(CW$event\fR, \f(CW$keysym\fR, \f(CW$octets" 4 .el .IP "on_key_press \f(CW$term\fR, \f(CW$event\fR, \f(CW$keysym\fR, \f(CW$octets\fR" 4 .IX Item "on_key_press $term, $event, $keysym, $octets" @@ -633,8 +650,8 @@ Called whenever the corresponding X event is received for the terminal If the hook returns true, then the even will be ignored by rxvt\-unicode. .Sp The event is a hash with most values as named by Xlib (see the XEvent -manpage), with the additional members \f(CW\*(C`row\*(C'\fR and \f(CW\*(C`col\*(C'\fR, which are the row -and column under the mouse cursor. +manpage), with the additional members \f(CW\*(C`row\*(C'\fR and \f(CW\*(C`col\*(C'\fR, which are the +(real, not screen\-based) row and column under the mouse cursor. .Sp \&\f(CW\*(C`on_key_press\*(C'\fR additionally receives the string rxvt-unicode would output, if any, in locale-specific encoding. @@ -999,6 +1016,9 @@ string is a normal text string, not in locale-dependent encoding. Normally its not a good idea to use this function, as programs might be confused by changes in cursor position or scrolling. Its useful inside a \&\f(CW\*(C`on_add_lines\*(C'\fR hook, though. +.IP "$term\->scr_change_screen ($screen)" 4 +.IX Item "$term->scr_change_screen ($screen)" +Switch to given screen \- 0 primary, 1 secondary. .IP "$term\->cmd_parse ($octets)" 4 .IX Item "$term->cmd_parse ($octets)" Similar to \f(CW\*(C`scr_add_lines\*(C'\fR, but the argument must be in the @@ -1097,6 +1117,10 @@ similar to \f(CW\*(C`\e%ENV\*(C'\fR. .PD Return the modifier masks corresponding to the \*(L"\s-1ISO\s0 Level 3 Shift\*(R" (often AltGr), the meta key (often Alt) and the num lock key, if applicable. +.ie n .IP "$screen = $term\->current_screen" 4 +.el .IP "$screen = \f(CW$term\fR\->current_screen" 4 +.IX Item "$screen = $term->current_screen" +Returns the currently displayed screen (0 primary, 1 secondary). .ie n .IP "$view_start = $term\->view_start ([$newvalue])" 4 .el .IP "$view_start = \f(CW$term\fR\->view_start ([$newvalue])" 4 .IX Item "$view_start = $term->view_start ([$newvalue])" @@ -1124,11 +1148,11 @@ line, starting at column \f(CW$start_col\fR (default \f(CW0\fR), which is useful to replace only parts of a line. The font index in the rendition will automatically be updated. .Sp -\&\f(CW$text\fR is in a special encoding: tabs and wide characters that use more -than one cell when displayed are padded with urxvt::NOCHAR characters -(\f(CW\*(C`chr 65535\*(C'\fR). 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. +\&\f(CW$text\fR is in a special encoding: tabs and wide characters that use +more than one cell when displayed are padded with \f(CW$urxvt::NOCHAR\fR +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. .Sp You have to obey this encoding when changing text. The advantage is that \f(CW\*(C`substr\*(C'\fR and similar functions work on screen cells and not on @@ -1235,6 +1259,48 @@ recent grab. Calls XUngrab for the most recent grab. Is called automatically on evaluation errors, as it is better to lose the grab in the error case as the session. +.ie n .IP "$atom = $term\fR\->XInternAtom ($atom_name[, \f(CW$only_if_exists])" 4 +.el .IP "$atom = \f(CW$term\fR\->XInternAtom ($atom_name[, \f(CW$only_if_exists\fR])" 4 +.IX Item "$atom = $term->XInternAtom ($atom_name[, $only_if_exists])" +.PD 0 +.ie n .IP "$atom_name = $term\->XGetAtomName ($atom)" 4 +.el .IP "$atom_name = \f(CW$term\fR\->XGetAtomName ($atom)" 4 +.IX Item "$atom_name = $term->XGetAtomName ($atom)" +.ie n .IP "@atoms = $term\->XListProperties ($window)" 4 +.el .IP "@atoms = \f(CW$term\fR\->XListProperties ($window)" 4 +.IX Item "@atoms = $term->XListProperties ($window)" +.ie n .IP "($type,$format,$octets) = $term\fR\->XGetWindowProperty ($window, \f(CW$property)" 4 +.el .IP "($type,$format,$octets) = \f(CW$term\fR\->XGetWindowProperty ($window, \f(CW$property\fR)" 4 +.IX Item "($type,$format,$octets) = $term->XGetWindowProperty ($window, $property)" +.ie n .IP "$term\->XChangeWindowProperty ($window, $property\fR, \f(CW$type\fR, \f(CW$format\fR, \f(CW$octets)" 4 +.el .IP "$term\->XChangeWindowProperty ($window, \f(CW$property\fR, \f(CW$type\fR, \f(CW$format\fR, \f(CW$octets\fR)" 4 +.IX Item "$term->XChangeWindowProperty ($window, $property, $type, $format, $octets)" +.ie n .IP "$term\->XDeleteProperty ($window, $property)" 4 +.el .IP "$term\->XDeleteProperty ($window, \f(CW$property\fR)" 4 +.IX Item "$term->XDeleteProperty ($window, $property)" +.ie n .IP "$window = $term\->DefaultRootWindow" 4 +.el .IP "$window = \f(CW$term\fR\->DefaultRootWindow" 4 +.IX Item "$window = $term->DefaultRootWindow" +.ie n .IP "$term\->XReparentWindow ($window, $parent\fR, [$x, \f(CW$y])" 4 +.el .IP "$term\->XReparentWindow ($window, \f(CW$parent\fR, [$x, \f(CW$y\fR])" 4 +.IX Item "$term->XReparentWindow ($window, $parent, [$x, $y])" +.IP "$term\->XMapWindow ($window)" 4 +.IX Item "$term->XMapWindow ($window)" +.IP "$term\->XUnmapWindow ($window)" 4 +.IX Item "$term->XUnmapWindow ($window)" +.ie n .IP "$term\->XMoveResizeWindow ($window, $x\fR, \f(CW$y\fR, \f(CW$width\fR, \f(CW$height)" 4 +.el .IP "$term\->XMoveResizeWindow ($window, \f(CW$x\fR, \f(CW$y\fR, \f(CW$width\fR, \f(CW$height\fR)" 4 +.IX Item "$term->XMoveResizeWindow ($window, $x, $y, $width, $height)" +.ie n .IP "($x, $y\fR, \f(CW$child_window\fR) = \f(CW$term\fR\->XTranslateCoordinates ($src, \f(CW$dst\fR, \f(CW$x\fR, \f(CW$y)" 4 +.el .IP "($x, \f(CW$y\fR, \f(CW$child_window\fR) = \f(CW$term\fR\->XTranslateCoordinates ($src, \f(CW$dst\fR, \f(CW$x\fR, \f(CW$y\fR)" 4 +.IX Item "($x, $y, $child_window) = $term->XTranslateCoordinates ($src, $dst, $x, $y)" +.ie n .IP "$term\->XChangeInput ($window, $add_events\fR[, \f(CW$del_events])" 4 +.el .IP "$term\->XChangeInput ($window, \f(CW$add_events\fR[, \f(CW$del_events\fR])" 4 +.IX Item "$term->XChangeInput ($window, $add_events[, $del_events])" +.PD +Various X or X\-related functions. The \f(CW$term\fR object only serves as +the source of the display, otherwise those functions map more-or-less +directory onto the X functions of the same name. .ie n .Sh "The ""urxvt::popup"" Class" .el .Sh "The \f(CWurxvt::popup\fP Class" .IX Subsection "The urxvt::popup Class" diff --git a/doc/rxvtperl.3.txt b/doc/rxvtperl.3.txt index 6db9b434..c113451a 100644 --- a/doc/rxvtperl.3.txt +++ b/doc/rxvtperl.3.txt @@ -77,8 +77,8 @@ PREPACKAGED EXTENSIONS selection-popup (enabled by default) Binds a popup menu to Ctrl-Button3 that lets you convert the selection text into various other formats/action (such as uri - unescaping, perl evalution, web-browser starting etc.), depending on - content. + unescaping, perl evaluation, web-browser starting etc.), depending + on content. Other extensions can extend this popup menu by pushing a code reference onto "@{ $term-"{selection_popup_hook} }>, that is called @@ -149,6 +149,20 @@ PREPACKAGED EXTENSIONS of every error message as a selection pattern, and the second line transforms the message into vi commands to load the file. + readline + A support package that tries to make editing with readline easier. + At the moment, it reacts to clicking with the left mouse button by + trying to move the text cursor to this position. It does so by + generating as many cursor-left or cursor-right keypresses as + required (the this only works for programs that correctly support + wide characters). + + It only works when clicking into the same line (possibly extended + over multiple rows) as the text cursor and on the primary screen, to + reduce the risk of misinterpreting. The normal selection isn't + disabled, so quick successive clicks might interfere with selection + creation in harmless ways. + tabbed This transforms the terminal into a tabbar with additional terminals, that is, it implements what is commonly refered to as @@ -157,7 +171,8 @@ PREPACKAGED EXTENSIONS tab. Clicking a button will activate that tab. Pressing Shift-Left and - Shift-Right will switch to the tab left or right of the current one. + Shift-Right will switch to the tab left or right of the current one, + while Shift-Down creates a new tab. mark-urls Uses per-line display filtering ("on_line_update") to underline urls @@ -419,6 +434,7 @@ API DOCUMENTATION rxvt-unicode does focus out processing. on_configure_notify $term, $event + on_property_notify $term, $event on_key_press $term, $event, $keysym, $octets on_key_release $term, $event, $keysym on_button_press $term, $event @@ -432,7 +448,8 @@ API DOCUMENTATION The event is a hash with most values as named by Xlib (see the XEvent manpage), with the additional members "row" and "col", which - are the row and column under the mouse cursor. + are the (real, not screen-based) row and column under the mouse + cursor. "on_key_press" additionally receives the string rxvt-unicode would output, if any, in locale-specific encoding. @@ -759,6 +776,9 @@ API DOCUMENTATION be confused by changes in cursor position or scrolling. Its useful inside a "on_add_lines" hook, though. + $term->scr_change_screen ($screen) + Switch to given screen - 0 primary, 1 secondary. + $term->cmd_parse ($octets) Similar to "scr_add_lines", but the argument must be in the locale-specific encoding of the terminal and can contain command @@ -819,6 +839,9 @@ API DOCUMENTATION (often AltGr), the meta key (often Alt) and the num lock key, if applicable. + $screen = $term->current_screen + Returns the currently displayed screen (0 primary, 1 secondary). + $view_start = $term->view_start ([$newvalue]) Returns the row number of the topmost displayed line. Maximum value is 0, which displays the normal terminal contents. Lower values @@ -844,10 +867,10 @@ API DOCUMENTATION automatically be updated. $text is in a special encoding: tabs and wide characters that use - more than one cell when displayed are padded with urxvt::NOCHAR - characters ("chr 65535"). 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. + more than one cell when displayed are padded with $urxvt::NOCHAR + 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. You have to obey this encoding when changing text. The advantage is that "substr" and similar functions work on screen cells and not on @@ -936,6 +959,25 @@ API DOCUMENTATION evaluation errors, as it is better to lose the grab in the error case as the session. + $atom = $term->XInternAtom ($atom_name[, $only_if_exists]) + $atom_name = $term->XGetAtomName ($atom) + @atoms = $term->XListProperties ($window) + ($type,$format,$octets) = $term->XGetWindowProperty ($window, $property) + $term->XChangeWindowProperty ($window, $property, $type, $format, + $octets) + $term->XDeleteProperty ($window, $property) + $window = $term->DefaultRootWindow + $term->XReparentWindow ($window, $parent, [$x, $y]) + $term->XMapWindow ($window) + $term->XUnmapWindow ($window) + $term->XMoveResizeWindow ($window, $x, $y, $width, $height) + ($x, $y, $child_window) = $term->XTranslateCoordinates ($src, $dst, $x, + $y) + $term->XChangeInput ($window, $add_events[, $del_events]) + Various X or X-related functions. The $term object only serves as + the source of the display, otherwise those functions map + more-or-less directory onto the X functions of the same name. + The "urxvt::popup" Class $popup->add_title ($title) Adds a non-clickable title to the popup. diff --git a/src/encoding.h b/src/encoding.h index 93d1d4ee..95920244 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -63,9 +63,9 @@ enum codeset { codeset codeset_from_name (const char *name); enum { - ZERO_WIDTH_CHAR = 0x200b, + ZERO_WIDTH_CHAR = 0x200b, REPLACEMENT_CHAR = 0xfffd, - NOCHAR = 65535, // must be invalid in ANY codeset (!) + NOCHAR = 0xfffe, // must be invalid in ANY codeset (!) }; struct rxvt_codeset_conv { diff --git a/src/perl/readline b/src/perl/readline index a0213b11..b11ada88 100644 --- a/src/perl/readline +++ b/src/perl/readline @@ -8,11 +8,21 @@ sub on_button_press { my $cur = $line->offset_of ($row, $col); my $ofs = $line->offset_of ($event->{row}, $event->{col}); - if ($ofs >= 0 && $ofs < $line->l) { + if ($ofs >= 0 && $ofs < $line->l && !$self->current_screen) { my $diff = $ofs - $cur; + my $move; - $self->tt_write ($diff < 0 ? "\x1b[D" x -$diff - : "\x1b[C" x $diff); + if ($diff < 0) { + ($ofs, $cur) = ($cur, $ofs); + $move = "\x1b[D"; + } else { + $move = "\x1b[C"; + } + + my $skipped = substr $line->t, $cur, $ofs - $cur; + $skipped =~ s/$urxvt::NOCHAR//g; + + $self->tt_write ($move x length $skipped); } () diff --git a/src/rxvt.h b/src/rxvt.h index 3373789e..22c5bbca 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -998,7 +998,6 @@ struct rxvt_term : zero_initialized, rxvt_vars { am_pixmap_trans:1, /* transparency w/known root pixmap */ #endif current_screen:1, /* primary or secondary */ - hate_those_clicks:1, /* a.k.a. keep mark position */ num_scr_allow:1, bypass_keystate:1, #ifdef CURSOR_BLINK diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs index 02813f56..af04e42a 100644 --- a/src/rxvtperl.xs +++ b/src/rxvtperl.xs @@ -1119,12 +1119,14 @@ rxvt_term::ModLevel3Mask () ModLevel3Mask = 0 ModMetaMask = 1 ModNumLockMask = 2 + current_screen = 3 CODE: switch (ix) { case 0: RETVAL = THIS->ModLevel3Mask; break; case 1: RETVAL = THIS->ModMetaMask; break; case 2: RETVAL = THIS->ModNumLockMask; break; + case 3: RETVAL = THIS->current_screen; break; } OUTPUT: RETVAL @@ -1590,6 +1592,9 @@ rxvt_term::scr_xor_span (int beg_row, int beg_col, int end_row, int end_col, U32 void rxvt_term::scr_bell () +void +rxvt_term::scr_change_screen (int screen) + void rxvt_term::scr_add_lines (SV *string) CODE: diff --git a/src/urxvt.pm b/src/urxvt.pm index 51f1c102..1552dc16 100644 --- a/src/urxvt.pm +++ b/src/urxvt.pm @@ -164,6 +164,20 @@ The first line tells the selection code to treat the unchanging part of every error message as a selection pattern, and the second line transforms the message into vi commands to load the file. +=item readline + +A support package that tries to make editing with readline easier. At the +moment, it reacts to clicking with the left mouse button by trying to +move the text cursor to this position. It does so by generating as many +cursor-left or cursor-right keypresses as required (the this only works +for programs that correctly support wide characters). + +It only works when clicking into the same line (possibly extended over +multiple rows) as the text cursor and on the primary screen, to reduce the +risk of misinterpreting. The normal selection isn't disabled, so quick +successive clicks might interfere with selection creation in harmless +ways. + =item tabbed This transforms the terminal into a tabbar with additional terminals, that @@ -540,6 +554,8 @@ our $RESNAME; our $RESCLASS; our $RXVTNAME; +our $NOCHAR = chr 0xfffe; + =head2 Variables in the C Package =over 4 @@ -1262,6 +1278,10 @@ Normally its not a good idea to use this function, as programs might be confused by changes in cursor position or scrolling. Its useful inside a C hook, though. +=item $term->scr_change_screen ($screen) + +Switch to given screen - 0 primary, 1 secondary. + =item $term->cmd_parse ($octets) Similar to C, but the argument must be in the @@ -1354,6 +1374,10 @@ sub env { Return the modifier masks corresponding to the "ISO Level 3 Shift" (often AltGr), the meta key (often Alt) and the num lock key, if applicable. +=item $screen = $term->current_screen + +Returns the currently displayed screen (0 primary, 1 secondary). + =item $view_start = $term->view_start ([$newvalue]) Returns the row number of the topmost displayed line. Maximum value is @@ -1381,11 +1405,11 @@ 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 urxvt::NOCHAR characters -(C). 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. +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> +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. You have to obey this encoding when changing text. The advantage is that C and similar functions work on screen cells and not on -- 2.34.1