szermatt / emacs-bash-completion

Add programmable bash completion to Emacs shell-mode
GNU General Public License v2.0
281 stars 33 forks source link

wishlist: completing (complete -C) with cursor in the middle of line strips string after the cursor #52

Open perlancar opened 3 years ago

perlancar commented 3 years ago

Another issue which I noticed while writing #51 is that completing with the cursor in the middle of command-line is not fully supported. For example, this command line:

% remove-pdf-password -<tab> foo

will cause bash-completion.el to set this (truncated):

__EMACS_COMPLETE_WRAPPER=COMP_LINE='remove-pdf-password -'; COMP_POINT=$(( 1 + ${#COMP_LINE} )); COMP_CWORD=1; COMP_WORDS=( remove-pdf-password - ); ...

i.e., the part after the cursor position (foo) is stripped, while this is information that can be useful for the completer.