minor tweaks
This commit is contained in:
parent
7eaca58762
commit
53f235fd26
|
@ -67,7 +67,7 @@
|
||||||
- __teliva_timestamp: original
|
- __teliva_timestamp: original
|
||||||
dbg:
|
dbg:
|
||||||
>-- helper for debug by print; overlay debug information towards the right
|
>-- helper for debug by print; overlay debug information towards the right
|
||||||
>-- reset debugy within refresh when using this
|
>-- reset debugy every time you refresh screen
|
||||||
>function dbg(window, s)
|
>function dbg(window, s)
|
||||||
> local oldy = 0
|
> local oldy = 0
|
||||||
> local oldx = 0
|
> local oldx = 0
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
- __teliva_timestamp: original
|
- __teliva_timestamp: original
|
||||||
dbg:
|
dbg:
|
||||||
>-- helper for debug by print; overlay debug information towards the right
|
>-- helper for debug by print; overlay debug information towards the right
|
||||||
>-- reset debugy within refresh when using this
|
>-- reset debugy every time you refresh screen
|
||||||
>function dbg(window, s)
|
>function dbg(window, s)
|
||||||
> local oldy = 0
|
> local oldy = 0
|
||||||
> local oldx = 0
|
> local oldx = 0
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
- __teliva_timestamp: original
|
- __teliva_timestamp: original
|
||||||
dbg:
|
dbg:
|
||||||
>-- helper for debug by print; overlay debug information towards the right
|
>-- helper for debug by print; overlay debug information towards the right
|
||||||
>-- reset debugy within refresh when using this
|
>-- reset debugy every time you refresh screen
|
||||||
>function dbg(window, s)
|
>function dbg(window, s)
|
||||||
> local oldy = 0
|
> local oldy = 0
|
||||||
> local oldx = 0
|
> local oldx = 0
|
||||||
|
@ -162,7 +162,6 @@
|
||||||
> window:attrset(curses.color_pair(i))
|
> window:attrset(curses.color_pair(i))
|
||||||
> window:mvaddstr(3+i, 5, "========================")
|
> window:mvaddstr(3+i, 5, "========================")
|
||||||
> end
|
> end
|
||||||
> curses.refresh()
|
|
||||||
>end
|
>end
|
||||||
- __teliva_timestamp: original
|
- __teliva_timestamp: original
|
||||||
menu:
|
menu:
|
||||||
|
@ -238,11 +237,8 @@
|
||||||
- render_delimiter:
|
- render_delimiter:
|
||||||
>function render_delimiter(window, s, pos, cursor)
|
>function render_delimiter(window, s, pos, cursor)
|
||||||
> local newpos = pos
|
> local newpos = pos
|
||||||
>--? dbg(window, '==')
|
|
||||||
> for i=1,string.len(s) do
|
> for i=1,string.len(s) do
|
||||||
>--? dbg(window, tostring(newpos)..' '..tostring(string.byte(s[i])))
|
|
||||||
> if newpos == cursor and i ~= 1 then
|
> if newpos == cursor and i ~= 1 then
|
||||||
>--? dbg(window, 'cursor: '..tostring(cursor))
|
|
||||||
> if s[i] == '\n' then
|
> if s[i] == '\n' then
|
||||||
> -- newline at cursor = render extra space in reverse video before jumping to new line
|
> -- newline at cursor = render extra space in reverse video before jumping to new line
|
||||||
> window:attron(curses.A_REVERSE)
|
> window:attron(curses.A_REVERSE)
|
||||||
|
@ -268,10 +264,6 @@
|
||||||
>function cursor_down(s, idx)
|
>function cursor_down(s, idx)
|
||||||
> local colidx = col_within_line(s, idx)
|
> local colidx = col_within_line(s, idx)
|
||||||
> local newidx = skip_past_newline(s, idx)
|
> local newidx = skip_past_newline(s, idx)
|
||||||
>--? dbg(curses.stdscr(), tostring(idx))
|
|
||||||
>--? dbg(curses.stdscr(), tostring(colidx))
|
|
||||||
>--? dbg(curses.stdscr(), tostring(newidx))
|
|
||||||
>--? curses.getch()
|
|
||||||
> while true do
|
> while true do
|
||||||
> if s[newidx] == '\n' then break end
|
> if s[newidx] == '\n' then break end
|
||||||
> local newcolidx = col_within_line(s, newidx)
|
> local newcolidx = col_within_line(s, newidx)
|
||||||
|
@ -397,11 +389,6 @@
|
||||||
>function render(window)
|
>function render(window)
|
||||||
> window:clear()
|
> window:clear()
|
||||||
> debugy = 5
|
> debugy = 5
|
||||||
>--? render_text(window, prose, 1, cursor)
|
|
||||||
>--? curses.refresh()
|
|
||||||
>--? end
|
|
||||||
>
|
|
||||||
>--? function unused()
|
|
||||||
> local toots = split(prose, '\n\n===\n\n')
|
> local toots = split(prose, '\n\n===\n\n')
|
||||||
> pos = 1
|
> pos = 1
|
||||||
> debugy = 5
|
> debugy = 5
|
||||||
|
@ -410,16 +397,10 @@
|
||||||
> pos = render_delimiter(window, '\n\n===\n\n', pos, cursor)
|
> pos = render_delimiter(window, '\n\n===\n\n', pos, cursor)
|
||||||
> end
|
> end
|
||||||
> pos = render_text(window, toot, pos, cursor)
|
> pos = render_text(window, toot, pos, cursor)
|
||||||
>--? if pos == cursor then
|
|
||||||
>--? window:attron(curses.A_REVERSE)
|
|
||||||
>--? window:addch(' ')
|
|
||||||
>--? window:attroff(curses.A_REVERSE)
|
|
||||||
>--? end
|
|
||||||
> print('')
|
> print('')
|
||||||
> window:attron(curses.A_BOLD)
|
> window:attron(curses.A_BOLD)
|
||||||
> window:addstr(string.len(toot))
|
> window:addstr(string.len(toot))
|
||||||
> window:attroff(curses.A_BOLD)
|
> window:attroff(curses.A_BOLD)
|
||||||
>--? print('')
|
|
||||||
> end
|
> end
|
||||||
> curses.refresh()
|
> curses.refresh()
|
||||||
>end
|
>end
|
||||||
|
|
Loading…
Reference in New Issue