* view.c: When saving and loading the file position, use the
full pathname instead of the one passed as argument.
Этот коммит содержится в:
родитель
2bf2f0c38d
Коммит
be3ab1a3e0
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
* util.c (save_file_position): Only save the position if not
|
* util.c (save_file_position): Only save the position if not
|
||||||
at the beginning of the file (1;0).
|
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>
|
2005-07-22 Roland Illig <roland.illig@gmx.de>
|
||||||
|
|
||||||
|
11
src/view.c
11
src/view.c
@ -1278,9 +1278,13 @@ static void
|
|||||||
view_done (WView *view)
|
view_done (WView *view)
|
||||||
{
|
{
|
||||||
if (mcview_remember_file_position && view->filename != NULL) {
|
if (mcview_remember_file_position && view->filename != NULL) {
|
||||||
|
char *canon_fname;
|
||||||
offset_type line, col;
|
offset_type line, col;
|
||||||
|
|
||||||
|
canon_fname = vfs_canon (view->filename);
|
||||||
view_offset_to_coord (view, &line, &col, view->dpy_topleft);
|
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);
|
view_close_datasource (view);
|
||||||
if (view->coord_cache) {
|
if (view->coord_cache) {
|
||||||
@ -1414,9 +1418,12 @@ view_load (WView *view, const char *command, const char *file,
|
|||||||
assert (view->bytes_per_line != 0);
|
assert (view->bytes_per_line != 0);
|
||||||
if (mcview_remember_file_position && file != NULL && start_line == 0) {
|
if (mcview_remember_file_position && file != NULL && start_line == 0) {
|
||||||
long line, col;
|
long line, col;
|
||||||
|
char *canon_fname;
|
||||||
|
|
||||||
|
canon_fname = vfs_canon (file);
|
||||||
load_file_position (file, &line, &col);
|
load_file_position (file, &line, &col);
|
||||||
|
g_free (canon_fname);
|
||||||
view_moveto (view, offset_doz(line, 1), col);
|
view_moveto (view, offset_doz(line, 1), col);
|
||||||
start_line = line;
|
|
||||||
} else if (start_line > 0) {
|
} else if (start_line > 0) {
|
||||||
view_moveto (view, start_line - 1, 0);
|
view_moveto (view, start_line - 1, 0);
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user