Closed dahakawang closed 5 years ago
similar issue could also be triggered (but not always) if we input main.<TAB>
, provide main
is a function name defined in current file.
I get the same error when I start to type #include, bisecting seems the commit that introduced the issue is 2551f95372f66157cac3e7697d30a351e80ced80
As a quick fix I've decoded to utf-8 the byte-string object where needed:
diff --git a/pythonx/completers/cpp/__init__.py b/pythonx/completers/cpp/__init__.py
index a65461511903..83dda755384b 100644
--- a/pythonx/completers/cpp/__init__.py
+++ b/pythonx/completers/cpp/__init__.py
@@ -49,10 +49,10 @@ def strip_optional(menu):
def get_word(text):
- parts = re.split(r'[ (\[{<]', text, 1)
+ parts = re.split(r'[ (\[{<]', text.decode('utf-8'), 1)
if not parts:
return text
- return parts[0]
+ return parts[0].encode('utf-8')
def get_token_path(line, column, word):
or even better I guess:
diff --git a/pythonx/completers/cpp/__init__.py b/pythonx/completers/cpp/__init__.py
index a65461511903..fde637e3a9ac 100644
--- a/pythonx/completers/cpp/__init__.py
+++ b/pythonx/completers/cpp/__init__.py
@@ -49,7 +49,7 @@ def strip_optional(menu):
def get_word(text):
- parts = re.split(r'[ (\[{<]', text, 1)
+ parts = re.split(br'[ (\[{<]', text, 1)
if not parts:
return text
return parts[0]
As far as I can see this is now fixed in ecb1bf10e55357c9f3ffdce3fe01950747e9aed4 so this issue can be closed.
The bug is easy to trigger, just open an c++ source file, press and hold 'd'.
I met this issue after done an upgrade( now I'm at 4ef67a0 but not sure where I was), I'm using osx and my VIM info is also attached.
appreciate if you can help to solve this bug, and let me know if you need further input from me. 😃
VIM INFO
Error Message