Added cursor movement to prevent needless blank rows
This commit is contained in:
parent
9e20427b43
commit
649b170291
18
stubb
18
stubb
|
@ -154,6 +154,21 @@ function go_to_url(u, add2history, noprint)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function handle_response(res_table, gtype)
|
||||||
|
local out = ''
|
||||||
|
if gtype == '0' or gtype == 0 then
|
||||||
|
out = table.concat(res_table, '\n')
|
||||||
|
else
|
||||||
|
session.tabs[session.current_tab].current_links = {}
|
||||||
|
for i, v in ipairs(res_table) do
|
||||||
|
out = out .. (display_gophermap_row(v) or '').. '\n'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return out
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function display_gophermap_row(row)
|
function display_gophermap_row(row)
|
||||||
local t = session.tabs[session.current_tab]
|
local t = session.tabs[session.current_tab]
|
||||||
local val = string.split(row, '\t')
|
local val = string.split(row, '\t')
|
||||||
|
@ -206,6 +221,9 @@ function mainloop()
|
||||||
local bar = string.format('\27[7m o--[ S t u b b ]--> (H)elp, (Q)uit TAB:%d/%d HST: %d/%d \27[0m', session.current_tab, #session.tabs,th.loc, #th.items)
|
local bar = string.format('\27[7m o--[ S t u b b ]--> (H)elp, (Q)uit TAB:%d/%d HST: %d/%d \27[0m', session.current_tab, #session.tabs,th.loc, #th.items)
|
||||||
print(bar)
|
print(bar)
|
||||||
local key = getch()
|
local key = getch()
|
||||||
|
io.write(string.char(27) .. "[100D")
|
||||||
|
io.write(string.char(27) .. "[1A")
|
||||||
|
io.write(string.char(27) .. "[K")
|
||||||
if key == 'q' then save_favorites(); os.exit(0)
|
if key == 'q' then save_favorites(); os.exit(0)
|
||||||
elseif key == 'h' then print_help()
|
elseif key == 'h' then print_help()
|
||||||
elseif key == 's' then search()
|
elseif key == 's' then search()
|
||||||
|
|
Loading…
Reference in New Issue