Ticket #3117: Launching editor with CK_Edit shouldn't pass line number.
commit9d83d55d847877a2a7c463aff19a0fb4d4c1e68c
authorAndrew Borodin <aborodin@vmail.ru>
Wed, 4 Dec 2013 09:32:55 +0000 (4 13:32 +0400)
committerAndrew Borodin <aborodin@vmail.ru>
Tue, 14 Jan 2014 10:23:02 +0000 (14 14:23 +0400)
tree5ba7762e445237a61bafddcc581e84c297bd5b1d
parentf949a29422e9961cb429553a643bf298a8e4ead9
Ticket #3117: Launching editor with CK_Edit shouldn't pass line number.

When pressing F4 to start the editor, a "+1" argument is passed to open
the file at the first line.

For some editor this is absolutely unnecessary since they open the file
there anyways. For some others (at least "joe", but probably others too)
this is harmful: joe has a convenience feature that by default it opens
the file where it was last open, unless of course overridden from
command line. Currently mc forces joe to open the file at the first
line, although opening it where it was last open would be much more
desired.

The right solution would be to consult mc.lib only when opening the
viewer/editor through the "word search in files (M-?)" feature, and
not when F3/F4 is pressed on a file, in the latter case $VIEWER or
$EDITOR should simply be launched with the filename but no additional
parameters.

Initial step: minor refactoring:
(do_edit_at_line): rename to edit_file_at_line.
(edit_file_at_line): changed type of arguments from int to gboolean.
(view_file_at_line): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
src/diffviewer/ydiff.c
src/filemanager/cmd.c
src/filemanager/cmd.h
src/filemanager/find.c
src/filemanager/midnight.c