about summary refs log tree commit diff stats
path: root/src/lcurseslib.c
Commit message (Collapse)AuthorAgeFilesLines
* cleaner dialogsKartik K. Agaram2021-11-141-1/+1
|
* .Kartik K. Agaram2021-11-131-2/+2
|
* .Kartik K. Agaram2021-11-131-7/+6
|
* replace Kilo's raw terminal handling with ncursesKartik K. Agaram2021-11-131-1/+1
| | | | | | This was on my todo list. What made it urgent was finding that calling getch() even once while in ncurses caused Kilo to stop detecting arrow keys. No need to debug that sort of nonsense.
* start using static linkage like the rest of LuaKartik K. Agaram2021-11-131-2/+2
|
* edit a single hard-coded definition in the imageKartik K. Agaram2021-11-101-2/+2
| | | | | | | | | | | | | src/teliva counter.tlv C-e # switch to editor C-e # save and quit C-x # exit counter.tlv now has the same logical contents, though the whitespace has changed, and the order of keys is different. The implementation is utterly ghastly. For one, I'm unnecessarily interfacing with kilo through the file system.
* life: move starting pattern around on the screenKartik K. Agaram2021-11-101-0/+92
| | | | | | This assumes we're doing it early soon after opening a new pattern, when it hasn't yet reached the margins. Quick and dirty, but seems good enough.
* switch menu bars to reverse videoKartik K. Agaram2021-11-071-4/+4
|
* fix menu colorsKartik K. Agaram2021-11-071-3/+2
| | | | I had it switching to a dark background on me.
* more obvious phrasingKartik K. Agaram2021-11-071-7/+4
| | | | Early returns are only worthwhile if they're utterly obvious.
* fix a regression in commit ee85ad384f17Kartik K. Agaram2021-11-071-0/+1
|
* .Kartik K. Agaram2021-11-071-1/+1
|
* .Kartik K. Agaram2021-11-061-3/+1
|
* window:nodelay() for non-blocking inputKartik K. Agaram2021-11-061-0/+16
|
* reorg editor transitionsKartik K. Agaram2021-11-061-9/+3
|
* start showing error messages in editorKartik K. Agaram2021-11-061-2/+2
| | | | | | | | | | | 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-061-2/+14
| | | | | | 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
|
* clean up first paint of editorKartik K. Agaram2021-11-051-0/+1
|
* utterly ghastly way to rerun script after editKartik K. Agaram2021-11-051-2/+8
|
* stitch editor inKartik K. Agaram2021-11-051-1/+4
|
* menu entry: cleanly exitKartik K. Agaram2021-11-051-3/+21
|
* colors: init_pair/color_pairKartik K. Agaram2021-11-051-0/+26
|
* .Kartik K. Agaram2021-11-051-17/+17
|
* make some space for the global menuKartik K. Agaram2021-11-051-0/+15
| | | | We'll eventually need some interface to add entries to it.
* move getch out of window scopeKartik K. Agaram2021-11-051-13/+10
| | | | The window only matters for output, which seems like a stupid interface.
* resist the temptation to add to the Lua APIKartik K. Agaram2021-11-051-20/+0
| | | | | 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 _almost_ workingKartik K. Agaram2021-11-051-6/+26
|
* window:getch()Kartik K. Agaram2021-11-051-0/+13
| | | | | But how do we get curses.getch() to work? I don't see it implemented in lcurses.
* 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-051-0/+22
|
* .Kartik K. Agaram2021-11-051-0/+1
|
* window:clear()Kartik K. Agaram2021-11-051-0/+7
|
* 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())
* 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-051-0/+40
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.