Problem with completion popup text
fikovnik opened this issue · 5 comments
Hi, thanks for reporting the bug!
I think I know where's going wrong after some testing, I'll try to fix it!
Edit:
I think the cause of the problem is that I try to complete the command for the "full" text in the buffer. I think the correct implementation is complete the command based on the text before the cursor.
By the way, is it possible to provide the steps to reproduce it or the binary file you debugging on?
Thanks!
The binary is the R interpreter, once installed / compiled with debugging symbols, you can run it with debugger attached:
R -d gdb
put a breakpoint somwehere, e.g. Rf_eval
function and run the program:
b Rf_eval
r
then you can try the following:
the prefix R_inspect
should not be part of the completion.
Or trigger the suffix:
After some testing, I think there are two problems:
-
Autocompletion should base on the text before the cursor, not based on the full text in the input buffer
-
\W+
([^a-zA-Z0-9_]+
) should be used to split the display text in the popup instead of using spaces, which means:
The text in the popup should be changed to:
Rf_lang1
Rf_lang2
Rf_lang3
Rf_lang4
Rf_lang5
Rf_lang6
Rf_lastElt
Hi @fikovnik , thanks for the details you provided, these details are really helpful!
For some reason, I can't build the R interpreter with debug info successfully now. Can you help me to check if the bug is still there after this update? Is the new logic of autocompletion make sense?
Thanks!
Perfect! It fixes the issue.