Ticket #2287 (closed enhancement: fixed)

Opened 14 years ago

Last modified 14 years ago

internal editor bookmarks should be persistent (saved in filepos)

Reported by: filipsef Owned by: angel_il
Priority: minor Milestone: 4.7.5
Component: mcedit Version: 4.7.3
Keywords: Cc:
Blocked By: Blocking:
Branch state: Votes for changeset: committed-master

Description

I suggest making the internal editor bookmarks persistent by saving them in filepos.
Currently the bookmarks get lost after leaving the editor which makes them less usable.

Attachments

0001-Save-bookmarks-of-internal-edit-in-filepos.patch (9.0 KB) - added by filipsef 14 years ago.
proposed patch
0002-Save-bookmarks-of-internal-edit-in-filepos-2.patch (11.3 KB) - added by filipsef 14 years ago.

Change History

comment:1 follow-ups: ↓ 4 ↓ 15 Changed 14 years ago by filipsef

  • Keywords bookmarks persistent added

Changed 14 years ago by filipsef

proposed patch

comment:2 Changed 14 years ago by angel_il

branch: 2287_persistent_bookmarks
changeset: 8618e25465d189c473fb26da16b1ba973bb9cd9e

comment:3 in reply to: ↑ description Changed 14 years ago by andrew_b

Replying to filipsef:

I suggest making the internal editor bookmarks persistent by saving them in filepos.

You know that ~/.mc/filepos file is shared for editor and viewer. If you will open file with saved bookmarks in viewer then saved bookmarks will be lost.

comment:4 in reply to: ↑ 1 ; follow-up: ↓ 6 Changed 14 years ago by angel_il

Replying to filipsef:
try turn on mcview_remember_file_position in 'ini'

mcview_remember_file_position=1

1) open any_file.ext in mcedit
2) add bookmarks
3) close mcedit
4) open any_file.ext in mcview
5) close mcview
6) open any_file.ext in mcedit - bookmarks lost

comment:5 Changed 14 years ago by angel_il

maybe need to convert the number of rows into offsets of BOL for viewer. look at view->marks (it's bookmarks of the viewer)

comment:6 in reply to: ↑ 4 Changed 14 years ago by filipsef

Replying to angel_il:

You're right. I see two options how to deal with this:

1) Ignore the possible problem and accept the patch as is
(mcview_remember_file_position cannot be changed in GUI so IMO it could be considered as rather an uncommon option. And even for those who use it, this feature will work in most cases)

2) I can rewrite the patch to make your case work as expected :)
(viewer would save the bookmarks without using them; the allocation would take place at load_file_position(); the max_saved_bookmarks constant would be made global in order to be accessible from both edit.c & utils.c (making the change more intrusive ...))

What do you think ?

comment:7 Changed 14 years ago by angel_il

maybe
add
char *bookmarks into mcview_t

after open file in mcview save editor bookmarks into 'bookmarks'
аfter saving the cursor position add content 'bookmarks'

comment:8 Changed 14 years ago by filipsef

Check my second patch that works with mcview_remember_file_position=1

Note that it must be applied on top of the first one.

Changed 14 years ago by filipsef

comment:9 Changed 14 years ago by andrew_b

  • Owner set to angel_il
  • Status changed from new to assigned

comment:10 Changed 14 years ago by andrew_b

  • Milestone changed from 4.7 to 4.7.5

Rebased.
branch: 2287_persistent_bookmarks
initial changeset:70d7c7076efbca255eb7be5541e09333cf8bd5f7

comment:11 Changed 14 years ago by angel_il

  • severity changed from no branch to on review

comment:12 Changed 14 years ago by andrew_b

  • Votes for changeset set to andrew_b

comment:13 Changed 14 years ago by angel_il

comment:14 Changed 14 years ago by angel_il

comment:15 in reply to: ↑ 1 Changed 14 years ago by slavazanko

  • Votes for changeset changed from andrew_b to andrew_b slavazanko
  • severity changed from on review to approved

Replying to filipsef:

comment:16 Changed 14 years ago by angel_il

  • Status changed from assigned to testing
  • Votes for changeset changed from andrew_b slavazanko to committed-master
  • Resolution set to fixed
  • severity changed from approved to merged

comment:17 Changed 14 years ago by andrew_b

  • Keywords bookmarks persistent removed
  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.