a_tty_kht(): take advantage of new n_SHEXP_STATE_WS_TRAIL
commit041d0ffb0a0e5d5c7985149f88a18135efd8958c
authorSteffen (Daode) Nurpmeso <steffen@sdaoden.eu>
Sat, 24 Jun 2017 23:07:52 +0000 (25 01:07 +0200)
committerSteffen (Daode) Nurpmeso <steffen@sdaoden.eu>
Sat, 1 Jul 2017 19:46:30 +0000 (1 21:46 +0200)
treeacc9fa6ef58b944141aa5fa478ede20b908d075d
parent9fa3036ab6e989358204f7e618d19c7825b54805
a_tty_kht(): take advantage of new n_SHEXP_STATE_WS_TRAIL

until now "? File <TAB>" would have tried to expand "File " because, hm,
of the pre IFS era failure to treat WS as IFS, thus the last real token
we have seen is "File ", but this is not what the user wants to expand!
It would have worked if a any quote would have been used, e.g. "File \"<TAB>",
but this is also not what a user wants.

We can now take advantage of the new n_SHEXP_STATE_WS_*, and if the last
token parse has not seen trailing whitespace then we can indeed
look at the last character, and if that is a whitespace (TODO not
mbyte/Unicode yet) then we can dare to use that as a desired
delimiter.  In effect "File <TAB>" will thus expand "*" instead.

While here, do not start any token parse if all we have seen is WS.
tty.c