Skip to content

Commit

Permalink
Add FlutterScreenshot command
Browse files Browse the repository at this point in the history
  • Loading branch information
insidewhy committed Nov 21, 2021
1 parent b87696d commit 2292de5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ affecting the `:FlutterAttach` command.
* `:FlutterAttach <args>` - calls `flutter attach <args>`
* `:FlutterHotReload` - triggers a hot reload on the current Flutter process
* `:FlutterHotRestart` - triggers a hot restart on the current Flutter process
* `:FlutterScreenshot` - takes a screenshot of the current Flutter application and saves it in the project directory
* `:FlutterQuit` - quits the current Flutter process
* `:FlutterDevices` - opens a new buffer, and writes the output of `flutter devices` to it
* `:FlutterSplit` - opens Flutter output in a horizontal split
Expand Down
4 changes: 4 additions & 0 deletions autoload/flutter.vim
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ function! flutter#quit() abort
return flutter#send('q')
endfunction

function! flutter#screenshot() abort
return flutter#send('s')
endfunction

function! flutter#_exit_cb(job, status) abort
if exists('g:flutter_job')
unlet g:flutter_job
Expand Down
2 changes: 2 additions & 0 deletions plugin/flutter.vim
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ command! FlutterHotReload call flutter#hot_reload()
command! -nargs=* -complete=file FlutterRun call flutter#run(<f-args>)
command! -nargs=* -complete=file FlutterAttach call flutter#attach(<f-args>)
command! FlutterHotRestart call flutter#hot_restart()
command! FlutterScreenshot call flutter#screenshot()
command! FlutterQuit call flutter#quit()
command! FlutterVisualDebug call flutter#visual_debug()

Expand All @@ -67,6 +68,7 @@ function! FlutterMenu() abort
menu Flutter.Attach :FlutterAttach<CR>
menu Flutter.Hot\ Reload :FlutterHotReload<CR>
menu Flutter.Hot\ Restart :FlutterHotRestart<CR>
menu Flutter.Screenshot :FlutterScreenshot<CR>
menu Flutter.Open\ Output.In\ &Split :FlutterSplit<CR>
menu Flutter.Open\ Output.In\ &VSplit :FlutterVSplit<CR>
menu Flutter.Open\ Output.In\ &Tab :FlutterTab<CR>
Expand Down

0 comments on commit 2292de5

Please sign in to comment.