backlog for jprez ( https://github.com/tangentstorm/jprez/ )
- for macro debugger
- for keymap editing
- for file browser? (tree-grid)
from outliner:
- tab to go to repl
- press up
- you should see the previous line from history
- instead you see a blank line
set__hist__repl__BASE'' NB. so delete it. (TODO: handle multi-line macros)
it should just do nothing.
NB. TODO: ‘d$’ is the “correct” vim macro for kc_k/macro ‘K’
(abcd) would execute a,b,c,d in 4 ticks
[abcd] would execute a,b,c,d in 1 tick
- for typing long strings at speed
- for grouping primitive operations into a single “command”
:go[abcd] would define 'go' {go} would call 'go' (??)
- there needs to be an end delimiter because
- right now, every macro instruction is a single character
- therefore, many ascii characters are used up.
- so: we need an escape character to indicate that we want to call a macro, rather than execute each character in its name.
- we also need an end-escape character to indicate the end of the name.
“what good is the nub sieve?”
- insert headline (actually works but requires save/reload)
- re-indenting is not possible without external editor
i have a last slide with one blank line i try to edit the line, and get this:
|index error: stop | L__cmds=:(<B__led) C__cmds}L__cmds |stop[3]
verb “((V i. V) = i. $ V) # V” is not displaying correctly it seems to only show results when they’re nouns. had to also account for empty lines and comments.
“we do need to define V” is not starting the macro from the right place sometimes it works, sometimes it doesn’t seems like the behavior depends on which lines i’ve visited last with the outline cursor
everyone’s screen/camera setup will be different, so let them arrange the screen in the most convenient way. (especially for my own situation, i wanted the text to be on top for the recording, so that my eyes would line up with the camera while i was reading)
APL characters are not being rendered and screwing up
accomplished by using f9/f10 keys in addition to n/shift-N
this is so i can advance the outline cursor after playmacro
you record a long macro and made a typo or want to change the timing now you’re editing macros by hand. this is annoying. also you have to remember what all the keys do, so it would be nice to see the macros vertically with a description for each keypress, and strings on their own line
make ehist a range? add estart variable to world?
sets estart to current ehistlen
- [ ] macro lines become input events
- [ ] editor events need ansi output
- [ ] single line version of screen diff escape code generator
- [ ] input lines become “enter” keypress events
make sure leftmost cursor is always in view
this is ^j in vim
- single editor buffer with the asterisks visible
This feature has always existed, by using source blocks in the outline. But there is no way to create such a thing in jprez. So the feature here is to edit the inital editor state without recording a macro. (meaning the viewer should not have to watch every character get typed out) Ex: we want to show complete settle code before we derive it.
- maybe any assignment or load/import goes to the editor buffer by default?
right now you have to be focused on the outline
could be done by having a globalkeys namespace that all keyboard handlers can coinsert
important because it can take a long time while you’re using jprez also you don’t want other keys to fire the macro or it’ll screw up
- plan: use different keybindings when A=1
(use whatever “modal” dispatch system i use for app keyboard focus)
- then we can have other keys when it’s play mode, rather than having it interpret our keypresses
this would be an option for the behavior of puts_vid
(when writing to video buffer)
it looks like they wrap, but jrepl doesn’t know that they’ve wrapped, and puts the cursor in weird places. 3 issues:
- 1. the lines don’t currently get cut off in the (default) non-wrapping mode
- 2. when the lines wrap, jrepl doesn’t know that there multiple lines, and shows the cursor in wrong place.
- 3. when editing a line long enough to overflow, it wraps back to the left side.
this would be added to the parser in vputs_vid
extend ‘reset’ so that:
- make sure echo is on
- make sure cursor is on
- if possible, make sure j’s readline gets re-enabled so j prompt has cursor control
(right now, you try to debug and you waste brain cycles trying to see the cursor, etc.)
maybe even better would be a global error trap that does this in kvm_loop
(something that gave you more of fine-grained control over the timeline without having to edit macro code) almost like a timeline view? or like an old-school midi/mod tracker? ex ui: https://upload.wikimedia.org/wikipedia/commons/7/7e/Schism-beyond.gif
- one option might be to dynamically copy all the verbs from the focused widget into the keybinding namespace
(clear it out and do that every time the focus changes)
- to simply make the namespace in which i look for key handlers dynamic in j-kvm
- set to the app when using ui/app
- the app can do some of the keyboard dispatch
- maybe this means coming up standard numbers for keyboard codes
- gives us the ability to decouple the ui framework from vt-100
a =: 8 32 $ a.i.’.’ b =: 95 (0 3;3 24; 3 26; 4 18)}a (draw =: [: puts cls, a.{~ ]) draw b
NB. row;cols table for differences:
rct =: ((];”0{)I.@(a:&
:)) <@I. a~:b
NB. individual coordinate pairs suitable for passing to { xys =: ;/;(,”0&.>/)”1 rct xys,.<”0 xys { b
NB. each row is x,y,val ;@|.”1(;”0~{&b) xys
generate list of attributes of the changed cells. ideally you’d have rank 2 list: fg and bg. turn it into 2 boxes.
anywhere the color changes from box to box, you issue a color change, otherwise ”.
likewise, for the coordinates, if they’re right next to each other, you don’t need to issue a cursor move
especially important for pauses
maybe ^/ or ^] or whatever because ^space is used in emacs to set the mark (enter selection mode)
- probably don’t want to dump the whole buffer
- maybe say ‘<<evaluated x lines…>>’ in the repl
requires a selection
Some people will just prefer a regular repl.
have a list of children and auto-provide the ability to draw all of them with extra code. (probably can factor this out of ui/app.ijs)
the current code is a horrifying recursive descent parser derive the state machine from a list of the escape code patterns
https://www2.ccs.neu.edu/research/gpc/VonaUtils/vona/terminal/vtansi.htm
‘0123456789’ e.~ s=:’1234;1234234x42342’
(after i do real keyboard focus handling solution)
- we already have
depth_world_
and we just need to check depth of last token - double check that parens cannot span lines inside direct definitions
status line widget? (right now we define a key and its macro logging character in one area, far away from the update method)
- requires somehow having reference to the app in which we are running
k_nul
works, but it should probably be namedkc_spc
- (maybe this is vt100 thing?) actual ascii character is called ^@
- double check that control-space actually sends ascii 0.
- right now,
exec
callsvtcolor
to color the history - maybe the repl widget itself should just know to color history lines
- then we don’t need vtcolor (which actually stores escape characters in the history)
- maybe: if B != as last line in history, add it to the history
- maybe: if last two items in history are same, delete one
examples: manually edited macros might break. using “future” completion history is not allowed.
this when you have a full future history from loading a presentation, and you use that history to complete a line in the past. This makes no sense from a narrative point of view.
on screen, show the world number as you move the outline cursor also have a display of the variables in scope that changes as you move the cursor
maybe this is just a flag.
- not just wrapping the characters, but breaking on spaces or hyphens or something
- would need to track the height of each entry
is this even different from a list widget? color coding, maybe? the goal is different: it’s to show the current state of the narrative. (it’s an “on-screen”, in-presentation widget that changes as you navigate through time)
https://nickgravgaard.com/elastic-tabstops/
- The idea here was to have a general-purpose task runner, that was not necessarily tied to a widget.
- I don’t remember why I wanted this,
- But it’s easy to simulate with an invisible widget.
- Is there any need for more than this?
cwio = ‘colorwrite’ https://github.com/tangentstorm/xpl/blob/master/demo/cwio_eg.pas
(after we have a file browser)
- insert page
- delete page
- join pages
jshowconsole_j_ 1 NB. doesn't seem to work in jqt
qt terminal doesn’t support vt escape codes not sure i even care about this. (would have to be done in jqt front-end itself) (better idea would probably be make terminal emulator in jqt, or opengl, or SDL)
maybe this ties in with the ‘::’ concept for nested spaces (but: conames and names don’t currently occupy the same namespace) maybe ::x is x in current namespace?
(get them out of the while loop)
- [X] each widget needs an ‘update’ verb and an ‘A’ flag for whether it’s active/animated.
- [X] update app should call update on every active widget on each tick, before it re-renders.
- [X] implement step ( just render @ update )
- [X] main loop should call app step instead of render.
- [X] argument to step should be the time delta since last step (j-kvm.ijs)
- [X] editor needs a flag/mode that indicates it’s playing (maybe the A flag does this)
- [X] editor’s update method should play the next character in the macro if it’s animating.
initially got this for free because it pauses after each keystroke
- history can just be the list of lines on the screen
- at each step, store which one is the bottom-most on screen.
- then to render, take a window of lines the same size as the terminal
- for each input there should/could also be an animation of how we arrived at it
- lines starting with ‘: . ’ are editor animations (macros)
- lines starting with ‘:’ are repl input
- If a editor animaiton precedes the repl input, it should be treated as a derivation of the input, and an alarm should be triggered if it doesn’t actually produce the expected input.
(this might happen if the editor macro modifies previous inputs and the input history changes due to modifying the narrative)
I see three alternatives:
- [X] rewrite the code before it is evaluated (replace =. with =:)
- execute the code in a separate j process
- execute the code as part of an immex expression
(needed to fix init_world_
)
(fix was to use insline
instead of ins__cmd
)
(fix was change to new_repl_line
)
height (H) was just set wrong
goz_UiList_
does not scroll correctly (cursor hidden when entering from bottom)
fixed by adding bounds checking to goz
- Play macro when cmd cursor is on macro and you press ‘N’.
- maybe answer here is to have UiEditWidget produce and consume a state memo
tmp
is temporary editor object (no need to render)- set
KPS__tmp
to _ for infinite speed - set
TSV__tmp
to 0 to turn off random variation - call
do__tmp
with the macro - just call
update_tmp 1
untilA__tmp
is 0 - state for next iteration is
B__tmp
- save start states in
olr
actually i don’t use ?TSV, i use TSV*?0 so it’s in seconds.
needed to manually copy all keyboard handlers.
(instead of verb definition)
part of this was clearing the worlds, and part was setval__tmp''
Pressing up or down should let you navigate the input history. This history is provided by worlds.ijs.
- [X] maintain an internal (invisible) list widget
hist
with input history - [X] last item in
hist
is the current edit buffer (set by up-arrow) - [X] on up arrow:
- [X] if i’m at the end of list, then update the list else ok
- [X] call
bak__hist
to move the history cursor - [X] set B to
val__hist
- [X] on down arrow:
- call
fwd__hist
- set B to
val__hist
- call
right now it just sets the history when the focus changes, and it includes the entire input history.
this is handled by reset_rhist
when focus changes or you play macro.
this way we get the exact history at that point in time.
one exit key is enough. (fix was to remove the 3 in j-kvm.ijs)
- edit: refactor so that keys, macro recording, and verb to execute (for live binding or macro playback) are all defined in one table
- maybe the quick answer for keyboard layouts is to just put that in a separate file?
- or have two tables: one mapping macro code <-> function name, and another for key <-> macro or key <-> function
(right now, the jprez editor is just a plain UiWidget)
we can start with the idea that the editor is just a list of lines therefore, extend the UiListWidget
render the tokenized LIST with an extra cursor drawn on top.