| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Plan is for this to be the default representation for Teliva programs.
Text-friendly but not meant to be edited directly as text. Will
eventually include both code and data definitions, both current snapshot
and past revision history.
Right now .tlv files seem to run. Error checking is non-existent,
because I don't understand Lua's idioms around 'status' yet. Opening the
editor expectedly segfaults.
This commit is the most mind-bending bit of code I've written in a long
time.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Thanks nicolas decoster for reporting this issue.
|
|
|
|
|
| |
This required me to figure out some unicode-related nuances, but no new
primitives.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
We'll eventually need some interface to add entries to it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
a = array.new(1000)
for i=1,1000 do
a:set(i, 1/i)
end
print(a:get(10)) -- 0.1
|
| |
|
|
|
|
| |
And it seems simpler to me.
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
lua_State contains these StkId fields (stack, stack_last, base, top)
that expand to a pointer of a struct containing a Lua value and an int.
Unclear how it's used, or how you build a stack out of it.
|
|
|
|
| |
lua.c now no longer refers to stdin/stdout/stderr.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently working:
> print(1)
1
> print(2)
2
Print's newline doesn't return to column 0 yet.
Ctrl-d no longer works. Ctrl-c exits cleanly.
|
| |
|
| |
|
|
https://www.lua.org
|