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

Add vintageous_exit_app_when_quiting_last_window #819

Closed

Conversation

haze
Copy link

@haze haze commented Apr 23, 2022

When the last window is closed, quit Sublime Text completely

@gerardroche
Copy link
Contributor

The vintageous_exit_when_quiting_last_window setting should already do what you want i.e. if there is only one view left and you run :quit it will exit ST. If you have multiple views open and you want to quit them all and exit run :qa or :qall or :quitall

@haze
Copy link
Author

haze commented May 27, 2022

It’s okay if you don’t want to merge, but that setting left sublime open even when all views/windows were closed

@gerardroche
Copy link
Contributor

gerardroche commented May 30, 2022

It sounds like a bug because it should already work as you expect. Can you provide some details like OS and version being used.

Also do you have hot_exit set? And can you try setting "vintageous_multi_cursor_exit_from_visual_mode": false, directly in your preferences to see if there is an issue with the default settings being loaded.

@gerardroche
Copy link
Contributor

I can't reproduce this issue. Perhaps my configuration is different than yours. Some debug info might help diagnose the issue. https://github.com/NeoVintageous/NeoVintageous/blob/master/.github/CONTRIBUTING.md

@haze
Copy link
Author

haze commented Sep 25, 2022

I no longer use sublime or NeoVintageous

@haze haze closed this Sep 25, 2022
@haze
Copy link
Author

haze commented Nov 25, 2022

Hello! I'm back to using Sublime & NeoVintageous.

Here's the configuration I use:

{
	"ignored_packages":
	[
		"Six",
		"Vintage",
		"Vintageous",
	],
	"color_scheme": "auto",
	"font_size": 16,
	"font_face": "SF Mono",
	"vintageous_clear_auto_indent_on_esc": false,
	"vintageous_use_sys_clipboard": true,
	"vintageous_exit_when_quiting_last_window": true,
	"vintageous_reset_mode_when_switching_tabs": false,
	"highlight_line": true,
	"neovintageous_build_version": 12700,
	"hot_exit": false,
	"remember_open_files": false,
}

(Regardless of what hot_exit is, typing :q into the last window keeps ST running/open (with no windows to select))

I'm using macOS 13.1 Beta (22C5050e)

@haze haze reopened this Nov 25, 2022
…dow is closed, quit Sublime Text completely
@haze haze force-pushed the haze/close-st-when-closing-last-window branch from f31e169 to 5169d7d Compare November 25, 2022 18:14

_close_view(window, **kwargs)

if len(sublime.windows()) == 1 and exit_app_when_quitting_last_window:
sublime.run_command('exit')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try changing sublime.run_command('exit') to window.run_command('close') and see if that still works for you. If yes, then it seems the call to _close_view() above is not closing your view. Because below this there is a check len(window.views()) == 0 so it expects there to be no views open at that point. It will only call window.run_command('close') if 0 views are open.

@gerardroche
Copy link
Contributor

I can't reproduce it. But haven't been able to test on a mac yet. I left a comment here: https://github.com/NeoVintageous/NeoVintageous/pull/819/files#r1033433715 about something to try to debug the issue.

@gerardroche
Copy link
Contributor

gerardroche commented Nov 28, 2022

I should note that the Origami plugin is required for some windowing behaviours to work properly e.g. it's required for closing empty panes when closing views and window splitting (e.g. <C-w>s and <C-w>v).

https://github.com/SublimeText/Origami

@gerardroche
Copy link
Contributor

fyi there was a typo in documentation for the setting:

vintageous_exit_when_quitting_last_window

Should only have one "t".

vintageous_exit_when_quiting_last_window

I would bet this was the issue. You probably copy and pasted the setting and it's very hard to see the typo.

@gerardroche
Copy link
Contributor

Doh. The correct spelling is with two t's. So the documentation was right and the typo was in the code.

I'll have to fix the spelling and deprecate the misspelled setting. I'll do it with backwards compatibility, so both work. And make sure it's documented correctly.

Sorry about this.

gerardroche added a commit that referenced this pull request Aug 11, 2023
Rename setting to fix typo:

    vintageous_exit_when_quiting_last_window

to

    vintageous_exit_when_quitting_last_window

This is backwards compatible meaning both settings now currently work,
but all documentation now references the correct setting.

Re #953
Fix #819
@gerardroche
Copy link
Contributor

Also, ZZ and :xit are not respecting the setting. In the next version ZZ and :xit will be the same as :wq.

In the meantime you can map it:

nnoremap ZZ :wq<CR>

gerardroche added a commit that referenced this pull request Aug 11, 2023
eugenesvk added a commit to eugenesvk/NeoVintageous that referenced this pull request Jan 6, 2024
Rename setting to fix typo:

    vintageous_exit_when_quiting_last_window

to

    vintageous_exit_when_quitting_last_window

This is backwards compatible meaning both settings now currently work,
but all documentation now references the correct setting.

Re NeoVintageous#953
Fix NeoVintageous#819
eugenesvk pushed a commit to eugenesvk/NeoVintageous that referenced this pull request Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants