New feature in feature.h: SELECT_TO_EOL
When enabled, triple click selects from word under pointer to the end of
the line, copying Eterm's default behavior.
Actually, my somewhat dated CVS version of Eterm is a little buggy and
behaves erratically in this mode, so the behavior is not an exact copy.
In particular, when dragging above the original anchor point, a range of
whole lines is selected (in Eterm it seems that the intention was to
select only from the word under pointer on the first line). When
dragging below, the behavior matches (minus bugs) - selected text is
from word under the anchor to the end of the last line.
Oh, I forgot. I wasn't copying Eterm, I was copying xterm with resource
setting `*VT100.cutToBeginningOfLine: false'. It had no bugs and thus
was easier to understand. But I first saw and liked this feature in
Eterm.
I haven't yet tried the possibility to automatically continue selection area
through automatically wrapped lines.
Marius Gedminas
--
Favorite MAC error message: "Not enough memory to eject disk!"
Index: src/feature.h
===================================================================
RCS file: /cvsroot/rxvt/rxvt/src/feature.h,v
retrieving revision 1.52
diff -u -r1.52 feature.h
--- src/feature.h 2001/03/02 05:33:15 1.52
+++ src/feature.h 2001/03/06 12:54:18
@@ -255,6 +281,12 @@
*/
/* #define SCROLLBAR_INITIAL_DELAY 40 */
/* #define SCROLLBAR_CONTINUOUS_DELAY 2 */
+
+/*
+ * Make triple click select just to end of line (like xterm with
+ * *VT100.cutToBeginningOfLine: false) -- mg
+ */
+#define SELECT_TO_EOL
/*--------------------------------MISC----------------------------------*/
/*
Index: src/screen.c
===================================================================
RCS file: /cvsroot/rxvt/rxvt/src/screen.c,v
retrieving revision 1.197
diff -u -r1.197 screen.c
--- src/screen.c 2001/03/06 05:04:28 1.197
+++ src/screen.c 2001/03/06 12:54:27
@@ -3050,8 +3064,8 @@
text_t *stp;
rend_t *srp;
- if (r->selection.clicks != 2)
- return; /* Go away: we only handle double clicks */
+ if (r->selection.clicks < 2)
+ return; /* Go away: we only handle double/triple clicks */
if (dirn == UP) {
bound.row = r->TermWin.saveLines - r->TermWin.nscrolled - 1;
@@ -3377,9 +3391,17 @@
rxvt_selection_delimit_word(r, DN, &(r->selection.end),
&(r->selection.end));
} else if (r->selection.clicks == 3) {
+#ifdef SELECT_TO_EOL
if (ROWCOL_IS_AFTER(r->selection.mark, r->selection.beg))
+ r->selection.beg.col = 0;
+ else
+ rxvt_selection_delimit_word(r, UP, &(r->selection.beg),
+ &(r->selection.beg));
+#else
+ if (ROWCOL_IS_AFTER(r->selection.mark, r->selection.beg))
r->selection.mark.col++;
r->selection.beg.col = 0;
+#endif
r->selection.end.col = ncol;
}
if (button3 && buttonpress) { /* mark may need to be changed */