From 84540250f790710761e2df2cde1e26286cfdac75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 3 Jul 2024 13:59:39 +0800 Subject: [PATCH] Editor: make `--ts-version false` disable version detection --- doc/json_schema.json | 2 +- src/data/help.json | 2 +- src/detection/editor/editor.c | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/json_schema.json b/doc/json_schema.json index eded507e5..c8a317aa3 100644 --- a/doc/json_schema.json +++ b/doc/json_schema.json @@ -576,7 +576,7 @@ }, "tsVersion": { "type": "boolean", - "description": "Whether to detect and display the version of terminal and shell. Mainly for benchmarking", + "description": "Whether to detect and display the version of terminal, shell and editor. Mainly for benchmarking", "default": true } } diff --git a/src/data/help.json b/src/data/help.json index e7fe60297..bdefdd8e2 100644 --- a/src/data/help.json +++ b/src/data/help.json @@ -728,7 +728,7 @@ }, { "long": "ts-version", - "desc": "Whether to detect and display the version of terminal and shell", + "desc": "Whether to detect and display the version of terminal, shell and editor", "remark": "Mainly for benchmarking", "arg": { "type": "bool", diff --git a/src/detection/editor/editor.c b/src/detection/editor/editor.c index c6a281c17..84b3b2632 100644 --- a/src/detection/editor/editor.c +++ b/src/detection/editor/editor.c @@ -26,6 +26,8 @@ const char* ffDetectEditor(FFEditorResult* result) return "$VISUAL or $EDITOR not set"; } + if (!instance.config.display.tsVersion) return NULL; + #ifndef _WIN32 if (result->name.chars[0] != '/') {