New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
E36 from quickfix list (smaller than 3 lines) with noequalalways and buftype=nofile #908
Comments
A similar issue: calling |
I think opening a new window from the quickfix/location list window should result in the same behavior regarding the height as with |
Some dirty workaround: function! MyQuickfixCR()
try
call feedkeys("\<CR>", 'nx')
catch /:E36:/
set equalalways
call feedkeys("\<CR>", 'nx')
set noequalalways
endtry
endfunction
autocmd Filetype qf map <buffer> <cr> :call MyQuickfixCR()<cr> But given how often plugins map |
Hi, On Wed, Jul 6, 2016 at 2:18 PM, Daniel Hahler vim-dev-github@256bit.org
Yes. This is by design. When opening a file from the quickfix window,
This is the expected behavior of the 'noequalalways' option.
|
What about making the opening from a qf/loclist window as smart as with And why should So please consider re-opening it. |
@chrisbra |
I don't quite understand. There have been too many problems mentioned here. What exactly is your problem? |
@chrisbra set buftype=nofile
set noequalalways
call setqflist([{'lnum': 1, 'bufnr': 1, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': 0, 'type': 'E', 'pattern': '', 'text': 'msg'}])
copen
resize 1 Run it with I like to use While So you are right: there are several issues, but it boils down to:
I think those issues are really related. Besides preferring FWIW here is my current workaround: function! MyQuickfixCR()
let prev_map = "\<Plug>MyQuickfixCRPre"
exe 'nunmap <buffer> <cr>'
try
call feedkeys(prev_map, 'x')
catch /:E36:/
set equalalways
try
call feedkeys(prev_map, 'x')
finally
set noequalalways
endtry
finally
exe 'map <buffer> <cr> :call MyQuickfixCR()<cr>'
endtry
endfunction
function! SetupMyQuickfixCR()
let cr_map = ':call MyQuickfixCR()<cr>'
if maparg('<cr>', 'n') == cr_map
" Already setup, don't do it twice.
return
endif
let prev_map = maparg('<cr>', 'n')
if !len(prev_map)
let prev_map = "\<CR>"
endif
exe 'nmap <buffer> <Plug>MyQuickfixCRPre '.prev_map
exe 'nmap <buffer> <cr> '.cr_map
endfunction
call SetupMyQuickfixCR() This handles existing mappings from e.g. Vader, and chains/wraps them. |
% vim -u minimal.vim
Now going to the quickfix list (
C-w j
) and pressing Enter will result in "E36: Not enough room".This happens because the "nofile" buffer will not be re-used to display the error, and when creating a new split apparently
:1sp
(or even:0sp
?!) will be used.I see the following issues here:
The text was updated successfully, but these errors were encountered: