File docs/pipedial.1 changed (mode: 100644) (index 908b00a..1abc8d0) |
1 |
1 |
.\" Automatically generated by Pandoc 1.17.0.3 |
.\" Automatically generated by Pandoc 1.17.0.3 |
2 |
2 |
.\" |
.\" |
3 |
|
.TH "pipedial" "1" "January 30, 2019" "" "" |
|
|
3 |
|
.TH "pipedial" "1" "May 21, 2019" "" "" |
4 |
4 |
.hy |
.hy |
5 |
5 |
.SH NAME |
.SH NAME |
6 |
6 |
.PP |
.PP |
|
... |
... |
elements down. |
49 |
49 |
.PP |
.PP |
50 |
50 |
\f[B][count]k\f[] \-\- move cursor \f[B][count]\f[] (1 by default) |
\f[B][count]k\f[] \-\- move cursor \f[B][count]\f[] (1 by default) |
51 |
51 |
elements up. |
elements up. |
|
52 |
|
.PP |
|
53 |
|
\f[B]Ctrl\-E\f[] \-\- scroll one line down. |
|
54 |
|
.PP |
|
55 |
|
\f[B]Ctrl\-Y\f[] \-\- scroll one line up. |
52 |
56 |
.SS Help Mode |
.SS Help Mode |
53 |
57 |
.PP |
.PP |
54 |
58 |
\f[B]h\f[] \-\- return to Normal mode. |
\f[B]h\f[] \-\- return to Normal mode. |
|
... |
... |
elements up. |
57 |
61 |
.PP |
.PP |
58 |
62 |
\f[B]G\f[] \-\- scroll to the bottom. |
\f[B]G\f[] \-\- scroll to the bottom. |
59 |
63 |
.PP |
.PP |
60 |
|
\f[B]j\f[] \-\- scroll one line down. |
|
|
64 |
|
\f[B]j\f[]/\f[B]Ctrl\-E\f[] \-\- scroll one line down. |
61 |
65 |
.PP |
.PP |
62 |
|
\f[B]k\f[] \-\- scroll one line up. |
|
|
66 |
|
\f[B]k\f[]/\f[B]Ctrl\-Y\f[] \-\- scroll one line up. |
63 |
67 |
.SH EXAMPLES |
.SH EXAMPLES |
64 |
68 |
.PP |
.PP |
65 |
69 |
Switch to a branch inside git repository (doesn\[aq]t handle |
Switch to a branch inside git repository (doesn\[aq]t handle |
File src/PipeDial.cpp changed (mode: 100644) (index 57b7d45..f64b41f) |
31 |
31 |
#include "vle/KeyDispatcher.hpp" |
#include "vle/KeyDispatcher.hpp" |
32 |
32 |
#include "vle/Mode.hpp" |
#include "vle/Mode.hpp" |
33 |
33 |
#include "vle/Modes.hpp" |
#include "vle/Modes.hpp" |
|
34 |
|
#include "vle/keys.hpp" |
34 |
35 |
|
|
35 |
36 |
PipeDial::PipeDial(std::wstring titleText, std::vector<std::wstring> initLines) |
PipeDial::PipeDial(std::wstring titleText, std::vector<std::wstring> initLines) |
36 |
37 |
: lines(std::move(initLines)), input(cursed::Keypad::Disabled), |
: lines(std::move(initLines)), input(cursed::Keypad::Disabled), |
|
... |
... |
PipeDial::buildHelpMessage() |
130 |
131 |
L" -- move cursor " + |
L" -- move cursor " + |
131 |
132 |
shortcut(L"[count]") + L" (1 by default) elements up." |
shortcut(L"[count]") + L" (1 by default) elements up." |
132 |
133 |
); |
); |
|
134 |
|
lines.emplace_back(); |
|
135 |
|
lines.emplace_back(shortcut(L"^E") + L" -- scroll one line down."); |
|
136 |
|
lines.emplace_back(); |
|
137 |
|
lines.emplace_back(shortcut(L"^Y") + L" -- scroll one line up."); |
133 |
138 |
|
|
134 |
139 |
lines.emplace_back(); |
lines.emplace_back(); |
135 |
140 |
lines.emplace_back(modeTitle(L"Help Mode")); |
lines.emplace_back(modeTitle(L"Help Mode")); |
|
... |
... |
PipeDial::buildHelpMessage() |
141 |
146 |
lines.emplace_back(); |
lines.emplace_back(); |
142 |
147 |
lines.emplace_back(shortcut(L"G") + L" -- scroll to the bottom."); |
lines.emplace_back(shortcut(L"G") + L" -- scroll to the bottom."); |
143 |
148 |
lines.emplace_back(); |
lines.emplace_back(); |
144 |
|
lines.emplace_back(shortcut(L"j") + L" -- scroll one line down."); |
|
|
149 |
|
lines.emplace_back( |
|
150 |
|
shortcut(L"j") + L"/" + shortcut(L"^E") + L" -- scroll one line down." |
|
151 |
|
); |
145 |
152 |
lines.emplace_back(); |
lines.emplace_back(); |
146 |
|
lines.emplace_back(shortcut(L"k") + L" -- scroll one line up."); |
|
|
153 |
|
lines.emplace_back( |
|
154 |
|
shortcut(L"k") + L"/" + shortcut(L"^Y") + L" -- scroll one line up." |
|
155 |
|
); |
147 |
156 |
lines.emplace_back(); |
lines.emplace_back(); |
148 |
157 |
|
|
149 |
158 |
return lines; |
return lines; |
|
... |
... |
PipeDial::buildNormalMode() |
171 |
180 |
}, "go to the first or [count]-th item" }); |
}, "go to the first or [count]-th item" }); |
172 |
181 |
normalMode.addShortcut({ L"j", [&](int count) { |
normalMode.addShortcut({ L"j", [&](int count) { |
173 |
182 |
list.moveDown(count < 0 ? 1 : count); |
list.moveDown(count < 0 ? 1 : count); |
174 |
|
}, "go to item below" }); |
|
|
183 |
|
}, "go [count] items below" }); |
175 |
184 |
normalMode.addShortcut({ L"k", [&](int count) { |
normalMode.addShortcut({ L"k", [&](int count) { |
176 |
185 |
list.moveUp(count < 0 ? 1 : count); |
list.moveUp(count < 0 ? 1 : count); |
177 |
|
}, "go to item above" }); |
|
|
186 |
|
}, "go [count] items above" }); |
178 |
187 |
normalMode.addShortcut({ L"q", [&]() { |
normalMode.addShortcut({ L"q", [&]() { |
179 |
188 |
quit = true; |
quit = true; |
180 |
189 |
}, "quit the application with no selection" }); |
}, "quit the application with no selection" }); |
|
... |
... |
PipeDial::buildNormalMode() |
203 |
212 |
screen.replaceTopWidget(&track); |
screen.replaceTopWidget(&track); |
204 |
213 |
} |
} |
205 |
214 |
}, "edit and accept" }); |
}, "edit and accept" }); |
|
215 |
|
normalMode.addShortcut({ vle::Key(L'e').ctrl(), [&]() { |
|
216 |
|
list.scrollDown(); |
|
217 |
|
}, "scroll one line down" }); |
|
218 |
|
normalMode.addShortcut({ vle::Key(L'y').ctrl(), [&]() { |
|
219 |
|
list.scrollUp(); |
|
220 |
|
}, "scroll one line up" }); |
206 |
221 |
normalMode.addShortcut({ L"/", [&]() { |
normalMode.addShortcut({ L"/", [&]() { |
207 |
222 |
cursed::List filterList; |
cursed::List filterList; |
208 |
223 |
filterList.setItems({ lines.cbegin(), lines.cend() }); |
filterList.setItems({ lines.cbegin(), lines.cend() }); |
|
... |
... |
PipeDial::buildHelpMode() |
270 |
285 |
helpMode.addShortcut({ L"gg", [&]() { |
helpMode.addShortcut({ L"gg", [&]() { |
271 |
286 |
help.scrollToTop(); |
help.scrollToTop(); |
272 |
287 |
}, "scroll to the bottom" }); |
}, "scroll to the bottom" }); |
273 |
|
helpMode.addShortcut({ L"j", [&]() { |
|
|
288 |
|
helpMode.addShortcut({ { L"j", vle::Key(L'e').ctrl() }, [&]() { |
274 |
289 |
help.scrollDown(); |
help.scrollDown(); |
275 |
290 |
}, "scroll one line down" }); |
}, "scroll one line down" }); |
276 |
|
helpMode.addShortcut({ L"k", [&]() { |
|
|
291 |
|
helpMode.addShortcut({ { L"k", vle::Key(L'y').ctrl() }, [&]() { |
277 |
292 |
help.scrollUp(); |
help.scrollUp(); |
278 |
293 |
}, "scroll one line up" }); |
}, "scroll one line up" }); |
279 |
294 |
|
|