Saving file position in mcedit
Pavel Roskin
proski at gnu.org
Sat Nov 30 06:15:33 UTC 2002
Hello!
The patch for saving positions has been mostly applied. The only part
that has not been applied is the patch for editwidget.c. I'm attaching
the current patch. It doesn't work in its present form because the WEdit
structure doesn't keep the full path, and I would rather fix it than add
the current directory every time I need the full path.
I reduced the arguments to edit_load_position() and edit_save_position()
to just the edit widget, so that they do all the work querying and
positioning the editor. It's handy if we decide to load and save more
parameters.
I also changes the value of "line" that enables position loading. I think
that 1 was a bad choice because it's a legitimate value. I can look for a
string in "Find File", find it on line 1 and then go to the saved position
instead of line 1. Line 0 would be a much better choice. Of course, some
callers should be changed.
As you can see, I tried to keep the existing behavior if position saving
is disabled.
I still don't like how spaces are handled in edit_load_position(). This
should be fixed, or the position for "file with space" will be loaded
"file". Position of the last space on the line should be the end of the
filename.
--
Regards,
Pavel Roskin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: edit_pos2.diff.gz
Type: application/x-gzip
Size: 1321 bytes
Desc:
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20021130/42e32755/attachment.bin>
More information about the mc-devel
mailing list