Skip to content

Commit

Permalink
Support stopping of live updating by calling :BexecLive again.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferry Boender committed Apr 23, 2017
1 parent 588d98b commit b5ccce5
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 9 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ You can map execution of Bexec to a key for convenient execution. In your .vimrc

Now you can simply press `<F5>` to execute the current buffer.

To start live updating:

\bc

or

:BexecLive

To stop live updating, call `BexecLive` again.

For configuration options, please read the documentation (`:help bexec`) or
see the [documentation](doc/bexec.txt).

Expand Down
13 changes: 10 additions & 3 deletions autoload/bexec.vim
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,16 @@ endfunction
" Realtime updates to the bexec buffer.
"
function! bexec#Live(...)
let g:bexec_auto_save = 1
call <SID>BexecDo([])
au CursorHold,CursorHoldI,InsertLeave * call bexec#AutoSave()
if g:bexec_auto_save == 1
" Stop auto update
let g:bexec_auto_save = 0
au! CursorHold,CursorHoldI,InsertLeave * call bexec#AutoSave()
else
" Start auto update
let g:bexec_auto_save = 1
call <SID>BexecDo([])
au CursorHold,CursorHoldI,InsertLeave * call bexec#AutoSave()
endif
endfunction

function! bexec#AutoSave()
Expand Down
12 changes: 9 additions & 3 deletions doc/bexec.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*bexec.txt* Buffer execute and grab output Last Change: 08 Jan 2017
*bexec.txt* Buffer execute and grab output Last Change: 23 Apr 2017

Buffer Execute (v0.10) *buffer-execute* *bexec*
Buffer Execute (v0.11) *buffer-execute* *bexec*

The Bexec plugin allows the user to execute the current buffer if it
contains a script with a shebang (#!/path/to/interpreter) on the first line.
Expand Down Expand Up @@ -264,9 +264,15 @@ MISC *bexec-misc*

Changelog

v0.11
- Support stopping of live updating.

v0.10
- Add bexec_splitsize setting.

v0.9
- Move a lot of code to the autoload directory for faster startup (by
Lucas Hoffmann).
Lucas Hoffmann).

v0.8
- Honor splitbelow vim setting (by Christopher Pease).
Expand Down
8 changes: 5 additions & 3 deletions plugin/bexec.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
" Use the shebang (#!) or filetype to execute a script in the current buffer,
" capture its output and put it in a seperate buffer.
"
" Last Change: 2017 Jan 8
" Version: v0.10
" Last Change: 2017 Apr 23
" Version: v0.11
" Maintainer: Ferry Boender <ferry DOT boender AT electricmonk DOT nl>
" License: This file is placed in the public domain.
" Usage: To use this plugin:
Expand Down Expand Up @@ -45,7 +45,9 @@
" * Horizontal column pos gets lost when running in visual
" select mode.
" * Fix FIXME's.
" Changelog: v0.10 (Jan 08, 2017)
" Changelog: v0.11 (Apr 23, 2017)
" * Support stopping of live updating.
" v0.10 (Jan 08, 2017)
" * Add bexec_splitsize setting.
" v0.9 (Dec 03, 2015)
" * Move a lot of code to the autoload directory for faster
Expand Down

0 comments on commit b5ccce5

Please sign in to comment.