extract functions for computing editor dimensions

akkartik
Feb 21, 2024, 8:59 PM
BH4QJ5CHDMJEIF4G2OWJI55K6SYRGHGIRBH4F2FNO63AUCD4UOWAC

Dependencies

  • [2] AYHJOYKY bugfix: code overflowing lower border after resize
  • [3] 2PDO2EHR merge bugfix
  • [4] SFRZIHVE bugfix: update all panes on resize
  • [5] FQAZKPOO bugfix: infinite loop if window is too narrow
  • [6] RK2ASPN7 add lots of buttons to the toolbar
  • [7] AZMYKWMH resolve conflicts
  • [8] AQZ7YIX5 resolve conflicts
  • [9] YV2GBDNW preserve settings across restart
  • [10] VEAVIL4X resize handler
  • [*] R5QXEHUI somebody stop me

Change contents

  • file addition: 0171-code_editor_bottom_margin (----------)
    [12.2]
    code_editor_bottom_margin = function()
    return Safe_height/2-Line_height
    end
  • file addition: 0169-editor_right_margin (----------)
    [12.2]
    editor_right_margin = function()
    return math.min(100+30*Font:getWidth('m'), Safe_width*2/3)
    end
  • replacement in 0070-code_editor_state at line 4
    [4.2619][4.2619:2660]()
    Safe_height/2-Line_height, -- bottom
    [4.2619]
    [4.2660]
    code_editor_bottom_margin(),
  • replacement in 0070-code_editor_state at line 6
    [4.2710][4.895:961]()
    math.min(100+30*Font:getWidth('m'), Safe_width*2/3), -- right
    [4.2710]
    [4.195]
    editor_right_margin(),
  • replacement in 0070-code_editor_state at line 10
    [4.2865][4.962:966]()
    end
    [4.2865]
    end
  • replacement in 0031-on.resize at line 4
    [4.121][3.133:231]()
    pane.editor_state.right = math.min(100+30*pane.editor_state.font:getWidth('m'), Safe_width*2/3)
    [4.121]
    [4.313]
    pane.editor_state.right = editor_right_margin()
  • replacement in 0031-on.resize at line 9
    [4.274][2.0:55]()
    pane.editor_state.bottom = Safe_height/2-Line_height
    [4.274]
    [4.319]
    pane.editor_state.bottom = code_editor_bottom_margin()