From 9f261cea7bf7dab0d49794ae81809f9f16815057 Mon Sep 17 00:00:00 2001 From: Like Ma Date: Fri, 8 May 2020 02:20:51 +0800 Subject: [PATCH] Fix incorrect conversion. Traceback (most recent call last): File "/usr/bin/diffuse", line 5592, in im_retrieve_surrounding_cb im.set_surrounding(s, len(s), n) TypeError: Must be string, not bytes --- src/usr/bin/diffuse | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/usr/bin/diffuse b/src/usr/bin/diffuse index 398fcb0..eeec4c7 100755 --- a/src/usr/bin/diffuse +++ b/src/usr/bin/diffuse @@ -5585,8 +5585,7 @@ class FileDiffViewer(Gtk.Grid): if self.mode == CHAR_MODE: # notify input method of text surrounding the cursor s = nullToEmpty(self.getLineText(self.current_pane, self.current_line)) - s, n = codecs.encode(s, 'utf_8'), len(codecs.encode(s[:self.current_char], 'utf_8')) - im.set_surrounding(s, len(s), n) + im.set_surrounding(s, len(s), self.current_char) # callback for 'focus_in_event' def focus_in_cb(self, widget, event):