diff --git a/src/command-window.lisp b/src/command-window.lisp index 7f855e0..42d70ed 100644 --- a/src/command-window.lisp +++ b/src/command-window.lisp @@ -335,13 +335,13 @@ be either `:keybinding' or `:string'. the former for key command the latter for (suggestions-window:update-suggestions suggestions-win command-line) (if candidates - (progn - (when (length= candidates 1) - (win-hide suggestions-win)) - (if common-prefix + (if (null common-prefix) + (insert-selected-suggestion object) + (progn + (when (length= candidates 1) + (win-hide suggestions-win)) (setf command-line common-prefix) - (setf command-line (complete:shortest-candidate candidates))) - (move-point-to-end object command-line)) + (move-point-to-end object command-line))) (win-hide suggestions-win)))) object) @@ -520,7 +520,7 @@ command line." (move-point-to-start command-window) (set-keybinding-mode command-window)) ((char= #\Tab event) - (insert-selected-suggestion command-window)) + (complete-at-point command-window)) (t (if (null suggestions-win) (setf suggestions-win (complete-window:init)) diff --git a/src/complete.lisp b/src/complete.lisp index b46d5b1..519cbb4 100644 --- a/src/complete.lisp +++ b/src/complete.lisp @@ -239,7 +239,14 @@ list af all possible candidtae for completion." (uri-matcher hint bag) (when matched-strings (values matched-strings - (reduce-to-common-prefix matched-strings) + nil ;for fuzzy search common prefix does + ;not makes sense; note also that + ;setting this to nil will force + ;selecting the first item in + ;'complete-window' (see: + ;complete-at-point and + ;insert-selected-suggestion), + indices)))))) (defun complete-chat-message (hint) diff --git a/src/gemini-viewer.lisp b/src/gemini-viewer.lisp index 678195c..9253df7 100644 --- a/src/gemini-viewer.lisp +++ b/src/gemini-viewer.lisp @@ -467,6 +467,8 @@ (when (downloading-allowed-p wrapper-object) (multiple-value-bind (buffer read-so-far) (read-array download-stream +read-buffer-size+) + (declare ((vector (unsigned-byte 8)) buffer)) + (declare (fixnum read-so-far)) (increment-bytes-count wrapper-object read-so-far) (if (< read-so-far (length buffer)) (progn