-
Notifications
You must be signed in to change notification settings - Fork 1
/
testapp
executable file
·104 lines (96 loc) · 2.14 KB
/
testapp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
source ./buffermaker
## Example of buffermaker tui program
add-mode testui
:: '[left]' format-left
:: '[up]' format-up
:: '[right]' format-right
:: '[down]' format-down
:: 'RET' link-enter
:: '[next]' 'scroll-down'
:: '[prior]' 'scroll-up'
:: "$(kbd C-a)" 'move-beginning-of-line'
:: "$(kbd C-e)" 'move-end-of-line'
:: "$(kbd C-p)" 'previous-line'
:: "$(kbd C-n)" 'next-line'
:: "$(kbd C-f)" 'forward-char'
:: "$(kbd M-f)" 'forward-word'
:: "$(kbd C-b)" 'backward-char'
:: "$(kbd M-b)" 'backward-word'
:: "$(kbd M-v)" 'scroll-down'
:: "$(kbd C-v)" 'scroll-up'
:: "$(kbd C-c)" 'die'
:: "$(kbd M-x)" 'execute-extended-command'
mode-options
:: else :
:: disable-global 1
function testui {
declare-new-buffer
:: line 5
:: column 0
:: info "Testui"
:: mode testui
:: filetype 'format'
:: file "testui"
:: modified 0
:: isfile 0
:: syntax syntax-format
:: syntax-exec 1
size-full
copy-array index buffer
}
function inc {
((incnum++))
make-render-line 3
redraw
}
function dec {
((incnum--))
make-render-line 3
redraw
}
function show-more {
buffer[7]="${buffer[6]}"
buffer[6]='More: '\
'<o> id: setnum select: set-number redraw right: obj close left: : up: show-less down: show-less '\
'text: <f> link Set number </f> '\
'</o> '\
'<o> id: close select: show-less left: obj setnum right: : up: show-less down: show-less '\
'text: <f> light-red x </f> '\
'</o>'
make-render-area 6 7
redraw
obj close
}
function show-less {
buffer[6]="${buffer[7]}"
unset buffer[7]
make-render-area 6 7
redraw
obj more
}
incnum=0
index=(
''
'<h> Super number counter </h>'
''
'<-> <f> highlight <v> incnum </f>'
''
# controls
'<o> id: inc select: inc redraw right: obj dec left: : up: : down: obj quit '\
'text: <f> link Increase </f> '\
'</o> '\
'<o> id: dec select: dec left: obj inc right: obj more up: : down: obj quit '\
'text: <f> link Decrease </f> '\
'</o> '\
'<o> id: more select: show-more left: obj dec right: : up: : down: obj quit '\
'text: <f> title ... </f> '\
'</o>'
# quit button
'<o> id: quit select: die right: : left: down: : up: obj inc text: <f> red Quit </f> </o>'
)
load-default-config
init-var
testui
redraw
main