Skip to content

Commit

Permalink
fix #1563
Browse files Browse the repository at this point in the history
  • Loading branch information
pazz committed Apr 22, 2023
1 parent 023cf16 commit eb5ec07
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions alot/commands/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,19 @@ async def apply(self, ui):

for b in ui.buffers:
b.cleanup()
await ui.apply_command(FlushCommand(callback=ui.exit))
ui.cleanup()

if ui.db_was_locked:
msg = 'Database locked. Exit without saving?'
response = await ui.choice(msg, msg_position='left', cancel='no')
if response == 'no':
return

# stop event loop
if ui.dbman.ro: # do it now if DB is read only
ui.exit()
else: # trigger and wait for DB flush otherwise
await ui.apply_command(FlushCommand(callback=ui.exit))
ui.cleanup()


@registerCommand(MODE, 'search', usage='search query', arguments=[
Expand Down

0 comments on commit eb5ec07

Please sign in to comment.