new menu option: revert local changes
This commit is contained in:
parent
9246567511
commit
8508638582
|
@ -15,6 +15,9 @@ draw_menu = function()
|
|||
x, y = load_button(x, y, r)
|
||||
x, y = paste_button(x, y, r)
|
||||
x, y = copy_button(x, y, r)
|
||||
if Current_pane.filename and has_local_modifications(Current_pane.filename) then
|
||||
x, y = revert_button(x, y, r)
|
||||
end
|
||||
x, y = new_pane_button(x, y, r)
|
||||
x, y = delete_pane_button(x, y, r)
|
||||
-- nav buttons along sides
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
revert_button = function(x,y, r)
|
||||
return overflowable_button('revert', x, y, r, press_revert_button, --[[final button?]] false)
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
press_revert_button = function()
|
||||
Show_menu = nil
|
||||
love.filesystem.remove(Directory..Current_pane.filename)
|
||||
-- As a sort of undo, we don't mess with the bufferr. Conservatively indicate that there are unsaved changes.
|
||||
Current_pane.editor_state.next_save = Current_time + 3
|
||||
end
|
Loading…
Reference in New Issue