Shougo / unite.vim

:dragon: Unite and create user interfaces
http://www.vim.org/scripts/script.php?script_id=3396
Other
2.85k stars 225 forks source link

Problems when the prompt is below #595

Closed petobens closed 10 years ago

petobens commented 10 years ago

I noticed a few issues with new below prompt feature. Consider the following minimal vimrc

set nocompatible

let $ONEDRIVE_HOME = expand('C:/OD/Users/Pedro/')
let $DOTVIM = expand('$ONEDRIVE_HOME/vimfiles')

set runtimepath+=$DOTVIM/bundle/unite
set runtimepath+=$DOTVIM/bundle/vimproc/

call unite#filters#matcher_default#use(['matcher_fuzzy'])

let g:unite_split_rule = 'botright'
call unite#filters#sorter_default#use(['sorter_rank'])

nnoremap <silent> ,fs :Unite -silent -auto-resize file_rec/async<CR>

When I call the mapping in my vimfiles directory and input fooba as candidate I get the result seen in the first image. If I now replace the following lines in my minimal vimrc:

let g:unite_split_rule = 'botright'
call unite#filters#sorter_default#use(['sorter_rank'])

with

let g:unite_split_rule = 'belowright'
call unite#filters#sorter_default#use(['sorter_rank','sorter_reverse'])

and repeat the procedure of calling the mapping in my vimfiles directory and typing fooba I get the result seen in the second image. Comparing the two images you can see that when the prompt is below there is no cursor highlight, wrong autoresize and not all candidates are shown.

Ps: One doubt: Is it correct to use sorter_reverse to have the best match at the top when the prompt is at the bottom?

screenshot-30-05-2014_20-44-22 screenshot-30-05-2014_20-45-31

Shougo commented 10 years ago

I fixed it.

Ps: One doubt: Is it correct to use sorter_reverse to have the best match at the top when the prompt is at the bottom?

Yes. Candidates are reversed automatically.

petobens commented 10 years ago

The resize issue doesn't seem to be fixed: screenshot-02-06-2014_10-24-08

And when I use

call unite#filters#sorter_default#use(['sorter_rank','sorter_reverse'])

candidates i) are still missing (compare the first and second images) and ii) I want the best candidates to be at the top with cursor highlight also at the top, this doesn't happen

screenshot-02-06-2014_10-30-18

Shougo commented 10 years ago

candidates i) are still missing (compare the first and second images) and ii) I want the best candidates to be at the top with cursor highlight also at the top, this doesn't happen

nnoremap <silent> ,fs :Unite -silent -auto-resize -prompt-direction=top file_rec/async<CR>

It is feature. If prompt is below, candidates top is aloways below. See ctrlp plugin behavior.

Shougo commented 10 years ago

The resize issue doesn't seem to be fixed:

I cannot reproduce problem...

petobens commented 10 years ago

It is feature. If prompt is below, candidates top is aloways below. See ctrlp plugin behavior.

Okay I get it.

petobens commented 10 years ago

I cannot reproduce problem...

I'll write a minimal vimrc

petobens commented 10 years ago

WIth the following minimal vimrc

set nocompatible

let $ONEDRIVE_HOME = expand('C:/OD/Users/Pedro/')
let $DOTVIM = expand('$ONEDRIVE_HOME/vimfiles')

set runtimepath+=$DOTVIM/bundle/unite

let g:unite_split_rule = 'botright'

nnoremap <silent> ,bm :Unite -silent -auto-resize -default-action=rec bookmark<CR>

open gVim and create two bookmark directores: :UniteBookmarkAdd C:\Users\Pedro\Desktop\foo\ and :UniteBookmarkAdd C:\Users\Pedro\Desktop\bar\. Now call the ,bm mapping and type f. You get the result seen in the next image (note that the automatic resizing does not work)

screenshot-02-06-2014_19-27-44

Shougo commented 10 years ago

OK. I will test later.

petobens commented 10 years ago

Okay, no hurry at all. Thanks

Shougo commented 10 years ago

Fixed it.

petobens commented 10 years ago

Thank you!