Closed tennashi closed 1 year ago
Warning: I will close the issue without the minimal init.vim and the reproduction instructions.
Once an item has been previewed, previewing another item and then previewing it again will empty the buffer.
The following code may be the reason why the contents of the buffer are not saved. https://github.com/Shougo/ddu-ui-ff/blob/36a0c44165ef081740b8721c7a8a4fe3b2a93e90/denops/%40ddu-ui-ff/preview.ts#L231-L245
preview contents are displayed.
ddu-ui-ff version (SHA1): 36a0c44165ef081740b8721c7a8a4fe3b2a93e90
36a0c44165ef081740b8721c7a8a4fe3b2a93e90
denops.vim version (SHA1): d7a15615f86830e9464c30f761a3911f619b38b3
d7a15615f86830e9464c30f761a3911f619b38b3
deno version(deno -V output): deno 1.33.1
deno -V
deno 1.33.1
OS: Linux (6.1.0-7-amd64)
neovim/Vim :version output:
:version
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Mar 4 2023 19:53:01) 適用済パッチ: 1-1376
" Your minimal init.vim/vimrc set runtimepath+=~/path/to/ddu.vim/ set runtimepath+=~/path/to/ddu-ui-ff/ set runtimepath+=~/path/to/test/ call ddu#custom#patch_global({ \ 'uiParams': { \ 'ff': { \ 'autoAction': {'name': 'preview'}, \ }, \ }, \})
~/path/to/test_kind/denops/@ddu-sources/test.ts
import { BaseSource, Item } from "https://deno.land/x/ddu_vim@v2.3.0/types.ts"; import { GatherArguments } from "https://deno.land/x/ddu_vim@v2.3.0/base/source.ts";
type Params = Record<never, never>;
export class Source extends BaseSource { kind = "test";
gather(_args: GatherArguments): ReadableStream<Item[]> { return new ReadableStream({ start(controler) { controler.enqueue([ { word: "test-1" }, { word: "test-2" }, ]); controler.close(); }, }); }
params(): Params { return {}; } }
* `~/path/to/test_kind/denops/@ddu-kinds/test.ts` ```ts import { ActionArguments, ActionFlags, BaseKind, Previewer, } from "https://deno.land/x/ddu_vim@v2.4.0/types.ts"; import { GetPreviewerArguments } from "https://deno.land/x/ddu_vim@v2.4.0/base/kind.ts"; type Params = Record<never, never>; export class Kind extends BaseKind<Params> { actions: Record< string, (args: ActionArguments<Params>) => Promise<ActionFlags> > = {}; getPreviewer(_args: GetPreviewerArguments): Promise<Previewer | undefined> { return Promise.resolve({ kind: "nofile", contents: ["hoge"], }); } params(): Params { return {}; } }
:call ddu#start({'ui': 'ff', 'sources': [{'name': 'test'}]})
test-1
j
test-2
k
:redir
:message
Please test the latest version. It seems fixed.
Looks like the problem has not been fixed yet. The reproduction procedure and the minimum code still confirm the occurrence of the problem. @Shougo
Fixed.
Warning: I will close the issue without the minimal init.vim and the reproduction instructions.
Problems summary
Once an item has been previewed, previewing another item and then previewing it again will empty the buffer.
The following code may be the reason why the contents of the buffer are not saved. https://github.com/Shougo/ddu-ui-ff/blob/36a0c44165ef081740b8721c7a8a4fe3b2a93e90/denops/%40ddu-ui-ff/preview.ts#L231-L245
Expected
preview contents are displayed.
Environment Information
ddu-ui-ff version (SHA1):
36a0c44165ef081740b8721c7a8a4fe3b2a93e90
denops.vim version (SHA1):
d7a15615f86830e9464c30f761a3911f619b38b3
deno version(
deno -V
output):deno 1.33.1
OS: Linux (6.1.0-7-amd64)
neovim/Vim
:version
output:Provide a minimal init.vim/vimrc without plugin managers (Required!)
~/path/to/test_kind/denops/@ddu-sources/test.ts
type Params = Record<never, never>;
export class Source extends BaseSource {
kind = "test";
gather(_args: GatherArguments): ReadableStream<Item[]> {
return new ReadableStream({
start(controler) {
controler.enqueue([
{ word: "test-1" },
{ word: "test-2" },
]);
controler.close();
},
});
}
params(): Params { return {}; } }
How to reproduce the problem from neovim/Vim startup (Required!)
:call ddu#start({'ui': 'ff', 'sources': [{'name': 'test'}]})
(previewtest-1
)j
(previewtest-2
)k
(previewtest-1
)Screenshot (if possible)
Upload the log messages by
:redir
and:message
(if errored)