dthree / vorpal

Node's framework for interactive CLIs
http://vorpal.js.org
MIT License
5.64k stars 280 forks source link

Pressing tab to autocomplete in the middle of a string actually prints tab #32

Closed scotthovestadt closed 8 years ago

scotthovestadt commented 8 years ago

If I start typing my command: command-one param | command-two param

Then I go back and try to edit command-one and change it to command-three, put my cursor here: com_ | command-two param

Then I hit tab, it actually prints tab. No autocomplete. I think the code doesn't even think about the cursor position. Is it possible to react to the cursor pos?

dthree commented 8 years ago

I think I intentionally check if the cursor is at the end, but maybe that's a bad idea. Should be a quick fix.

dthree commented 8 years ago

Okay this was actually really tricky, but should be good now.