select-patch for libzvt



Hello,

I filed a bug-report against gnome-terminal because of a 'anomaly' in
selection. I got no reply since Dec 2 and the anomaly still is in
gnome-libs-1.2.13. This reports seems to have vanised from the
bugtracking-system

I found out that this is not in gnome-terminal but in libzvt and
patched it. 

With this patch the word a word-selection (doubleklick) always stay in
the selections, even if selecting backwards. This also fixes the
"first word in line gets lost from selection"-bug.

patch appended. I would like to have some feedback and this patch
included in the next gnome-release.

	MfG
	bmg

-- 
"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	Fri May  4 18:18:10 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) {
@@ -1799,6 +1801,22 @@
 
   if (vx->selectiontype != VT_SELTYPE_NONE){
     
+    /* word-select always should contain start-word */
+    if (vx->selectiontype & VT_SELTYPE_WORD) {
+      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;
+      }
+    }
     /* move end of selection, and draw it ... */
     if (vx->selectiontype & VT_SELTYPE_BYSTART) {
       vx->selendx = x;

Attachment: pgpgwO5ErbI1o.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]