RE: Saving file position in mcedit



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

Attachment: edit_pos2.diff.gz
Description: GNU Zip compressed data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]