about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* 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-052-2/+2
|
* menu entry: cleanly exitKartik K. Agaram2021-11-051-3/+21
|
* colors: init_pair/color_pairKartik K. Agaram2021-11-054-8/+52
|
* .Kartik K. Agaram2021-11-051-17/+17
|
* slightly clearer rendering in the example appKartik K. Agaram2021-11-052-6/+22
|
* make some space for the global menuKartik K. Agaram2021-11-054-1/+21
| | | | 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-052-36/+36
| | | | | We're going to set aside a portion of the screen soon that apps can't touch.
* .Kartik K. Agaram2021-11-051-0/+1
|
* resist the temptation to add to the Lua APIKartik K. Agaram2021-11-053-26/+25
| | | | | 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-052-2/+78
|
* 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
* https://www.lua.org/pil/28.2.htmlKartik K. Agaram2021-11-051-7/+16
|
* confirmed that this is the sameKartik K. Agaram2021-11-051-2/+2
| | | | And it seems simpler to me.
* going through chapter 28 of https://www.lua.org/pilKartik K. Agaram2021-11-052-3/+86
| | | | | | | | | User-defined C data. I think I have some understanding of the Lua stack now. It's a different kind of verbose, error-prone syntax than Mu that requires me to play computer in my head. But I don't fully grok metatables yet. At least not well enough to grok everything that's going on in lcurses/ext.
* I don't yet understand the stackKartik K. Agaram2021-10-242-5/+4
|
* ok, starting to make sense nowKartik K. Agaram2021-10-241-3/+1
| | | | | | | | Putting together two resources: https://lucasklassmann.com/blog/2019-02-02-how-to-embeddeding-lua-in-c/#exposing-a-simple-variable https://www.lua.org/manual/5.3/manual.html, section 2.1, "Values and Types", particularly the description of light user data. And lo, I see lua_pushlightuserdata in lapi.c
* done reading lua_newstateKartik K. Agaram2021-10-241-1/+8
|
* mildly less confusingKartik K. Agaram2021-10-241-1/+1
|
* back to making sense of lua_newstateKartik K. Agaram2021-10-241-1/+1
|
* get rid of userstate hooksKartik K. Agaram2021-10-245-21/+0
|
* get rid of fromstate/tostateKartik K. Agaram2021-10-242-9/+4
|
* get rid of state_sizeKartik K. Agaram2021-10-242-6/+5
|
* get rid of LUAI_EXTRASPACEKartik K. Agaram2021-10-243-12/+17
| | | | | Lua's power may come from extensibility, but the indirections are currently in the way