about summary refs log tree commit diff stats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* reorg editor transitionsKartik K. Agaram2021-11-062-12/+13
|
* start showing error messages in editorKartik K. Agaram2021-11-063-7/+21
| | | | | | | | | | | Before we'd end up in cryptic situations where error messages would get hidden when the program got out of ncurses mode. Now it's a little nicer with error messages showing up at the bottom of the editor. But there's still a problem: there's no way to abort without fixing an error.
* simple interface for adding to app menuKartik K. Agaram2021-11-062-4/+17
| | | | | | We're not going to enforce that the menu items actually do what they advertise. It's just a way to draw on the bottom line of screen, something apps aren't otherwise allowed to do.
* refactor menu drawingKartik K. Agaram2021-11-061-9/+20
|
* .Kartik K. Agaram2021-11-061-6/+0
|
* auto-saveKartik K. Agaram2021-11-061-10/+2
| | | | We'll add version control soon.
* replace initial help message with a menuKartik K. Agaram2021-11-061-8/+5
|
* no, more consistent to toggle run/edit with ctrl-eKartik K. Agaram2021-11-061-3/+4
|
* exit editor with ctrl-x for consistencyKartik K. Agaram2021-11-061-3/+4
|
* .Kartik K. Agaram2021-11-061-2/+2
|
* .Kartik K. Agaram2021-11-061-21/+21
|
* clean up when leaving editorKartik K. Agaram2021-11-061-0/+1
| | | | | kilo.c is still calling exit() in several places that we'll need to gradually clean up.
* readme and docsKartik K. Agaram2021-11-052-103/+1
|
* clean up first paint of editorKartik K. Agaram2021-11-051-0/+1
|
* utterly ghastly way to rerun script after editKartik K. Agaram2021-11-053-5/+14
|
* stitch editor inKartik K. Agaram2021-11-054-62/+28
|
* drop test array data structureKartik K. Agaram2021-11-051-82/+0
|
* .Kartik K. Agaram2021-11-051-8/+0
|
* select an editor to bundle: kiloKartik K. Agaram2021-11-051-0/+1308
| | | | | | From https://github.com/antirez/kilo Source code description: https://viewsourcecode.org/snaptoken/kilo BSD 2-clause license seems identical to the MIT in the current codebase.
* slightly improve hanoi renderingKartik K. Agaram2021-11-051-1/+1
|
* menu entry: cleanly exitKartik K. Agaram2021-11-051-3/+21
|
* colors: init_pair/color_pairKartik K. Agaram2021-11-053-4/+39
|
* .Kartik K. Agaram2021-11-051-17/+17
|
* slightly clearer rendering in the example appKartik K. Agaram2021-11-051-3/+11
|
* make some space for the global menuKartik K. Agaram2021-11-053-1/+20
| | | | We'll eventually need some interface to add entries to it.
* move getch out of window scopeKartik K. Agaram2021-11-052-15/+12
| | | | The window only matters for output, which seems like a stupid interface.
* rename 'screen' to 'window'Kartik K. Agaram2021-11-051-19/+19
| | | | | We're going to set aside a portion of the screen soon that apps can't touch.
* resist the temptation to add to the Lua APIKartik K. Agaram2021-11-052-22/+12
| | | | | Instead we'll include code in the Lua app itself, to minimize the differences between what runs on regular Lua and what runs on Teliva.
* hanoi.lua now workingKartik K. Agaram2021-11-051-2/+2
| | | | | There's something strange in the combination of Lua 5.1 and lcurses: window.getch() returns a char but curses.getch() returns an int.
* hanoi.lua _almost_ workingKartik K. Agaram2021-11-052-10/+30
|
* vimrcKartik K. Agaram2021-11-051-0/+3
|
* window:getch()Kartik K. Agaram2021-11-052-5/+17
| | | | | But how do we get curses.getch() to work? I don't see it implemented in lcurses.
* hanoi.lua now renderingKartik K. Agaram2021-11-051-4/+5
|
* curses print constantsKartik K. Agaram2021-11-051-0/+72
| | | | | | | Very satisfying to debug the difference between lcurses putting the module table in an upvalue. Since I implicitly call initstr() rather than define it as a primitive, I don't need to bother with that. I am awesome. Lua is awesome for giving me that sense.
* groupingKartik K. Agaram2021-11-051-0/+4
|
* mvaddch/mvaddstrKartik K. Agaram2021-11-051-0/+33
| | | | | I think we now have all the output functions/methods we need. Just some constants remaining.
* attron/attroffKartik K. Agaram2021-11-051-0/+18
|
* window:getmaxyx()Kartik K. Agaram2021-11-052-2/+23
|
* .Kartik K. Agaram2021-11-051-0/+1
|
* window:clear()Kartik K. Agaram2021-11-051-0/+7
|
* ok, what do we need next for hanoi.lua?Kartik K. Agaram2021-11-051-0/+76
|
* reindentKartik K. Agaram2021-11-051-7/+7
| | | | | I'm trying to follow the style of lua sources even when they're not my preference. lcurses code is a bit different.
* ohh, that word 'index' was keyKartik K. Agaram2021-11-051-0/+4
|
* oh, that's just a cosmetic thingKartik K. Agaram2021-11-051-0/+13
| | | | | | | | So why isn't this working? a = curses:stdscr() a:addstr(abc) The error is "attempt to index global 'a' (a userdata value)"
* copy metatable name from lcursesKartik K. Agaram2021-11-051-3/+3
| | | | | Makes no difference to the results of: print(curses:stdscr())
* metatables seem to be a separate namespace from globalsKartik K. Agaram2021-11-051-3/+3
|
* snapshotKartik K. Agaram2021-11-051-2/+61
| | | | | | | | | Not quite working. curses.stdscr() is returning userdata, not a window. This is true even of the raw array example from the book. So we need to learn something new here. How does lcurses's Pinitscr return a special window object? From what I can tell it's just putting the results of lc_newwin() on the stack. Which is the same as my curses_newwin() here.
* stdscr bindingKartik K. Agaram2021-11-051-0/+12
| | | | | print(curses.stdscr()) print(curses:stdscr())
* starting on curses libraryKartik K. Agaram2021-11-055-3/+46
| | | | | | | | | | | | | | | First piece of working new vocabulary: print(curses:cols()) Just pulling in code from lcurses for the most part. But I'm trying to understand its internals as I gradually add them in, after my more blunt first approach of packaging up lcurses/ext failed. Overall plan for Teliva's API: - start out with a 'curses' library that does what people who are used to ncurses/lcurses expect. - over time create a more opinionated library called 'screen' or 'window' or something.
* https://www.lua.org/pil/28.3.htmlKartik K. Agaram2021-11-051-2/+13
| | | | | | | | a = array.new(1000) for i=1,1000 do a:set(i, 1/i) end print(a:get(10)) -- 0.1
a> ^
cea49fde ^


