emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/pyim eb585d56d1 10/26: Simplify pyim-select-word-by-num


From: ELPA Syncer
Subject: [elpa] externals/pyim eb585d56d1 10/26: Simplify pyim-select-word-by-number
Date: Sun, 26 Jun 2022 10:57:52 -0400 (EDT)

branch: externals/pyim
commit eb585d56d16a4f4b59eb9ddd1006b3227fcbd54e
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>

    Simplify pyim-select-word-by-number
---
 pyim-process.el | 1 +
 pyim.el         | 9 ++++-----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/pyim-process.el b/pyim-process.el
index d3cc3f477a..d2c08a02fa 100644
--- a/pyim-process.el
+++ b/pyim-process.el
@@ -644,6 +644,7 @@ imobj 组合构成在一起,构成了 imobjs 这个概念。比如:
 
 (cl-defmethod pyim-process-select-word ((_scheme pyim-scheme-quanpin))
   "从选词框中选择当前词条,然后删除该词条对应拼音。"
+  (pyim-process-create-code-criteria)
   (pyim-process-outcome-handle 'candidate)
   (let* ((imobj (pyim-process-get-first-imobj))
          (length-selected-word
diff --git a/pyim.el b/pyim.el
index ab4fcb4139..26ac5967df 100644
--- a/pyim.el
+++ b/pyim.el
@@ -468,7 +468,6 @@ FILE 的格式与 `pyim-dcache-export' 生成的文件格式相同,
 (defun pyim-select-word ()
   "从选词框中选择当前词条,然后删除该词条对应拼音。"
   (interactive)
-  (pyim-process-create-code-criteria)
   (if (pyim-process-get-candidates)
       (pyim-process-select-word (pyim-scheme-current))
     ;; 如果没有选项,输入空格
@@ -478,10 +477,10 @@ FILE 的格式与 `pyim-dcache-export' 生成的文件格式相同,
   "使用数字编号来选择对应的词条。"
   (interactive)
   (if (or pyim-select-word-by-number num)
-      (if (null (pyim-process-get-candidates))
-          (pyim-process-select-last-char)
-        (when (pyim-page-plan-to-select-word num)
-          (pyim-select-word)))
+      (if (and (pyim-process-get-candidates)
+               (pyim-page-plan-to-select-word num))
+          (pyim-process-select-word (pyim-scheme-current))
+        (pyim-process-select-last-char))
     ;; 有些输入法使用数字键编码,这种情况下,数字键就
     ;; 不能用来选词了。
     (call-interactively #'pyim-self-insert-command)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]