added support for mid line autocompletion
fixed a bug with old text reappearing when autocompleting
fixed autocomplete cursor position

bugfix: cursor_state (no such setting) was being queried instead of
state_cursor
nick list was appearing even when cursor pos = 0