ae5f0b6f ^
8f0a9149 ^




b24eb476 ^
8f0a9149 ^


cea49fde ^
8f0a9149 ^
cea49fde ^

5152d4ea ^
6d17ef49 ^
5152d4ea ^
5497090a ^
6d17ef49 ^
b24eb476 ^
6d17ef49 ^
b24eb476 ^
6d17ef49 ^





45ca3bb7 ^


b24eb476 ^
45ca3bb7 ^


6ca059ef ^
5eddbc16 ^
6ca059ef ^
795f5244 ^
166e3c0d ^
5eddbc16 ^
166e3c0d ^
1b76245c ^
5db2faeb ^

7afe09fb ^
1b76245c ^
5db2faeb ^

166e3c0d ^



7f73795c ^
45ca3bb7 ^
5e14ce10 ^
b24eb476 ^
31401373 ^
3473c63a ^
1fa53058 ^
016599f1 ^
1fa53058 ^
6d17ef49 ^
0487a30e ^
827898fc ^
6ca059ef ^

afbe301d ^
d9a7e6ab ^

1ead3562 ^
bc643692 ^

d9a7e6ab ^

acc4792d ^
d9a7e6ab ^
acc4792d ^
d9a7e6ab ^
afbe301d ^

1ead3562 ^
83d8299d ^
bc643692 ^

