Fresco/Berlin/include/Berlin GapBuffer.hh,1.12,1.13

Tobias Hunger <[email protected]> Sun, 08 Feb 2004 00:37:05 +0100
Newsgroups gmane.comp.video.fresco.cvs
Message-ID <[email protected]>
Update of /cvs/fresco/Fresco/Berlin/include/Berlin
In directory purcel:/tmp/cvs-serv2879/Berlin/include/Berlin

Modified Files:
	GapBuffer.hh 
Log Message:
Patch from Bernhard Fischer (cow):
There was a little bug in GapBuffer:
When moving the cursor backward in the buffer when gap was zero nothing
happened. I think in this case the cursor position should decremented.


Index: GapBuffer.hh
===================================================================
RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/GapBuffer.hh,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- GapBuffer.hh	29 Dec 2003 08:42:50 -0000	1.12
+++ GapBuffer.hh	7 Feb 2004 23:36:41 -0000	1.13
@@ -95,7 +95,11 @@
       }
       void backward()
       {
-      if (my_cursor == my_gapend) my_cursor -= gap();
+      if (my_cursor == my_gapend)
+	      if (gap())
+		      my_cursor -= gap();
+	      else
+		      my_cursor--;
       else if (cursor() > begin()) my_cursor--;
       }
       void shift(size_type d)