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

Allow to cancel quitting with ^X. #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bjornbm
Copy link
Contributor

@bjornbm bjornbm commented Apr 27, 2023

When quitting is blocked by unsaved files, allows to abort the quit by a
starting a ^X key sequence, without first dismissing the "Quit?"
question. The primary expected use is for the user to do ^X-^S, ^X-^C
when realizing that their buffer wasn't saved.

(Typing a 'n' or hitting return or enter before the ^X-^S may seem like
a small step, but my own experience is that I forget and want to go
straight to ^X-^s.)

Problem fixed: Insert a newline at cj>1. Undo (^Z). The undo operation
removes cj-1 characters following the point of the insertion.
When quitting is blocked by unsaved files, allows to abort the quit by a
starting a ^X key sequence, without first dismissing the "Quit?"
question. The primary expected use is for the user to do ^X-^S, ^X-^C
when realizing that their buffer wasn't saved.

(Typing a 'n' or hitting return or enter before the ^X-^S may seem like
a small step, but my own experience is that I forget and want to go
straight to ^X-^s.)
@philanc
Copy link
Owner

philanc commented Apr 27, 2023

Hmm... I understand the rationale. This is smart, but I am not sure I am comfortable with it. Will mull it over :)

@bjornbm
Copy link
Contributor Author

bjornbm commented Apr 27, 2023

That's fair. You could also have a look at master...bjornbm:ple:initsep to see if anything there is of interest.

Some of it is just cleaning up minor things luacheck complains about, but you may not be interest/agree with luacheck. And some other you may find gratuitous or unnecessary (for example 9790a2c and ecf528f).

If anything is of interest, feel free to pull, or ask me to prepare a cleaner pull request if you want only some of (right now the commit from #8 is in the branch).

@philanc
Copy link
Owner

philanc commented Apr 27, 2023

I had a look at your 'initsep' branch.

"Show number of unsaved buffers on quit." - I like it -- should have done it that way in the first place :)

"Avoid shadowing variables (luacheck)" - This is good / cleaner.

"Remove trailing whitespace (luacheck)" - don't care much about it :) Now if I start using Luacheck, I will be happy to remove them, at least to silence these warnings :)

"Make editor a local variable / Make all remaining globals local" - This is good. Now, I must review my extensions (code loaded in ple_init.lua). Along the years, I have directly used at some point some editor globals in extension code. Mostly before using 'editor' as the extension API.

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

Successfully merging this pull request may close these issues.

2 participants