fix: SaveAndExecute no longer creates unnamed buffers
This commit is contained in:
parent
5f62784267
commit
39db6a06ea
|
@ -271,16 +271,13 @@ function! SaveAndExecute(ex_command) abort
|
||||||
" get file path of current file
|
" get file path of current file
|
||||||
let s:current_buffer_file_path = expand("%")
|
let s:current_buffer_file_path = expand("%")
|
||||||
|
|
||||||
let s:output_buffer_name = "Python"
|
let s:output_buffer_name = "Output"
|
||||||
let s:output_buffer_filetype = "output"
|
let s:output_buffer_filetype = "output"
|
||||||
|
|
||||||
" reuse existing buffer window if it exists otherwise create a new one
|
" reuse existing buffer window if it exists otherwise create a new one
|
||||||
if !exists("s:buf_nr") || !bufexists(s:buf_nr)
|
if !exists("s:buf_nr") || !bufexists(s:buf_nr) || bufwinnr(s:buf_nr) == -1
|
||||||
silent execute 'top new ' . s:output_buffer_name
|
silent execute 'top new ' . s:output_buffer_name
|
||||||
let s:buf_nr = bufnr('%')
|
let s:buf_nr = bufnr('%')
|
||||||
elseif bufwinnr(s:buf_nr) == -1
|
|
||||||
silent execute 'top new'
|
|
||||||
silent execute s:buf_nr . 'buffer'
|
|
||||||
elseif bufwinnr(s:buf_nr) != bufwinnr('%')
|
elseif bufwinnr(s:buf_nr) != bufwinnr('%')
|
||||||
silent execute bufwinnr(s:buf_nr) . 'wincmd w'
|
silent execute bufwinnr(s:buf_nr) . 'wincmd w'
|
||||||
endif
|
endif
|
||||||
|
@ -296,7 +293,7 @@ function! SaveAndExecute(ex_command) abort
|
||||||
setlocal norelativenumber
|
setlocal norelativenumber
|
||||||
setlocal showbreak=""
|
setlocal showbreak=""
|
||||||
|
|
||||||
nnoremap <silent> <buffer> q :bdelete<CR>
|
nnoremap <silent> <buffer> q :bdelete!<CR>'.zz
|
||||||
|
|
||||||
" clear the buffer
|
" clear the buffer
|
||||||
setlocal noreadonly
|
setlocal noreadonly
|
||||||
|
|
Loading…
Reference in New Issue