1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2025-03-05 10:17:44 +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') - /C-k/ (that is: "press 'control' and while pressed press 'k')
/kills/ (deletes) the text from the cursor position to the end of /kills/ (deletes) the text from the cursor position to the end of
the input previously typed; the input previously typed;
- press /M-left/ and /M-right/ (left alt and left or right arrow - press /M-left/ and /M-right/ (/left alt/ and /left/ or /right/
together) to browse pages of the suggestion window; the arrow together) to browse pages of the suggestion window; the
suggestion window is a window that holds a previously inputted suggestion window is a window that holds a previously inputted
data that are compatible with the string the user is typing into data that are compatible with the string the user is typing into
the command window; the command window;
- if suggestions are gemini URI press /TAB/ to input the current - if suggestions are gemini URI press /TAB/ to input the current
selected suggestion (press tab again to input the next selected suggestion;
suggestion and so on), otherwise pressing /TAB/ will complete the
input with the common prefix of the suggestion window's items;
- if suggestion window is *not* rendered, pressing /up/ and /down/ - if suggestion window is *not* rendered, pressing /up/ and /down/
arrow keys will cycle through input history, if there is not a arrow keys will cycle through input history, if there is not a
suggestion window rendered pressing /up/ and /down/ will scroll 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 \fIkills\fP (deletes) the text from the cursor position to the end of
the input previously typed; the input previously typed;
.IP \(em 4 .IP \(em 4
press \fIM-left\fP and \fIM-right\fP (left alt and left or right arrow press \fIM-left\fP and \fIM-right\fP (\fIleft alt\fP and \fIleft\fP or \fIright\fP
together) to browse pages of the suggestion window; the arrow together) to browse pages of the suggestion window; the
suggestion window is a window that holds a previously inputted suggestion window is a window that holds a previously inputted
data that are compatible with the string the user is typing into data that are compatible with the string the user is typing into
the command window; the command window;
.IP \(em 4 .IP \(em 4
if suggestions are gemini URI press \fITAB\fP to input the current if suggestions are gemini URI press \fITAB\fP to input the current
selected suggestion (press tab again to input the next selected suggestion;
suggestion and so on), otherwise pressing \fITAB\fP will complete the
input with the common prefix of the suggestion window's items;
.IP \(em 4 .IP \(em 4
if suggestion window is \fBnot\fP rendered, pressing \fIup\fP and \fIdown\fP 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 arrow keys will cycle through input history, if there is not a

View File

@ -1,11 +1,11 @@
# a line starting with a '#' is a comment # a line starting with a '#' is a comment
# The server instance name # The server instance name
# add this entry to your file (the one in your home) # add this entry to your file (the one in your home)
# server = test.server.org # server = test.server.org
# your username # your username
# add this entry to your file (the one in your home) # add this entry to your file (the one in your home)
# username = username # username = username
# theme # theme
@ -13,33 +13,37 @@ use "default-theme.conf"
# maximum number of attachments allowed for a single toot # maximum number of attachments allowed for a single toot
# default is 4 # default is 4
#max-numbers-allowed-attachments = 4 #max-numbers-allowed-attachments = 4
# maximum number of characters allowed for a single toot # maximum number of characters allowed for a single toot
# default is 500 # default is 500
#max-message-length = 500 #max-message-length = 500
# maximum number of characters allowed for reporting an user to # maximum number of characters allowed for reporting an user to
# instance's admin # instance's admin
#default is 100 #default is 100
#max-report-comment-length = 100 #max-report-comment-length = 100
# Character to use when replying to a message # Character to use when replying to a message
reply-quoted-character = "> " reply-quoted-character = "> "
# delete the command history entries that are older than this number # delete the command history entries that are older than this number
# of days # of days
purge-history-days-offset = -30 purge-history-days-offset = -30
# delete the cache entries that are older than this number of days # delete the cache entries that are older than this number of days
purge-cache-days-offset = -7 purge-cache-days-offset = -7
# chosen editor (as shell command line) for compose a message # chosen editor (as shell command line) for compose a message
editor = "nano --locking" editor = "nano --locking"
# update gemlog subscriptions when program starts # update gemlog subscriptions when program starts
# (default 'no', change to 'yes' if desired) # (default 'no', change to 'yes' if desired)
start.update.gemlog = no 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 # color parts of a displayed message according to a regular expression
# syntax is regular expression color attribute # syntax is regular expression color attribute

View File

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

View File

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

View File

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

View File

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

View File

@ -1143,6 +1143,8 @@
(progn (progn
(setf (gemini-viewer:gemini-metadata-source-file window-metadata) source) (setf (gemini-viewer:gemini-metadata-source-file window-metadata) source)
(setf (gemini-viewer:gemini-metadata-links window-metadata) links) (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))))))) (line-oriented-window:update-all-rows win new-rows)))))))
(defmethod process-event ((object gemini-got-line-event)) (defmethod process-event ((object gemini-got-line-event))

View File

@ -527,6 +527,7 @@
directory-symbol directory-symbol
fetch fetch
update update
close-after-select
password-echo-character password-echo-character
color-re color-re
ignore-user-re ignore-user-re
@ -595,6 +596,12 @@
(access-key->user-directive keys)))) (access-key->user-directive keys))))
value))) 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 () (defun suggestion-window-selected-item-colors ()
(values (access-non-null-conf-value *software-configuration* (values (access-non-null-conf-value *software-configuration*
+key-suggestions-window+ +key-suggestions-window+

View File

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