1 | #! perl |
1 | #! perl |
|
|
2 | |
|
|
3 | =head1 NAME |
|
|
4 | |
|
|
5 | readline - improve readline editing |
|
|
6 | |
|
|
7 | =head1 DESCRIPTION |
|
|
8 | |
|
|
9 | A support package that tries to make editing with readline easier. At |
|
|
10 | the moment, it reacts to clicking shift-left mouse button by trying to |
|
|
11 | move the text cursor to this position. It does so by generating as many |
|
|
12 | cursor-left or cursor-right keypresses as required (this only works |
|
|
13 | for programs that correctly support wide characters). |
|
|
14 | |
|
|
15 | To avoid too many false positives, this is only done when: |
|
|
16 | |
|
|
17 | =over |
|
|
18 | |
|
|
19 | =item - the tty is in ICANON state. |
|
|
20 | |
|
|
21 | =item - the text cursor is visible. |
|
|
22 | |
|
|
23 | =item - the primary screen is currently being displayed. |
|
|
24 | |
|
|
25 | =item - the mouse is on the same (multi-row-) line as the text cursor. |
|
|
26 | |
|
|
27 | =back |
|
|
28 | |
|
|
29 | The normal selection mechanism isn't disabled, so quick successive clicks |
|
|
30 | might interfere with selection creation in harmless ways. |
|
|
31 | |
|
|
32 | =cut |
2 | |
33 | |
3 | use POSIX (); |
34 | use POSIX (); |
4 | |
35 | |
5 | my $termios = new POSIX::Termios; |
36 | my $termios = new POSIX::Termios; |
6 | |
37 | |