You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This sort of is an continuation for mattn/vim-fz#4 to allow users to set or append items. In order to achieve this I need two way communication with gof similar to language server protocol.
There is a few problem with this as in there is no fuzzy search and fuzzy match highlighting because it is very expensive to do in vimscript.
I would like to have a two way communication with gof similar to language server protocol. My thought was adding gof -s flag which starts gof in server mode and we can have two way communication with stdin and stdout.
function!s:on_change(id, event, data) abort" here is where the user would get a:data['word'] and perform actual search textlets:timer=timer_start(250, {-> fz#send(a:id, 'set', ['solarizeddark', 'solarizedlight']) })
endfunctionfunction!s:on_selection_change(id, event, data) abortif!empty(a:data['items'])
execute'colorscheme ' . a:data['items'][0]
endifendfunctionfunction!s:on_exit(id, event, data) abortifhas('s:timer')
calltimer_stop(s:timer)
unlets:timerendifendfunctionletl:id=fz#run({
\ 'type': 'manual',
\ 'on_search_change: function('s:on_search_change'),
\ 'on_selection_change: function('s:on_selection_change'),
\ 'on_exit': function('s:on_exit'),
\ })
My thought was to introduce just 2 new methods in vim-fz.
fz#send(id, event_name, data)
fz#on(id, event_name, callback). This might not be required if we mandate fz#run to pass it as above.
fz#send is to notify gof server. Here are the commands that server needs to understand at minimum.
Why do we need the server mode? In vim-lsp I would like to support LspWorkspaceSymbol which requires communicating back and forth with language server and vim-lsp.
Having two way communication also allows to create interesting features such as the quickpick where as user changes the selection we can change the colorscheme or filetype to get immediate feedback. cancel or exit is required to reset the colorscheme back in case the user never accepts the value.
The text was updated successfully, but these errors were encountered:
This sort of is an continuation for mattn/vim-fz#4 to allow users to set or append items. In order to achieve this I need two way communication with
gof
similar to language server protocol.Here is how quickpick.vim in pure vimscript.
There is a few problem with this as in there is no fuzzy search and fuzzy match highlighting because it is very expensive to do in vimscript.
I would like to have a two way communication with
gof
similar to language server protocol. My thought was addinggof -s
flag which startsgof
in server mode and we can have two way communication withstdin
andstdout
.My thought was to introduce just 2 new methods in
vim-fz
.fz#send(id, event_name, data)
fz#on(id, event_name, callback)
. This might not be required if we mandatefz#run
to pass it as above.fz#send
is to notifygof server
. Here are the commands thatserver
needs to understand at minimum.Why do we need the server mode? In vim-lsp I would like to support
LspWorkspaceSymbol
which requires communicating back and forth with language server andvim-lsp
.Having two way communication also allows to create interesting features such as the quickpick where as user changes the selection we can change the colorscheme or filetype to get immediate feedback.
cancel
orexit
is required to reset the colorscheme back in case the user never accepts the value.The text was updated successfully, but these errors were encountered: