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

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

[elpa] externals/pyim 862776bf21 24/26: Add pyim-process-plan-to-select-


From: ELPA Syncer
Subject: [elpa] externals/pyim 862776bf21 24/26: Add pyim-process-plan-to-select-next-word
Date: Sun, 26 Jun 2022 10:57:53 -0400 (EDT)

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

    Add pyim-process-plan-to-select-next-word
---
 pyim-page.el    | 9 ++-------
 pyim-process.el | 8 ++++++++
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/pyim-page.el b/pyim-page.el
index 9b2408a2bd..1854a8472b 100644
--- a/pyim-page.el
+++ b/pyim-page.el
@@ -596,13 +596,8 @@ pyim-page 的核心的功能,为此增加代码的复杂度和测试的难度
   (interactive "p")
   (if (pyim-process-without-entered-p)
       (pyim-process-select-last-char)
-    (let ((new (+ (pyim-process-get-candidate-position) arg))
-          (len (pyim-process-candidates-length)))
-      (pyim-process-plan-to-select-word
-       (if (>= len new)
-           (if (> new 0) new len)
-         1))
-      (pyim-process-ui-refresh 'hightlight-current))))
+    (pyim-process-plan-to-select-next-word arg)
+    (pyim-process-ui-refresh 'hightlight-current)))
 
 (defun pyim-page-previous-word (arg)
   (interactive "p")
diff --git a/pyim-process.el b/pyim-process.el
index ce5685e8a5..62ebb30b6a 100644
--- a/pyim-process.el
+++ b/pyim-process.el
@@ -638,6 +638,14 @@ imobj 组合构成在一起,构成了 imobjs 这个概念。比如:
   (setq pyim-process--candidate-position
         word-position-in-candidates))
 
+(defun pyim-process-plan-to-select-next-word (n)
+  (let ((new (+ (pyim-process-get-candidate-position) n))
+        (len (pyim-process-candidates-length))
+        (pos (if (>= len new)
+                 (if (> new 0) new len)
+               1)))
+    (pyim-process-plan-to-select-word pos)))
+
 ;; ** 选词相关
 (cl-defgeneric pyim-process-select-word (scheme))
 



reply via email to

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