source: show all files in navigator

[?]
Sep 18, 2022, 6:53 AM
NYRESFK6T6NNVQRPVQEJP37Z4XUOUDBQWWU7DMQ23Y3GX7U2A4XQC

Dependencies

Change contents

  • edit in commands.lua at line 56
    [4.206277]
    [3.29]
    if File_navigation.num_lines == nil then
    File_navigation.num_lines = source.num_lines_for_file_navigator()
    end
    App.color(Menu_background_color)
    love.graphics.rectangle('fill', 0,Menu_status_bar_height, App.screen.width, File_navigation.num_lines * Editor_state.line_height)
    local x,y = 5, Menu_status_bar_height
  • replacement in commands.lua at line 67
    [4.206487][3.121:180]()
    add_file_to_menu(filename, i == File_navigation.index)
    [4.206487]
    [4.29]
    x,y = add_file_to_menu(x,y, filename, i == File_navigation.index)
  • replacement in commands.lua at line 74
    [4.206553][4.206553:206600]()
    function add_file_to_menu(s, cursor_highlight)
    [4.206553]
    [4.134]
    function source.num_lines_for_file_navigator()
    local result = 1
    local x = 5
    for i,filename in ipairs(File_navigation.candidates) do
    local width = App.width(to_text(filename))
    if x + width > App.screen.width - 5 then
    result = result+1
    x = 5 + width
    else
    x = x + width + 30
    end
    end
    return result
    end
    function add_file_to_menu(x,y, s, cursor_highlight)
  • edit in commands.lua at line 92
    [4.196]
    [4.206808]
    if x + width > App.screen.width - 5 then
    y = y + Editor_state.line_height
    x = 5
    end
  • replacement in commands.lua at line 98
    [4.206871][2.29:124]()
    love.graphics.rectangle('fill', Menu_cursor-5,5-2, width+5*2,Editor_state.line_height+2*2)
    [4.206871]
    [4.206985]
    love.graphics.rectangle('fill', x-5,y-2, width+5*2,Editor_state.line_height+2*2)
  • replacement in commands.lua at line 101
    [4.207023][4.305:346](),[4.346][4.207071:207112](),[4.207071][4.207071:207112]()
    App.screen.draw(s_text, Menu_cursor,5)
    Menu_cursor = Menu_cursor + width + 30
    [4.207023]
    [4.207112]
    App.screen.draw(s_text, x,y)
    x = x + width + 30
    return x,y