File: 0007-further-fix-for-delete-surrounding-text.patch

package info (click to toggle)
fcitx 1%3A4.2.9.8-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 19,908 kB
  • sloc: ansic: 134,113; cpp: 7,280; sh: 2,778; python: 800; xml: 345; makefile: 39
file content (25 lines) | stat: -rw-r--r-- 979 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From be91060f4e6f0b0499ef3efb8f00d46b57a107b0 Mon Sep 17 00:00:00 2001
From: Weng Xuetian <wengxt@gmail.com>
Date: Tue, 8 Dec 2020 21:12:10 -0800
Subject: [PATCH] further fix for delete surrounding text

---
 src/frontend/qt/qfcitxinputcontext.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/frontend/qt/qfcitxinputcontext.cpp b/src/frontend/qt/qfcitxinputcontext.cpp
index e90c277e..3f8a06b3 100644
--- a/src/frontend/qt/qfcitxinputcontext.cpp
+++ b/src/frontend/qt/qfcitxinputcontext.cpp
@@ -603,7 +603,7 @@ void QFcitxInputContext::deleteSurroundingText(int offset, uint _nchar) {
 
     // validates
     if (nchar >= 0 && cursor + offset >= 0 &&
-        cursor + offset + nchar < ucsText.size()) {
+        cursor + offset + nchar <= ucsText.size()) {
         // order matters
         QVector<uint> replacedChars = ucsText.mid(cursor + offset, nchar);
         nchar = QString::fromUcs4(replacedChars.data(), replacedChars.size())
-- 
2.30.0