~akkartik/text.love

0f3841f1861d0d8ff4d86425769127e12cf5673c — Kartik K. Agaram 1 year, 6 months ago 0d96fbe + eb55e18
Merge lines.love
4 files changed, 5 insertions(+), 3 deletions(-)

M log_browser.lua
M source.lua
M source_text.lua
M text.lua
M log_browser.lua => log_browser.lua +2 -2
@@ 84,7 84,7 @@ function guess_source(filename)
  end
end

function log_browser.draw(State)
function log_browser.draw(State, hide_cursor)
  assert(#State.lines == #State.line_cache)
  local mouse_line_index = log_browser.line_index(State, App.mouse_x(), App.mouse_y())
  local y = State.top


@@ 117,7 117,7 @@ function log_browser.draw(State)
        if type(line.data) == 'string' then
          local old_left, old_right = State.left,State.right
          State.left,State.right = xleft,xright
          Text.draw(State, line_index, y, --[[startpos]] 1)
          Text.draw(State, line_index, y, --[[startpos]] 1, hide_cursor)
          State.left,State.right = old_left,old_right
        else
          height = log_render[line.data.name](line.data, xleft, y, xright-xleft)

M source.lua => source.lua +1 -1
@@ 265,7 265,7 @@ function source.draw()
    App.color(Divider_color)
    love.graphics.rectangle('fill', App.screen.width/2-1,Menu_status_bar_height, 3,App.screen.height)
    --
    log_browser.draw(Log_browser_state)
    log_browser.draw(Log_browser_state, --[[hide_cursor]] Focus ~= 'log_browser')
  end
  source.draw_menu_bar()
end

M source_text.lua => source_text.lua +1 -0
@@ 486,6 486,7 @@ end
function Text.down(State)
  assert(State.lines[State.cursor1.line].mode == 'text')
--?   print('down', State.cursor1.line, State.cursor1.pos, State.screen_top1.line, State.screen_top1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
  assert(State.cursor1.pos)
  if Text.cursor_at_final_screen_line(State) then
    -- line is done, skip to next text line
--?     print('cursor at final screen line of its line')

M text.lua => text.lua +1 -0
@@ 408,6 408,7 @@ end

function Text.down(State)
--?   print('down', State.cursor1.line, State.cursor1.pos, State.screen_top1.line, State.screen_top1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
  assert(State.cursor1.pos)
  if Text.cursor_at_final_screen_line(State) then
    -- line is done, skip to next text line
--?     print('cursor at final screen line of its line')