You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Haven't tested this, but could potentially do something like:
localfunctionis_dart_project()
-- Check for pubspec.yaml in the current directory or parent directorieslocalfunctionfind_pubspec(path)
ifvim.fn.filereadable(path..'/pubspec.yaml') ==1thenreturntrueendlocalparent=vim.fn.fnamemodify(path, ':h')
ifparent==paththenreturnfalseendreturnfind_pubspec(parent)
endreturnfind_pubspec(vim.fn.getcwd())
end-- Create an autocommand groupvim.api.nvim_create_augroup('FlutterAutoQuit', { clear=true })
-- Create the autocommandvim.api.nvim_create_autocmd('VimLeavePre', {
group='FlutterAutoQuit',
callback=function()
ifis_dart_project() thenvim.cmd('FlutterQuit')
endend,
desc='Automatically run FlutterQuit when exiting Neovim in a Dart project'
})
A simple and small but potentially resource saving feature, as it's sometimes easy to forget to quit flutter processes before exiting nvim.
Whenever exiting nvim, stop any current attached flutter processes.
The text was updated successfully, but these errors were encountered: