Ticket #2957: broken autocompletion in mcedit

...if system and file charsets are different.

Initial step: refactoring: do actual completion word substitution
outside of editcmd_dialog_completion_show().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(edit_complete_word_cmd): make correct charset conversion

...before insert autocompletion result.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Add tests for coverage the bug.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Add test_autocomplete_single() test

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
(edit_complete_word_cmd): don't get bytes directly from editor buffer.

(edit_get_match_keyword_cmd): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(editcmd_dialog_completion_show): adjust dialog position.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Merge branch '2957_mcedit_broken_autocompletion'

* 2957_mcedit_broken_autocompletion:
  (editcmd_dialog_completion_show): adjust dialog position.
  (edit_complete_word_cmd): don't get bytes directly from editor buffer.
  Add test_autocomplete_single() test
  Add tests for coverage the bug.
  (edit_complete_word_cmd): make correct charset conversion
  Ticket #2957: broken autocompletion in mcedit