From 8b4f84bf37b53767d56a196a64498ad45573dd79 Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Sat, 12 Oct 2024 20:16:22 +0100 Subject: [PATCH] More docs --- docs/guide/requests.md | 12 +++++++++++- docs/guide/scripting.md | 4 ++++ src/posting/widgets/variable_autocomplete.py | 2 -- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/guide/requests.md b/docs/guide/requests.md index 8cde56c5..5a845059 100644 --- a/docs/guide/requests.md +++ b/docs/guide/requests.md @@ -37,6 +37,12 @@ By default, this name is used to generate the filename, but you can also choose Within the "Directory" field of this dialog, it's important to note that `.` refers to the currently loaded *collection* directory (that is, the directory that was loaded using the `--collection` option), and *not* necessarily the current working directory. +### Duplicating a request + +With a the cursor over a request in the collection tree, press ++d++ to create a duplicate of that request. This will bring up a dialog allowing you to change the name and description of the request, or move it to another location. + +To skip the dialog and quickly duplicate the request, press ++shift+d++, creating it as a sibling of the original request. The file name of the new request will be generated automatically. You can always modify the name and description after it's created in the `Info` tab. + ## Saving a request Press ++ctrl+s++ to save the currently open request. @@ -49,4 +55,8 @@ If the request is already saved on disk, ++ctrl+s++ will overwrite the previous Requests are stored on your file system as simple YAML files, suffixed with `.posting.yaml`. -A directory can be loaded into Posting using the `--collection` option, and all `.posting.yaml` files in that directory will be displayed in the sidebar. \ No newline at end of file +A directory can be loaded into Posting using the `--collection` option, and all `.posting.yaml` files in that directory will be displayed in the sidebar. + +## Deleting a request + +You can delete a request by moving the cursor over it in the tree, and pressing ++backspace++. diff --git a/docs/guide/scripting.md b/docs/guide/scripting.md index 6d8512c6..13477396 100644 --- a/docs/guide/scripting.md +++ b/docs/guide/scripting.md @@ -46,6 +46,10 @@ Press ++ctrl+e++ while a script input field inside the `Scripts` tab is focused !!! warning As of version 2.0.0, the script file must exist *before* pressing ++ctrl+e++. Posting will not create the file for you. +## Script logs + +If your script writes to `stdout` or `stderr`, you'll see the output in the `Scripts` tab in the Response section. + ### Example: Setup script The **setup script** is run before the request is built. diff --git a/src/posting/widgets/variable_autocomplete.py b/src/posting/widgets/variable_autocomplete.py index 14689388..a16380a3 100644 --- a/src/posting/widgets/variable_autocomplete.py +++ b/src/posting/widgets/variable_autocomplete.py @@ -87,10 +87,8 @@ def _search_string(self, target_state: TargetState) -> str: text = target_state.text if is_cursor_within_variable(cursor, text): variable_at_cursor = get_variable_at_cursor(cursor, text) - print(f"search string = {variable_at_cursor}") return variable_at_cursor or "" else: - print(f"search string = {target_state.text}") return target_state.text def get_variable_candidates(self, target_state: TargetState) -> list[DropdownItem]: