bring back syntax highlighting (but so ugly)

akkartik
Nov 21, 2023, 4:53 PM
OE26XIQOCBNXDOCLQ3TEXC6GLU7XF5LYJ4RI2MGFJ6W6GTU264RAC

Dependencies

  • [2] JV27LDDK sliders for font size and color settings
  • [3] 2L5MEZV3 experiment: new edit namespace
  • [4] LF7BWEG4 group all editor globals
  • [5] PRE6XPRN responsively increase/decrease font height
  • [6] FHSZYAZ2 more precise search highlighting
  • [7] ZM7NOBRM new fork: carousel shell
  • [8] S2MISTTM add state arg to a few functions
  • [9] MD3W5IRA new fork: rip out drawing support
  • [10] X3F7ECSL add state arg to some functions
  • [11] HIKLULFQ extract a function
  • [12] 4KC7I3E2 make colors easier to edit
  • [13] LXTTOB33 extract a couple of files
  • [14] RK2ASPN7 add lots of buttons to the toolbar
  • [15] WR2WMEPE implement 'Run' button
  • [16] VAVXKWZV aggregate global state inside a 'pane' object
  • [17] ISOFHXB2 App.width can no longer take a Text

Change contents

  • replacement in select.lua at line 65
    [3.897][3.153:179](),[3.1016][3.153:179](),[3.79197][3.153:179](),[3.965][3.153:179]()
    App.color(Text_color)
    [3.897]
    [3.292]
    App.color(Foreground_color)
  • replacement in search.lua at line 14
    [3.49392][3.181:205]()
    App.color(Text_color)
    [3.49392]
    [3.1625]
    App.color(Foreground_color)
  • replacement in edit.lua at line 2
    [3.459][3.459:488]()
    Text_color = {r=0, g=0, b=0}
    [3.459]
    [3.488]
    Text_color = {r=0, g=0, b=0} -- only used in tests
    Foreground_color = {r=0, g=0, b=0}
  • replacement in colorize.lua at line 34
    [3.922][3.922:943]()
    normal=Text_color,
    [3.922]
    [3.943]
    normal=Foreground_color,
  • edit in colorize.lua at line 50
    [3.1217]
    [3.1217]
    --? if frag == 'do ' then
  • edit in colorize.lua at line 52
    [3.1270]
    [3.1270]
    --? end
  • replacement in colorize.lua at line 54
    [3.1307][3.1307:1372]()
    --? print('using color', Current_state, Colors[Current_state])
    [3.1307]
    [3.1372]
    --? if frag == 'do ' then
    --? print('using color', Current_state, Colors[Current_state], Colors[Current_state].r, Colors[Current_state].g, Colors[Current_state].b)
    --? end
  • replacement in 0091-Foreground_color at line 1
    [2.347][2.348:382]()
    Foreground_color = {r=0, g=0, b=0}
    [2.347]
    -- Foreground_color comes predefined, and we have to be careful
    -- to use the precise table instance used by colorize.lua
    --
    -- This 'definition' is only here to remind us of this global,
    -- and this gotcha.
    Foreground_color = Foreground_color
  • replacement in 0032-update_font_settings at line 7
    [3.351][3.282:697]()
    Current_pane.editor_state.top = Menu_bottom + 20
    Current_pane.editor_state.left = Menu_left + 50 + Line_number_padding
    Current_pane.editor_state.right = math.min(100+30*App.width('m'), Safe_width*2/3)
    Current_pane.editor_state.width = Current_pane.editor_state.right - Current_pane.editor_state.left
    edit.update_font_settings(Current_pane.editor_state, font_height)
    Text.redraw_all(Current_pane.editor_state)
    [3.351]
    [3.662]
    for _,pane in ipairs(Panes) do
    pane.editor_state.top = Menu_bottom + 20
    pane.editor_state.left = Menu_left + 50 + Line_number_padding
    pane.editor_state.right = math.min(100+30*App.width('m'), Safe_width*2/3)
    pane.editor_state.width = pane.editor_state.right - pane.editor_state.left
    edit.update_font_settings(pane.editor_state, font_height)
    Text.redraw_all(pane.editor_state)
    end
  • replacement in 0012-on.draw at line 7
    [3.8266][2.5967:6086]()
    edit.draw(Current_pane.editor_state, --[[fg]] Foreground_color, --[[hide_cursor]] nil, --[[show_line_numbers]] true)
    [3.8266]
    [3.8372]
    edit.draw(Current_pane.editor_state, --[[implicitly use Foreground_color]] nil, --[[hide_cursor]] nil, --[[show_line_numbers]] true)