1
1

* view.c: When saving and loading the file position, use the

full pathname instead of the one passed as argument.
Этот коммит содержится в:
Roland Illig 2005-07-23 08:20:58 +00:00
родитель 2bf2f0c38d
Коммит be3ab1a3e0
2 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -2,6 +2,8 @@
* util.c (save_file_position): Only save the position if not
at the beginning of the file (1;0).
* view.c: When saving and loading the file position, use the
full pathname instead of the one passed as argument.
2005-07-22 Roland Illig <roland.illig@gmx.de>

Просмотреть файл

@ -1278,9 +1278,13 @@ static void
view_done (WView *view)
{
if (mcview_remember_file_position && view->filename != NULL) {
char *canon_fname;
offset_type line, col;
canon_fname = vfs_canon (view->filename);
view_offset_to_coord (view, &line, &col, view->dpy_topleft);
save_file_position (view->filename, line + 1, col);
save_file_position (canon_fname, line + 1, col);
g_free (canon_fname);
}
view_close_datasource (view);
if (view->coord_cache) {
@ -1414,9 +1418,12 @@ view_load (WView *view, const char *command, const char *file,
assert (view->bytes_per_line != 0);
if (mcview_remember_file_position && file != NULL && start_line == 0) {
long line, col;
char *canon_fname;
canon_fname = vfs_canon (file);
load_file_position (file, &line, &col);
g_free (canon_fname);
view_moveto (view, offset_doz(line, 1), col);
start_line = line;
} else if (start_line > 0) {
view_moveto (view, start_line - 1, 0);
}