How to reproduce:
1. Set num_history_items_recorded=0 in my $HOME/.config/mc/ini
2. Run mc.
3. Press F5 to copy and then enter.
Result: nothing happens.
Solution: refactoring of initial text usage in input line.
Use def_text to fill WInput:buffer when WInput is created.
Then overwrite WInput::buffer content from history if history usage
is enabled.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Now history is not saved if it was not modified and content of input
line is equal to history top entry. Thanks Francesco Cosoleto
<cosoleto at gmail dot com> for the original patch.
Also fixed a regression introduced in cff5925598:
after CK_HistoryNext and CK_HistoryPrev actions in input line,
the input line content is not put to the top of history.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Formerly, each widget loaded its history self in its constructor.
Thus, history file was read as many times as many widgets with history
are in dialog.
Now all widget histories are read from ${XDG_CACHE_HOME}/mc/history
file at one time after dialog initialization.
The ev_history_load_save_t event is apllied to load histories.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
All file panels related stuff was moved to midnight.[ch].
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>