Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confirmation on quit #185

Open
shubhodeep9 opened this issue Jan 10, 2019 · 1 comment
Open

Confirmation on quit #185

shubhodeep9 opened this issue Jan 10, 2019 · 1 comment
Assignees

Comments

@shubhodeep9
Copy link

Note: This is a possible suggestion.

  • When user attempts to quit after unsaved changes
  • User is prompted whether to save, not save or cancel quitting
  • On keypress of either of it, it follows the command and quits right away.

Suggestion: It can wait for user to hit enter after writing the command, gives a bit more subtlety.

@dschuyler dschuyler self-assigned this Jan 18, 2019
@adityaxdiwakar
Copy link

The way that the confirmation models are made, this isn't possible (as far as I can see):

Here's the snippet of code that strictly deals with the confirmations for closing:

class ConfirmClose(app.controller.Controller):
    """Ask about closing a file with unsaved changes."""

    def __init__(self, view):
        app.controller.Controller.__init__(self, view, 'confirmClose')

    def setTextBuffer(self, textBuffer):
        app.controller.Controller.setTextBuffer(self, textBuffer)
        commandSet = initCommandSet(self, textBuffer)
        commandSet.update({
            ord('n'): self.closeFile,
            ord('N'): self.closeFile,
            ord('y'): self.saveOrChangeToSaveAs,
            ord('Y'): self.saveOrChangeToSaveAs,
        })
        self.commandSet = commandSet
        self.commandDefault = self.confirmationPromptFinish

As you can see, it's looking for only n, N, y, or Y and this is the same for many other parts of the program, so adding a confirmation model would require a rewrite of all this, albeit still possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants