Ticket #2585 (Ask filename before create new file)

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
add option "Ask new file name" in the Configuration box

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Merge branch '2585_mcedit_input_fname_before_edit'

* 2585_mcedit_input_fname_before_edit:
  add option "Ask new file name" in the Configuration box
  Ticket #2585 (Ask filename before create new file)
Ticket #55: savannah: tab completion vs. spaces and escaping

* Split big functions.
* Add unit tests

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Extend QUICK_INPUT and QUICK_LABELED_INPUT macros for getting completion flags via parameters instead of using hardcoded value

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Concretize the usage of autocompliting in different input fields.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
lib/widget/input_complete.c: refactoring:

  * (filename_completion_function): use GString to ret rid of hand-made
  low-level memory allocation.
  * (variable_completion_function): likewise.
  * (hostname_completion_function): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Fix for input completions with spaces in names.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
lib/widget/input_complete.c: minor refactoring and optimization.

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

* 55_filename_complete:
  lib/widget/input_complete.c: minor refactoring and optimization.
  Fix for input completions with spaces in names.
  lib/widget/input_complete.c: refactoring:
  Concretize the usage of autocompliting in different input fields.
  Extend QUICK_INPUT and QUICK_LABELED_INPUT macros for getting completion flags via parameters instead of using hardcoded value
  Ticket #55: savannah: tab completion vs. spaces and escaping
Ticket #2956: Newer protocol for extended mouse clicks.

A followup extension, "SGR 1006" was invented by xterm, to overcome some
of the shortcomings of the previous one. It is becoming as widespread as
the previous one, and is likely to soon overtake it in popularity.

Note that most of the patch is just the removal of the huge complexity
introduced by the previous one. The previous extension didn't have a
unique prefix which made the whole parsing logic extremely complicated.
The new extension does have a unique prefix, so parsing becomes a piece
of cake. The code becomes much cleaner and much easier to maintain.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Code refactoring: removed unneeded 'go to' label.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Merge branch '2956_mouse_protocol_1006'

* 2956_mouse_protocol_1006:
  Code refactoring: removed unneeded 'go to' label.
  Ticket #2956: Newer protocol for extended mouse clicks.
Code indentation

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Ticket #2958: buttons in the 'Directory hotlist' window are placed incorrectly.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Fix buttons placement in file find result window.

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

* 2958_hotlist_buttons:
  Fix buttons placement in file find result window.
  Ticket #2958: buttons in the 'Directory hotlist' window are placed incorrectly.
Ticket #2964: mouse doesn't select text in subshell in native console.

Steps to Reproduce:

1. Run mc in native console (not in X terminal emulator).
2. Press Ctrl+O to switch to subshell.
3. Try select anything with mouse.
Result: mouse does't select anything.

This bug was introduced in 68468a25acea04c44320d0a75226a051d7c2b64a
commit.

Solution: make mouse initialization after initializaton of subshell.

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

* 2964_mouse_in_subshell:
  Ticket #2964: mouse doesn't select text in subshell in native console.
Ticket #2626: special chars are not escaped in autocompletion of filenames.

Test case:
1. Create a file with name that contains some special chars:
   touch attachment.cgi?id=564208
2. Press F6.
3. Press a. Now only the 'a' letter is in input line.
4. Press Esc Tab Enter.
5a. Input line is filled by 'attachment.cgi?id=564208'...
5b. but 'attachment.cgi\?id=564208' is expected.
6. Add 'patch_' before file name:
   'patch_attachment.cgi?id=564208'.
7. Press Enter.
8a. Result: 'patch_attachment.cgiattachment.cgi?id=564208id=564208'.
8b. Expected result: 'patch_attachment.cgi?id=564208'.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>