afbe301d ^
1ead3562 ^
bc643692 ^

afbe301d ^

acc4792d ^
afbe301d ^
acc4792d ^
afbe301d ^
acc4792d ^
afbe301d ^
acc4792d ^
afbe301d ^
acc4792d ^
d9a7e6ab ^
48086e10 ^
1ead3562 ^
83d8299d ^
00b808d9 ^

bc643692 ^
00b808d9 ^
5e14ce10 ^
1ead3562 ^
5497090a ^
bc643692 ^
5e14ce10 ^


6d17ef49 ^
1ead3562 ^
83d8299d ^
6d17ef49 ^
1ead3562 ^
bc643692 ^
6d17ef49 ^


1326a4ec ^

d9a7e6ab ^
0a2026a6 ^

d9a7e6ab ^


d9a7e6ab ^
1ead3562 ^
bc643692 ^
d9a7e6ab ^











1ead3562 ^
bc643692 ^

d9a7e6ab ^


82ceda30 ^
75a00270 ^


5f98a10c ^
75a00270 ^
1ead3562 ^
83d8299d ^
75a00270 ^


1ead3562 ^
75a00270 ^




5f98a10c ^

75a00270 ^

5f98a10c ^
75a00270 ^


45ca3bb7 ^
00b808d9 ^

1ead3562 ^
83d8299d ^
00b808d9 ^

1ead3562 ^
bc643692 ^
00b808d9 ^


45ca3bb7 ^
b24eb476 ^
45ca3bb7 ^

00b808d9 ^
00b808d9 ^

45ca3bb7 ^


b24eb476 ^

45ca3bb7 ^





82ceda30 ^



1ead3562 ^
83d8299d ^
bc643692 ^
82ceda30 ^
5497090a ^
82ceda30 ^
1ead3562 ^
bc643692 ^
82ceda30 ^







795f5244 ^
166e3c0d ^
82ceda30 ^
166e3c0d ^
acc4792d ^
e4630643 ^

7afe09fb ^
1b76245c ^
e4630643 ^

166e3c0d ^



b24eb476 ^


05d17773 ^

82ceda30 ^


cfb142b9 ^
827898fc ^
82ceda30 ^

9d670bb5 ^
45ca3bb7 ^

9d670bb5 ^


795f5244 ^
166e3c0d ^
9d670bb5 ^
166e3c0d ^
acc4792d ^
e4630643 ^

7afe09fb ^
1b76245c ^
e4630643 ^

166e3c0d ^



b24eb476 ^

9d670bb5 ^






a6cdf15c ^

134dad7c ^

795f5244 ^
166e3c0d ^
134dad7c ^
166e3c0d ^
acc4792d ^
e4630643 ^

7afe09fb ^
1b76245c ^
e4630643 ^

166e3c0d ^



b24eb476 ^

134dad7c ^








a6cdf15c ^

795f5244 ^
166e3c0d ^



a6cdf15c ^

b24eb476 ^
00b808d9 ^
a6cdf15c ^


88e99894 ^




1ead3562 ^
83d8299d ^
b291d6f9 ^




88e99894 ^
1ead3562 ^
b291d6f9 ^

88e99894 ^








dd2e01e4 ^
88e99894 ^







6abdff27 ^





6abdff27 ^





6abdff27 ^









88e99894 ^
b24eb476 ^
88e99894 ^





795f5244 ^
166e3c0d ^
88e99894 ^
166e3c0d ^
acc4792d ^
88e99894 ^

7afe09fb ^
1b76245c ^
88e99894 ^

7afe09fb ^
1b76245c ^
88e99894 ^

166e3c0d ^



b24eb476 ^

88e99894 ^






94fed202 ^



1ead3562 ^
83d8299d ^
b0bf5321 ^
94fed202 ^




1ead3562 ^
b0bf5321 ^
94fed202 ^
b0bf5321 ^
94fed202 ^



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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553