Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preview option #6

Merged
merged 1 commit into from
Feb 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ The following is the full list of parameters. Please pass them as

Corresponds to ``--prompt`` option.

``preview``
The preview command to execute. ``None`` by default.

Corresponds to ``--preview`` option.

``mouse``
``False`` to disable mouse. ``True`` by default.

Expand Down
3 changes: 3 additions & 0 deletions iterfzf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def iterfzf(
multi=False, mouse=True, print_query=False,
# Layout:
prompt='> ',
preview=None,
# Misc:
query='', encoding=None, executable=BUNDLED_EXECUTABLE or EXECUTABLE_NAME
):
Expand All @@ -50,6 +51,8 @@ def iterfzf(
cmd.append('--print-query')
if query:
cmd.append('--query=' + query)
if preview:
cmd.append('--preview=' + preview)
encoding = encoding or sys.getdefaultencoding()
proc = None
stdin = None
Expand Down
1 change: 1 addition & 0 deletions iterfzf/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def iterfzf(
print_query: bool = ...,
# Layout:
prompt: str = ...,
preview: Optional[str] = ...,
# Misc:
query: str = ...,
encoding: Optional[str] = ...,
Expand Down