From 3d95df51d341d9ad3b6b9578142df844c4f60abe Mon Sep 17 00:00:00 2001 From: jigsaw Date: Sat, 9 Apr 2022 23:42:40 +0800 Subject: [PATCH] fix: only search name --- krunner_vscode/__main__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/krunner_vscode/__main__.py b/krunner_vscode/__main__.py index 4b010d3..4fb8e04 100755 --- a/krunner_vscode/__main__.py +++ b/krunner_vscode/__main__.py @@ -1,7 +1,7 @@ import json import os -import pathlib import sqlite3 +from pathlib import Path from typing import NamedTuple import dbus.service @@ -61,14 +61,14 @@ class Runner(dbus.service.Object): return [ Match( path, - pathlib.Path(path).name, + Path(path).name, "com.visualstudio.code.oss", 100, 1.0, {"subtext": path}, ) for path in get_path_list() - if query.lower() in path.lower() + if query.lower() in Path(path).name.lower() ] @dbus.service.method(iface, out_signature="a(sss)")