1
Fork 0
mirror of https://github.com/j1g5awi/krunner-vscode.git synced 2024-11-24 01:49:28 +00:00

fix: only search name

This commit is contained in:
jigsaw 2022-04-09 23:42:40 +08:00
parent 123344a875
commit 3d95df51d3

View file

@ -1,7 +1,7 @@
import json import json
import os import os
import pathlib
import sqlite3 import sqlite3
from pathlib import Path
from typing import NamedTuple from typing import NamedTuple
import dbus.service import dbus.service
@ -61,14 +61,14 @@ class Runner(dbus.service.Object):
return [ return [
Match( Match(
path, path,
pathlib.Path(path).name, Path(path).name,
"com.visualstudio.code.oss", "com.visualstudio.code.oss",
100, 100,
1.0, 1.0,
{"subtext": path}, {"subtext": path},
) )
for path in get_path_list() 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)") @dbus.service.method(iface, out_signature="a(sss)")