unstash a stashed file
Dependencies
- [2]
YRN76EXVload stashed files - [3]
5MEJ7XNHlay out buttons based on device dimensions - [4]
GYFNSF33new menu option: revert local changes - [5]
RLXBO23Fswap copy and paste menu buttons - [6]
NM2SILGFstart implementing stashed files - [7]
JIERZ45Wresolve conflicts - [*]
R5QXEHUIsomebody stop me - [*]
5RUFNRJOstart of the visual skeleton
Change contents
- file addition: 0195-can_be_unstashed[9.2]
can_be_unstashed = function(pane)if not pane.is_stash then return endassert(pane.filename)local filename = unstash_filename(pane.filename)return not nativefs.getInfo(App.save_dir..Directory..filename)end - file addition: 0194-unstash_filename[9.2]
unstash_filename = function(filename)return filename:gsub('%..*', '')end - file addition: 0193-unstash_pane[9.2]
unstash_pane = function(pane)local src = Stash_directory..pane.filenamelocal contents, error = love.filesystem.read(src)if not contents then return print_to_output(error) endlove.filesystem.createDirectory(Directory)local filename = unstash_filename(pane.filename)local dest = Directory..filenamelocal success, error = love.filesystem.write(dest, contents)if not success then return print_to_output(error) endpane.filename = filenamepane.is_stash = nilend - file addition: 0192-press_unstash_button[9.2]
press_unstash_button = function()-- disable local modifications to a file without deleting it or saving the paneShow_menu = nilunstash_pane(Current_pane)end - file addition: 0191-unstash_button[9.2]
unstash_button = function(x,y, r)return overflowable_button('unstash', x, y, r, press_unstash_button)end - replacement in 0021-draw_menu at line 18
if Current_pane.filename and has_local_modifications(Current_pane.filename) thenif not Current_pane.is_stash thenif Current_pane.filename thenif has_local_modifications(Current_pane.filename) then - edit in 0021-draw_menu at line 21
x, y = revert_button(x, y, r)elseif can_be_unstashed(Current_pane) thenx, y = unstash_button(x, y, r) - edit in 0021-draw_menu at line 25
x, y = revert_button(x, y, r)