Comments (13)
@tami5 I've implemented scrolling mapping. Please see docs.
from nvim-compe.
If this problem was solved, please close this.
from nvim-compe.
Could you explain it in more little in detail?
from nvim-compe.
So basically, in addition to open/close the documentation window. on event, add <c-u>
and <c-d>
to navigated it. This is super useful when the content is 80 lines long and instead of having large preview window, it would be set to minheight and the user can navigate through it.
Does it make sense?
from nvim-compe.
I think documentation scrolling
is easy. So we add it to README.md is enough.
nnoremap <expr> <C-f> <SID>scroll(+4)
nnoremap <expr> <C-u> <SID>scroll(-4)
inoremap <expr> <C-f> <SID>scroll(+4)
inoremap <expr> <C-u> <SID>scroll(-4)
function! s:scroll(count) abort
let l:ctx = {}
function! l:ctx.callback(count) abort
let l:wins = nvim_list_wins()
let l:wins = filter(l:wins, '!empty(nvim_win_get_config(v:val).relative)')
if !empty(l:wins)
call lamp#view#window#do(l:wins[0], { ->
\ execute(printf('normal! %s%s%s%s',
\ abs(a:count),
\ a:count >= 0 ? "\<C-e>" : "\<C-y>",
\ abs(a:count),
\ a:count >= 0 ? 'j' : 'k',
\ ))
\ })
endif
endfunction
call timer_start(100, { -> l:ctx.callback(a:count) })
return "\<Ignore>"
endfunction
from nvim-compe.
I don't understand how would this control the popup? π€ also, scroll will only be useful when the max height of the popup can be limited to certain extend.
from nvim-compe.
Ah. You want to enter to popup, right?
It's bit difficult now... hm...
from nvim-compe.
I mean by control the popup is to control only what part is visible through scrolling the popup buffer ... hope you understand that way.
For scrolling we can easily attach to it mappings when it get created and destroyed with it.
That is by normally binding buffer local mapping nnoremap <buffer>
in the global scope that control that popup and then during close unmap
from nvim-compe.
I think #57 (comment) is realizing scrolling...
from nvim-compe.
Thanks a lot @hrsh7th, I'll test out soon
from nvim-compe.
Well ... it would be nice to only map nav keys when the popup show and map them back when popup closes. I usually have inter mode mapping for c-f,c-b,c-d and it would be cool to have them working if no popup
from nvim-compe.
Hm... I can add the compe#scroll({ 'delta': +4, 'fallback': ... })
from nvim-compe.
Oh @hrsh7th that would be awesome !!!
from nvim-compe.
Related Issues (20)
- Breaking undo history after typing certain characters after completion HOT 1
- Can not get LSP Snippet working HOT 1
- relative path completion fail if not stating with './' HOT 1
- [Question] Don't append ? for optional arguments HOT 2
- Add the possibility to hide the completion source. HOT 4
- clangd not hiding suggestions after comma or space HOT 3
- Question/Help: LSP Snippet Support Not Working HOT 1
- [Question] Filter completion items by kind, exclude 'Text' items HOT 1
- Documentation syntax highlighting. HOT 5
- attempt to call field 'stylize_markdown' HOT 2
- Custom labels for completion types HOT 2
- FR/Question: Complete on any key HOT 3
- Documentation doesn't pop in completion in some cases HOT 1
- buffer completion should complete words for hidden buffers. HOT 3
- problem with vim-rsi pluggin -- <C-e> HOT 3
- Auto-import doesnβt work with a bunch of LSPs HOT 1
- Buffer Source Completion: diacritic characters are ignored HOT 2
- Triggered in command mode. HOT 2
- Integrate copilot.vim? HOT 2
- No fuzzy completion for [emoji] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-compe.