> > And on last thing, special character '&' can not be used in the TUI popup,
> 
> Yeah, it's hard to find a way to highlight it.  And then how do you type
> the character?  Mappings may get in the way.  Alt key may not always
> work.
>  

It is not necessary to highlight special character, they can be distinguished 
by parentheses.

:amenu PopUp.Cscope\ (&D)efinition  ...
:amenu PopUp.Cscope\ (&S)ymbol   ...
:amenu PopUp.Cscope\ (&C)allee   ...
:amenu PopUp.Cscope\ (&A)ssigned   ...

They should look like:

Cscope (D)efinition
Cscope (S)ymbol
Cscope (C)allee
Cscope (A)ssigned

or items can also be arranged by user like:

[D]  Cscope Definition
[S]  Cscope Symbol
[C]  Cscope Callee
[A]  Cscope Assigned

Both of them are quite acceptable, just like some traditional mono color TUI 
tools .

So, highlighting is not necessary if it requires a lot of work.

What might be necessary is making GVim's ':popup' command display the TUI's 
text based popup menu instead of the native win32's popup menu (or a guioption 
for this ?).

Can I explain this a little ?

1. GUI popup is only available for Win32 and GTK, but text based popup can run 
every where.
2. Part of vim users use CTRL+[ as ESC, text based popup can be closed by 
CTRL+[ while native GUI popup can't.
3. Native GUI ":popup" command sometimes behave in a strange way (also 
mentioned in gui.txt) and different from TUI's popup menu.

Here is an example:

----------- menutest.vim ------------
silent! aunmenu ]test.*

let g:selected_index=-1

amenu <silent> ]test.item\ 1  :let g:selected_index=1<cr>
amenu <silent> ]test.item\ 2  :let g:selected_index=2<cr>
amenu <silent> ]test.item\ 3  :let g:selected_index=3<cr>
amenu <silent> ]test.item\ 4  :let g:selected_index=4<cr>
amenu <silent> ]test.item\ 5  :let g:selected_index=5<cr>
amenu <silent> ]test.item\ 6  :let g:selected_index=6<cr>

function! MenuInputList()
    let g:selected_index=-1
    popup ]test
    echo "selected: ".g:selected_index
    return g:selected_index
endfunc

-------------------------------------
When MenuInputList() happens in TUI vim, you can see `g:selected_index` has 
been changed after ":popup" command, it is definitely the right way.

But it is a different result in GVim, no matter what item is selected, the echo 
command below will always print "selected: -1". After my investigation, 
":popup" command returns before actually executing the real menu command "let 
g:selected_index=?". It seems that the real menu command has been queued in 
win32 message buffer and will not be execute before ':popup' exits.

So, the echo command displays the unchanged g:selected_index in GVim.

But when I was trying the TUI's ":popup" command in the latest vim, it worked 
great !! menu command (let g:selected_index=?) can be executed **BEFORE** 
":popup" command returns.

Executing menu command **BEFORE** ":popup" exiting is important because 
following commands can get the result of selected item. if not, every following 
command in the same function behave in the wrong way.

So, do you think it is necessary to execute menu command before ":popup" 
returning ? or to replace GVim's ":popup" menu with the TUI's text based one ?

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to