Hello, The word-select in zvt always annoyed me, a) if startet with the first word in a line, it lost the first word if I touched the line above by mistake. b) Selecting backwards (starting with the last word) does not include the word doubleclicked. I attached a patch against 'gnome-libs-1.2.13' correcting both problems. I considered changing 'struct _vtx' in vtx.h to be O.K. because of a line stating: /* ALL FOLLOWING FIELDS ARE TO BE CONSIDERED PRIVATE - USE AT OWN RISK */ O.K? MfG bmg P.S.: My bugreport to the gnome-bug-tracking-system disapered but the bug stayed. My first try to post a patch to this mailinglist resultet in a polite mail, that my is "being held until the list moderator can review it for approval", which hadn't happend until now. -- "Des is völlig wurscht, was heut beschlos- | M G Berberich sen wird: I bin sowieso dagegn!" | berberic fmi uni-passau de (SPD-Stadtrat Kurt Schindler; Regensburg) |
diff -Naur gnome-libs-1.2.13/zvt/vtx.h gnome-libs-1.2.13-bmg/zvt/vtx.h --- gnome-libs-1.2.13/zvt/vtx.h Fri Nov 19 01:50:17 1999 +++ gnome-libs-1.2.13-bmg/zvt/vtx.h Fri May 4 17:58:36 2001 @@ -82,6 +82,7 @@ int selstartx, selstarty; int selendx, selendy; + int selinitx, selinity; /* previously rendered values */ int selstartxold, selstartyold; diff -Naur gnome-libs-1.2.13/zvt/zvtterm.c gnome-libs-1.2.13-bmg/zvt/zvtterm.c --- gnome-libs-1.2.13/zvt/zvtterm.c Fri Mar 9 07:22:04 2001 +++ gnome-libs-1.2.13-bmg/zvt/zvtterm.c Sat May 5 14:42:58 2001 @@ -1548,6 +1548,8 @@ vx->selstarty = y; vx->selendx = x; vx->selendy = y; + vx->selinitx = x; + vx->selinity = y; /* reset 'drawn' screen (to avoid mis-refreshes) */ if (!vx->selected) { @@ -1806,6 +1808,24 @@ } else { vx->selstartx = x; vx->selstarty = y + vx->vt.scrollbackoffset; + } + + /* word-select always should contain start-word */ + if ((vx->selectiontype & VT_SELTYPE_WORD) && + ((vx->selstarty != vx->selendy || vx->selstartx != vx->selendx))) { + if (vx->selstarty > vx->selinity || + (vx->selstarty == vx->selinity && vx->selstartx > vx->selinitx)) { + vx->selstarty = vx->selinity; + vx->selstartx = vx->selinitx; + vx->selectiontype |= VT_SELTYPE_BYSTART; + vx->selectiontype &= ~VT_SELTYPE_BYEND; + } else if (vx->selendy < vx->selinity || + (vx->selendy == vx->selinity && vx->selendx<vx->selinitx)) { + vx->selendy = vx->selinity; + vx->selendx = vx->selinitx; + vx->selectiontype |= VT_SELTYPE_BYEND; + vx->selectiontype &= ~VT_SELTYPE_BYSTART; + } } vx->selectiontype |= VT_SELTYPE_MOVED;
Attachment:
pgpSniKtIp0xW.pgp
Description: PGP signature