Recently Written · git

clic

MIRROR ONLY Gopher client with pretty colours in Common Lisp

git clone https://github.com/equwal/clic

Log | Files | Refs


commit 52f1c9d1f1e4e2748ab80436e668238d41918077
Solene Rapenne <solene@perso.pw>
2017-11-11 00:46:54 +0000

Improve code

 clic.lisp | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/clic.lisp b/clic.lisp
index 9ed8d25..b9e0213 100644
--- a/clic.lisp
+++ b/clic.lisp
@@ -209,9 +209,6 @@
 	 do
 	   (vector-push line *buffer*)))))
 
-
-
-
 (defun g(key)
   "browse to the N-th link"
   (let ((destination (gethash key *links*)))
@@ -270,8 +267,6 @@
   (format t "help   : show this help~%")
   (format t "x or q : exit the shell, go back to REPL~%"))
 
-
-
 (defun parse-url(url)
   "parse a gopher url and return a location"
   (let ((url (if (and
@@ -312,8 +307,6 @@
   #+ecl
   (car (last (cdr (si::command-args)))))
   
-
-
 (defun user-input(input)
   (cond
     ;; show help
@@ -336,7 +329,6 @@
     ((or (string= "X" input)
 	 (string= "Q" input))
      (quit))
-	  
     
     ;; show history
     ((string= "H" input)
@@ -356,14 +348,14 @@
       (loop for line across *buffer*
 	 counting line into row
 	 do
-	   (when (= row (- rows 3)) ; -1 for text - 1 for input and -1 for can't remember
+	   (when (= row (- rows 2)) ; -1 for text and another -1, because I want
 	     (setf row 0)
-	     (format t "~a------- press enter to next or a shell command ---------~a~%"
+	     (format t "~a   press enter or a shell command ~a : "
 		     (get-color 'cyan)
 		     (get-color  'white))
+	     (force-output)
 	     (let ((first-input (read-char)))
-	       (when (not (or (char= #\NewLine first-input)
-			      (char= #\Space first-input)))
+	       (when (not (char= #\NewLine first-input))
 		 (unread-char first-input)
 		 (let ((input-text (format nil "~a" (read))))
 		   (setf input input-text)