Skip to content

Commit

Permalink
Merge pull request #6 from marcw/master
Browse files Browse the repository at this point in the history
Add preview option
  • Loading branch information
dahlia committed Feb 9, 2020
2 parents 33ba0e4 + 28c61fe commit 3adcdb3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
7 changes: 7 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 Expand Up @@ -187,8 +192,10 @@ To be released. Bundles ``fzf`` 0.17.5.
- Dropped Python 2.6 and 3.3 supports.
- Officially support Python 3.7 (it anyway had worked though).
- Marked the package as supporting type checking by following `PEP 561`_.
- Added ``preview`` option. [`#6`__ by Marc Weistroff]

.. _PEP 561: https://www.python.org/dev/peps/pep-0561/
__ https://github.com/dahlia/iterfzf/pull/6


Version 0.4.0.17.3
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

0 comments on commit 3adcdb3

Please sign in to comment.