From e0f72f74ad048e1d6c68865d81306838112b58b3 Mon Sep 17 00:00:00 2001 From: Markus Kurtz Date: Mon, 28 Jul 2025 16:40:42 +0200 Subject: [PATCH] Add option for appending semicolons --- Completions/_autocomplete__history_lines | 5 ++--- README.md | 8 ++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Completions/_autocomplete__history_lines b/Completions/_autocomplete__history_lines index c037882..112d5c5 100644 --- a/Completions/_autocomplete__history_lines +++ b/Completions/_autocomplete__history_lines @@ -133,10 +133,9 @@ _autocomplete__history_lines() { fi local -Pa suf=( -S '' ) - if [[ $WIDGETSTYLE == *-select* && $#matches[@] > 1 ]]; then - # Enable multi-select. + zstyle -t ":autocomplete:$curcontext" append-semicolon; [[ $? != 1 ]] && + [[ $WIDGETSTYLE == *-select* && $#matches[@] > 1 ]] && suf=( -S ';' -R _autocomplete__history_lines_suffix ) - fi local tag=history-lines _comp_tags=" $tag" diff --git a/README.md b/README.md index 91d38f5..04384b6 100644 --- a/README.md +++ b/README.md @@ -339,6 +339,14 @@ a backend for it: } ``` +## Disable automatically added semicolons +Autocomplete adds a semicolon to each line to allow selecting another line afterwards. +The added semicolon get removed on most keystrokes besides . +You can deactivate this feature by setting `append-semicolon` to a non-true value: +```zsh +zstyle ':autocomplete:*' append-semicolon off +``` + ## Troubleshooting Try the steps in the [bug report template](.github/ISSUE_TEMPLATE/bug-report.md).