修复导入错误

This commit is contained in:
2025-10-05 19:22:55 +08:00
parent a12445a00a
commit 93113f4aaf
4 changed files with 143 additions and 40 deletions

View File

@@ -191,9 +191,7 @@ def _create_tmp(content: str) -> str:
def _open_with_nvim(file_path: str) -> None:
# 获取终端环境变量默认为xterm
term = os.environ.get('TERMINAL', '')
if not term:
term = 'xterm'
term = os.getenv('TERMINAL', 'xterm')
# 获取终端名称
name = os.path.basename(term)

View File

@@ -8,16 +8,16 @@ class DeleteMenu:
self._r = r
def run(self):
try:
result = run_search("")
except Exception as e:
print(f"Error: {e}")
self._r.error(str(e))
return
if result.status != "SUCCESS":
self._r.error(result.data)
return
while True:
try:
result = run_search("")
except Exception as e:
print(f"Error: {e}")
self._r.error(str(e))
return
if result.status != "SUCCESS":
self._r.error(result.data)
return
if len(result.data) == 0:
self._r.select("删除", ["未找到Snippet记录"])
break