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W6AC
KYNGDE2CKNOKUC2XMAS5MEU6YT2C3IW5SIZLOJE64G3ERT7BSWFAC
3OTESDW65UJ2W5RIXA6FNKRSD7TBCZTCCCEAYOQMEVGYZ6RCU34QC
2CK5QI7WA7M4IVSACFGOJYAIDKRUTZVMMPSFWEJTUNMWTN7AX4NAC
ECUKZUSFVKW6Z4GOE3G4CEZRIOJR5XF5OWZSDNEHOJVYHTG24DLAC
function Text.draw(State, line_index, y, startpos, hide_cursor, show_line_numbers)
if show_line_numbers then
App.color(Line_number_color)
love.graphics.print(line_index, State.left-Line_number_width*App.width('m')+10,y)
end
initialize_color()
local line = State.lines[line_index]
local line_cache = State.line_cache[line_index]
line_cache.starty = y
line_cache.startpos = startpos
left = math.floor(left), -- left margin for text; line numbers go to the left of this
edit.put_cursor_on_next_text_line(State)
function edit.put_cursor_on_next_text_line(State)
while true do
if State.cursor1.line >= #State.lines then
break
if State.lines[State.cursor1.line].mode == 'text' then
break
end
State.cursor1.line = State.cursor1.line+1
State.cursor1.pos = 1
end
function edit.draw(State, hide_cursor, show_line_numbers)
local buttonx = State.left-Margin_left+4
if show_line_numbers then
buttonx = 4 -- HACK: position draw buttons at a fixed x on screen
end
button(State, 'draw', {x=buttonx, y=y+4, w=12,h=12, color={1,1,0},
y, screen_bottom1.pos = Text.draw(State, line_index, y, startpos, hide_cursor, show_line_numbers)
edit.put_cursor_on_next_text_line(State)
edit.put_cursor_on_next_text_line(State)
for i=1,math.floor(-dy) do
Text.down(State)
end
for i=1,math.floor(dy) do
Text.up(State)
end
--? print('=> y', y)
elseif line.mode == 'drawing' then
y = y+Drawing_padding_top
Drawing.draw(State, line_index, y)
y = y + Drawing.pixels(line.h, State.width) + Drawing_padding_bottom
else
print(line.mode)
assert(false)
icon = icon.insert_drawing,
onpress1 = function()
Drawing.before = snapshot(State, line_index-1, line_index)
table.insert(State.lines, line_index, {mode='drawing', y=y, h=256/2, points={}, shapes={}, pending={}})
table.insert(State.line_cache, line_index, {})
if State.cursor1.line >= line_index then
State.cursor1.line = State.cursor1.line+1
end
schedule_save(State)
record_undo_event(State, {before=Drawing.before, after=snapshot(State, line_index-1, line_index+1)})
end,
})
State.button_handlers = {}
App.color(Text_color)
end
end
end
end
function edit.invalid1(State, loc1)
right = math.floor(right),
love.window.setTitle('lines.love - source - '..Editor_state.filename)
edit.draw(Editor_state, --[[hide cursor?]] Show_file_navigator, --[[show line numbers]] true)
if Show_log_browser_side then
-- divider
App.color(Divider_color)
love.graphics.rectangle('fill', App.screen.width/2-1,Menu_status_bar_height, 3,App.screen.height)
--
source.switch_to_file(s..'.lua')
love.window.setTitle('lines.love - source - '..Editor_state.filename)
reset_file_navigator()
function edit.put_cursor_on_first_text_line(State)
for i,line in ipairs(State.lines) do
if line.mode == 'text' then
State.cursor1 = {line=i, pos=1}
break
end
function edit.put_cursor_on_next_text_line(State)
while true do
if State.cursor1.line >= #State.lines then
break
end
if State.lines[State.cursor1.line].mode == 'text' then
break
end
State.cursor1.line = State.cursor1.line+1
State.cursor1.pos = 1
button(State, 'draw', {x=4, y=y+4, w=12,h=12, color={1,1,0},
local buttonx = State.left-Margin_left+4
if show_line_numbers then
buttonx = 4 -- HACK: position draw buttons at a fixed x on screen
end
button(State, 'draw', {x=buttonx, y=y+4, w=12,h=12, color={1,1,0},
function edit.put_cursor_on_next_text_line(State)
while true do
if State.cursor1.line >= #State.lines then
break
if State.lines[State.cursor1.line].mode == 'text' then
break
end
State.cursor1.line = State.cursor1.line+1
State.cursor1.pos = 1
end