diff --git a/doc/ddc.txt b/doc/ddc.txt index 9ce132a..da87ae2 100644 --- a/doc/ddc.txt +++ b/doc/ddc.txt @@ -1297,6 +1297,9 @@ FAQ 28: |ddc-faq-28| FAQ 29: |ddc-faq-29| ddc.vim supports multilines text? +FAQ 30: |ddc-faq-30| + I want to use inline UI when there's single item. + ------------------------------------------------------------------------------ *ddc-faq-1* @@ -1717,6 +1720,20 @@ You can use the library to implement the feature. https://github.com/Milly/ddc-unprintable + *ddc-faq-30* +Q: I want to use "inline" UI when there's single item. + +A: You can use |ddc-option-dynamicUi| for it. > + args.contextBuilder.patchGlobal({ + dynamicUi: (_denops: Denops, args: Record) => { + const uiArgs = args as { + items: DdcItem[], + }; + return Promise.resolve(uiArgs.items.length == 1 ? "inline" : "pum"); + }, + }); +< + ============================================================================== COMPATIBILITY *ddc-compatibility*