docs/meli.conf.5: add progress_spinner_sequence doc

Manos Pitsidianakis 2020-10-16 15:47:00 +03:00
parent ddfec3e207
commit 3b97e66c10
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
2 changed files with 50 additions and 0 deletions

View File

@ -941,6 +941,50 @@ theme = "themeB"
[terminal.themes.themeC]
\&...
.Ed
.It Ic progress_spinner_sequence Ar Either \&< Integer, [String] \&>
Choose between 30-something built in sequences (integers between 0-30) or define your own list of strings for the progress spinner animation.
Set to an empty array to disable the progress spinner.
.\" default value
.Pq Em 19
Builtin sequences are:
.Bd -literal
0 ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"]
1 ["⣀", "⣄", "⣤", "⣦", "⣶", "⣷", "⣿"]
2 ["⣀", "⣄", "⣆", "⣇", "⣧", "⣷", "⣿"]
3 ["○", "◔", "◐", "◕", "⬤"]
4 ["□", "◱", "◧", "▣", "■"]
5 ["□", "◱", "▨", "▩", "■"]
6 ["□", "◱", "▥", "▦", "■"]
7 ["░", "▒", "▓", "█"]
8 ["░", "█"]
9 ["⬜", "⬛"]
10 ["▱", "▰"]
11 ["▭", "◼"]
12 ["▯", "▮"]
13 ["◯", "⬤"]
14 ["⚪", "⚫"]
15 ["▖", "▗", "▘", "▝", "▞", "▚", "▙", "▟", "▜", "▛"]
16 ["|", "/", "-", "\\"]
17 [".", "o", "O", "@", "*"]
18 ["◡◡", "⊙⊙", "◠◠", "⊙⊙"]
19 ["◜ ", " ◝", " ◞", "◟ "]
10 ["←", "↖", "↑", "↗", "→", "↘", "↓", "↙"]
11 ["▁", "▃", "▄", "▅", "▆", "▇", "█", "▇", "▆", "▅", "▄", "▃"]
22 ["▉", "▊", "▋", "▌", "▍", "▎", "▏", "▎", "▍", "▌", "▋", "▊", "▉"]
23 ["▖", "▘", "▝", "▗"]
24 ["▌", "▀", "▐", "▄"]
25 ["┤", "┘", "┴", "└", "├", "┌", "┬", "┐"]
26 ["◢", "◣", "◤", "◥"]
27 ["⠁", "⠂", "⠄", "⡀", "⢀", "⠠", "⠐", "⠈"]
28 ["⢎⡰", "⢎⡡", "⢎⡑", "⢎⠱", "⠎⡱", "⢊⡱", "⢌⡱", "⢆⡱"]
29 [".", "o", "O", "°", "O", "o", "."]
.Ed
Or, define an array of strings each consisting of a frame in the progress sequence indicator:
.Bd -literal
# 𝄈⡂″⡈߳܃⢂:߳̈⢁܄ː“⢐″„⠑։ ⡁⡈;ܹ⡂։𝂬̤⡂꞉⣀ܹ⢁⠊𝄈⠉⠑ܸ̈׃ ;⢐;߳⠡܉˸⠒߳꞉⁚𝂬⠑⠒܅⠊;⠔⠢܄ ”⠉ֵ”⢂⢁̈⁚⠊˸⠌ܸ̤⣀𝂬⠤⠨⠢‥¨ ⡠܉꞉꞉⠑׃⠑⡐⠨؛ܸ܆„ܹ⡈⢁;⢄܄؛ ܲ⢄⠡⡁‥؛ܲ⢂“⢈։⠔⢄”꞉܉⠔
# Taken from @SmoothUnicode@botsin.space
progress_spinner_sequence = ["։","𝄈","⡂","″","⡈߳","܃","⢂",":߳̈","⢁","܄","ː","“","⢐","″","„","⠑","։"," ","⡁","⡈",";ܹ","⡂","։","𝂬̤","⡂","","⣀ܹ","⢁","⠊","𝄈","⠉","⠑ܸ̈","׃"," ",";","⢐",";߳","⠡","܉","˸","⠒߳","","","𝂬","⠑","⠒","܅","⠊",";","⠔","⠢","܄"," ","”","⠉ֵ","”","⢂","⢁̈","","⠊","˸","⠌ܸ̤","⣀","𝂬","⠤","⠨","⠢","‥","¨"," ","⡠","܉","","","⠑","׃","⠑","⡐","⠨","؛ܸ","܆","„ܹ","⡈","⢁",";","⢄܄","؛"," ܲ","⢄","⠡","⡁","‥","؛ܲ","⢂","“","⢈","։","⠔","⢄","”","","܉","⠔"]
.Ed
.El
.Sh LOG
.Bl -tag -width 36n

View File

@ -1189,11 +1189,17 @@ impl ProgressSpinner {
pub fn set_custom_kind(&mut self, custom: Vec<String>) {
self.stage = 0;
self.width = custom.iter().map(|f| f.grapheme_len()).max().unwrap_or(0);
if self.width == 0 {
self.stop();
}
self.kind = Err(custom);
self.dirty = true;
}
pub fn start(&mut self) {
if self.width == 0 {
return;
}
self.active = true;
self.timer
.set_interval(Self::INTERVAL)