mongodb/mongo — pull request #110 by tadmarshall (2011-10-10 10:03:36+00:00)
Title: SERVER-4043 -- fix tab completion in mid-code

Add code to linenoise to do what readline was doing. When tab is
hit, we need to search backwards from the insertion point for a
break character (we're using " =+-/\\*?\"'`&<>;|@{([])}" for now)
and only pass the characters between that point and the cursor
position to the completion routine. When it gives us possible
completions, we need to insert them in place of the string we
extracted, which makes completion work when not at the left margin
and even when inside another expression. Linenoise was passing
the whole input line and substituting the replacement text for the
entire line.