Fix for issue #116

The only problem still exist:
* fill whole input line
* move back by several steps (left arrow)
* type several characters
* move to the last but one position in the input window and type something again

In this way you will get strange behaviour like appearance of wrong symbol in the last position. But array 'input' has correct values.