[Linedit-cvs] CVS update: src/backend.lisp src/dumb-terminal.lisp src/editor.lisp src/main.lisp src/matcher.lisp src/smart-terminal.lisp

Nikodemus Siivola nsiivola at common-lisp.net
Sun Nov 9 13:20:39 UTC 2003


Update of /project/linedit/cvsroot/src
In directory common-lisp.net:/tmp/cvs-serv22284

Modified Files:
	backend.lisp dumb-terminal.lisp editor.lisp main.lisp 
	matcher.lisp smart-terminal.lisp 
Log Message:
Slightly less broken paren matching.
Date: Sun Nov  9 08:20:39 2003
Author: nsiivola

Index: src/backend.lisp
diff -u src/backend.lisp:1.3 src/backend.lisp:1.4
--- src/backend.lisp:1.3	Tue Oct 28 09:39:08 2003
+++ src/backend.lisp	Sun Nov  9 08:20:39 2003
@@ -48,4 +48,4 @@
 	  , at forms)
      (backend-init ,backend)))
 
- (defgeneric display (backend prompt line point))
+(defgeneric display (backend &key prompt line point &allow-other-keys))


Index: src/dumb-terminal.lisp
diff -u src/dumb-terminal.lisp:1.7 src/dumb-terminal.lisp:1.8
--- src/dumb-terminal.lisp:1.7	Thu Oct 23 11:07:08 2003
+++ src/dumb-terminal.lisp	Sun Nov  9 08:20:39 2003
@@ -26,7 +26,7 @@
 
 (defclass dumb-terminal (terminal) ())
 
-(defmethod display ((backend dumb-terminal) prompt line point)
+(defmethod display ((backend dumb-terminal) &key prompt line point &allow-other-keys)
   (let* ((string (concat prompt line))
 	 (length (length string))
 	 (point (+ point (length prompt)))


Index: src/editor.lisp
diff -u src/editor.lisp:1.9 src/editor.lisp:1.10
--- src/editor.lisp:1.9	Sat Nov  1 17:27:13 2003
+++ src/editor.lisp	Sun Nov  9 08:20:39 2003
@@ -92,8 +92,15 @@
 
 (defvar *debug-info* nil)
 
+(defun redraw-line (editor &key markup)
+  (display editor 
+	   :prompt (editor-prompt editor) 
+	   :line (get-string editor) 
+	   :point (get-point editor)
+	   :markup markup))
+
 (defun next-chord (editor)
-  (display editor (editor-prompt editor) (get-string editor) (get-point editor))
+  (redraw-line editor :markup t)
   (forget-yank editor)
   (let* ((chord (read-chord editor))
 	 (command (gethash chord (editor-commands editor)


Index: src/main.lisp
diff -u src/main.lisp:1.7 src/main.lisp:1.8
--- src/main.lisp:1.7	Mon Oct 20 13:49:05 2003
+++ src/main.lisp	Sun Nov  9 08:20:39 2003
@@ -29,6 +29,7 @@
 	(loop
 	 (catch 'linedit-loop
 	   (next-chord editor))))
+      (redraw-line editor)
       (get-finished-string editor))))
 
 (defun formedit (&rest args &key (prompt1 "") (prompt2 "")


Index: src/matcher.lisp
diff -u src/matcher.lisp:1.1 src/matcher.lisp:1.2
--- src/matcher.lisp:1.1	Sun Nov  9 07:28:03 2003
+++ src/matcher.lisp	Sun Nov  9 08:20:39 2003
@@ -43,7 +43,7 @@
 
 (defun find-close-paren (string index)
   (loop with count = -1
-	for n from (1+ index) upto (length string)
+	for n from (1+ index) below (length string)
 	do (incf count (paren-count-delta (schar string n)))
 	when (zerop count) return n))
 


Index: src/smart-terminal.lisp
diff -u src/smart-terminal.lisp:1.8 src/smart-terminal.lisp:1.9
--- src/smart-terminal.lisp:1.8	Sun Nov  9 07:28:03 2003
+++ src/smart-terminal.lisp	Sun Nov  9 08:20:39 2003
@@ -37,23 +37,25 @@
   (when ti:enter-am-mode
     (ti:tputs ti:enter-am-mode)))
 
-(defmethod display ((backend smart-terminal) prompt line point)
-  (let ((*terminal-io* *standard-output*)
-	(columns (backend-columns backend))
-	(line (dwim-mark-parens line point 
-				:pre-mark ti:enter-bold-mode
-				:post-mark ti:exit-attribute-mode)))
+(defmethod display ((backend smart-terminal) &key prompt line point markup)
+  (let* ((*terminal-io* *standard-output*)
+	 (columns (backend-columns backend))
+	 (marked-line (if markup
+			  (dwim-mark-parens line point 
+					    :pre-mark ti:enter-bold-mode
+					    :post-mark ti:exit-attribute-mode)
+			  line)))
     (flet ((find-row (n)
 	     ;; 1+ includes point in row calculations
 	     (ceiling (1+ n) columns))
 	   (find-col (n)
 	     (rem n columns)))
-      (let* ((new (concat prompt line))
+      (let* ((new (concat prompt marked-line))
 	     (old (active-string backend))
-	     (end (length new))
+	     (end (+ (length prompt) (length line))) ;; based on unmarked
 	     (rows (find-row end))
 	     (start (or (mismatch new old) 0))
-	     (start-row (find-row start))
+	     (start-row (find-row start)) ;; markup?
 	     (start-col (find-col start)))
 	;; Move to start of update and clear to eos
 	(ti:tputs ti:column-address start-col)





More information about the linedit-cvs mailing list