1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2024-12-15 22:58:58 +01:00

Compare commits

...

5 Commits

10 changed files with 65 additions and 40 deletions

View File

@ -96,15 +96,13 @@
- /C-k/ (that is: "press 'control' and while pressed press 'k')
/kills/ (deletes) the text from the cursor position to the end of
the input previously typed;
- press /M-left/ and /M-right/ (left alt and left or right arrow
together) to browse pages of the suggestion window; the
- press /M-left/ and /M-right/ (/left alt/ and /left/ or /right/
arrow together) to browse pages of the suggestion window; the
suggestion window is a window that holds a previously inputted
data that are compatible with the string the user is typing into
the command window;
- if suggestions are gemini URI press /TAB/ to input the current
selected suggestion (press tab again to input the next
suggestion and so on), otherwise pressing /TAB/ will complete the
input with the common prefix of the suggestion window's items;
selected suggestion;
- if suggestion window is *not* rendered, pressing /up/ and /down/
arrow keys will cycle through input history, if there is not a
suggestion window rendered pressing /up/ and /down/ will scroll

View File

@ -139,16 +139,14 @@ program;
\fIkills\fP (deletes) the text from the cursor position to the end of
the input previously typed;
.IP \(em 4
press \fIM-left\fP and \fIM-right\fP (left alt and left or right arrow
together) to browse pages of the suggestion window; the
press \fIM-left\fP and \fIM-right\fP (\fIleft alt\fP and \fIleft\fP or \fIright\fP
arrow together) to browse pages of the suggestion window; the
suggestion window is a window that holds a previously inputted
data that are compatible with the string the user is typing into
the command window;
.IP \(em 4
if suggestions are gemini URI press \fITAB\fP to input the current
selected suggestion (press tab again to input the next
suggestion and so on), otherwise pressing \fITAB\fP will complete the
input with the common prefix of the suggestion window's items;
selected suggestion;
.IP \(em 4
if suggestion window is \fBnot\fP rendered, pressing \fIup\fP and \fIdown\fP
arrow keys will cycle through input history, if there is not a

View File

@ -41,6 +41,10 @@ editor = "nano --locking"
# (default 'no', change to 'yes' if desired)
start.update.gemlog = no
# close links window when opening the selected link
open-message-link-window.close-after-select = yes
# color parts of a displayed message according to a regular expression
# syntax is regular expression color attribute
# valid color are specified using RGB triplets as #RRGGBB or color names

View File

@ -336,12 +336,16 @@ be either `:keybinding' or `:string'. the former for key command the latter for
command-line)
(if candidates
(if (null common-prefix)
(progn
(insert-selected-suggestion object)
(suggestions-window:update-suggestions suggestions-win
command-line)
(reset-selected-suggestion-index object)
(setf (suggestions-window:current-page suggestions-win) 0))
(progn
(when (length= candidates 1)
(win-hide suggestions-win))
(setf command-line common-prefix)
(move-point-to-end object command-line)))
(insert-selected-suggestion object)))
(win-hide suggestions-win))))
object)
@ -421,25 +425,32 @@ be either `:keybinding' or `:string'. the former for key command the latter for
(defun select-suggestion-previous (win)
(select-suggestion win -1))
(defun insert-selected-suggestion (win)
(with-accessors ((suggestions-win suggestions-win)
(command-line command-line)) win
(defun suggested-selection (win)
(with-accessors ((suggestions-win suggestions-win)) win
(when suggestions-win
(with-accessors ((current-page suggestions-window:current-page)
(paginated-info suggestions-window:paginated-info)
(selected-item-row-index complete-window::selected-item-row-index)
(selected-item-column-index complete-window::selected-item-column-index))
suggestions-win
(let* ((columns (elt paginated-info current-page))
(when-let* ((columns (elt paginated-info current-page))
(column (elt columns selected-item-column-index))
(suggestion (trim-blanks (elt column selected-item-row-index))))
(if (string= command-line suggestion)
(progn
(select-suggestion-next win)
(insert-selected-suggestion win))
(progn
suggestion)))))
(defun reset-selected-suggestion-index (win)
(with-accessors ((suggestions-win suggestions-win)) win
(complete-window:reset-selected-item suggestions-win))
win)
(defun insert-selected-suggestion (win)
(with-accessors ((suggestions-win suggestions-win)
(command-line command-line)) win
(when suggestions-win
(let ((suggestion (suggested-selection win)))
(setf command-line suggestion)
(move-point-to-end win command-line))))))))
(move-point-to-end win command-line))))
win)
(defun fire-user-input-event (win)
"Generates an event to notify that the user inserted an input on the

View File

@ -224,7 +224,8 @@
(select-row object 0))
(defun adjust-rows-select-first (window)
(select-first-row window))
(when (rows window)
(select-first-row window)))
(defun adjust-rows-select-last (window)
(with-accessors ((rows rows)) window

View File

@ -75,6 +75,9 @@
(let* ((parsed (iri:iri-parse url))
(scheme (uri:scheme parsed))
(decoded-path (percent-decode url)))
(when (and (not enqueue)
(swconf:close-link-window-after-select-p))
(ui:close-open-message-link-window))
(cond
((string= gemini-constants:+gemini-scheme+ scheme)
(db:insert-in-history (ui:gemini-open-url-prompt) url)

View File

@ -1113,6 +1113,7 @@
:load-config-file
:external-editor
:gemini-downloading-animation
:close-link-window-after-select-p
:suggestion-window-selected-item-colors
:gemini-default-favicon
:gemini-update-gemlog-at-start-p

View File

@ -1143,6 +1143,8 @@
(progn
(setf (gemini-viewer:gemini-metadata-source-file window-metadata) source)
(setf (gemini-viewer:gemini-metadata-links window-metadata) links)
(funcall (message-window:adjust-rows-strategy win)
win)
(line-oriented-window:update-all-rows win new-rows)))))))
(defmethod process-event ((object gemini-got-line-event))

View File

@ -527,6 +527,7 @@
directory-symbol
fetch
update
close-after-select
password-echo-character
color-re
ignore-user-re
@ -595,6 +596,12 @@
(access-key->user-directive keys))))
value)))
(defun close-link-window-after-select-p ()
(let ((value (access:accesses *software-configuration*
+key-open-message-link-window+
+key-close-after-select+)))
(not (false-value-p value))))
(defun suggestion-window-selected-item-colors ()
(values (access-non-null-conf-value *software-configuration*
+key-suggestions-window+

View File

@ -24,7 +24,7 @@
(defrule range-delimter #\-)
(defrule list-delimiter #\Space)
(defrule list-delimiter (+ (or #\Space #\,)))
(defrule number (and digit (* digit))
(:text t)