fix: SaveAndExecute no longer creates unnamed buffers

This commit is contained in:
ManjaroOne666 2018-09-01 16:20:59 +01:00
parent 5f62784267
commit 39db6a06ea
1 changed files with 3 additions and 6 deletions

View File

@ -271,16 +271,13 @@ function! SaveAndExecute(ex_command) abort
" get file path of current file
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"
" 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
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('%')
silent execute bufwinnr(s:buf_nr) . 'wincmd w'
endif
@ -296,7 +293,7 @@ function! SaveAndExecute(ex_command) abort
setlocal norelativenumber
setlocal showbreak=""
nnoremap <silent> <buffer> q :bdelete<CR>
nnoremap <silent> <buffer> q :bdelete!<CR>'.zz
" clear the buffer
setlocal noreadonly