Closed tennashi closed 1 year ago
Warning: I will close the issue without the minimal init.vim and the reproduction instructions.
Previewing an item with item.word containing | will execute the string following |.
item.word
|
Probably need to escape here.
https://github.com/Shougo/ddu-ui-ff/blob/36a0c44165ef081740b8721c7a8a4fe3b2a93e90/denops/%40ddu-ui-ff/preview.ts#L272-L291
| is treated as just a string.
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: "| !ls" }, ]); 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'}]})
:redir
:message
Fixed.
Warning: I will close the issue without the minimal init.vim and the reproduction instructions.
Problems summary
Previewing an item with
item.word
containing|
will execute the string following|
.Probably need to escape here.
https://github.com/Shougo/ddu-ui-ff/blob/36a0c44165ef081740b8721c7a8a4fe3b2a93e90/denops/%40ddu-ui-ff/preview.ts#L272-L291
Expected
|
is treated as just a string.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: "| !ls" },
]);
controler.close();
},
});
}
params(): Params { return {}; } }
How to reproduce the problem from neovim/Vim startup (Required!)
:call ddu#start({'ui': 'ff', 'sources': [{'name': 'test'}]})
Screenshot (if possible)
Upload the log messages by
:redir
and:message
(if errored)