Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal editor bookmarks should be persistent (saved in filepos) #2287

Closed
mc-butler opened this issue Jul 16, 2010 · 19 comments
Closed

internal editor bookmarks should be persistent (saved in filepos) #2287

mc-butler opened this issue Jul 16, 2010 · 19 comments
Labels
area: mcedit mcedit, the built-in text editor prio: low Minor problem or easily worked around ver: 4.7.3 Reproducible in version 4.7.3
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/2287
Reporter filipsef (fsefrna@….com)

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.

Note

Original attachments:

@mc-butler
Copy link
Author

Changed by filipsef (fsefrna@….com) on Jul 16, 2010 at 15:23 UTC (comment 1)

  • Keywords set to bookmarks, persistent

@mc-butler
Copy link
Author

Changed by filipsef (fsefrna@….com) on Jul 17, 2010 at 16:12 UTC

proposed patch

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Jul 17, 2010 at 20:11 UTC (comment 2)

branch: 2287_persistent_bookmarks
changeset: [8618e25465d189c473fb26da16b1ba973bb9cd9e]

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jul 18, 2010 at 5:52 UTC

Replying to filipsef (#2287):

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.

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Jul 18, 2010 at 7:55 UTC (comment 1.4)

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

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Jul 18, 2010 at 8:01 UTC (comment 5)

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

@mc-butler
Copy link
Author

Changed by filipsef (fsefrna@….com) on Jul 18, 2010 at 15:17 UTC (comment 4.6)

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 ?

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Jul 18, 2010 at 17:03 UTC (comment 7)

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'

@mc-butler
Copy link
Author

Changed by filipsef (fsefrna@….com) on Jul 20, 2010 at 21:03 UTC (comment 8)

Check my second patch that works with mcview_remember_file_position=1

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

@mc-butler
Copy link
Author

Changed by filipsef (fsefrna@….com) on Jul 20, 2010 at 21:08 UTC

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Aug 5, 2010 at 4:12 UTC (comment 9)

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

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 8, 2010 at 10:18 UTC (comment 10)

  • Milestone changed from 4.7 to 4.7.5

Rebased.
branch: 2287_persistent_bookmarks
initial [70d7c7076efbca255eb7be5541e09333cf8bd5f7]

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Sep 8, 2010 at 10:30 UTC (comment 11)

  • Severity changed from no branch to on review

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 8, 2010 at 10:47 UTC (comment 12)

  • Votes set to andrew_b

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Sep 8, 2010 at 12:11 UTC (comment 13)

initial [90623032186acc02edc320ae06fce102983965ef] (forced update)

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Sep 8, 2010 at 12:48 UTC (comment 14)

initial [70d7c7076efbca255eb7be5541e09333cf8bd5f7] (forced update)

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Sep 27, 2010 at 14:30 UTC (comment 1.15)

  • Votes changed from andrew_b to andrew_b slavazanko
  • Severity changed from on review to approved

Replying to filipsef:

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Sep 28, 2010 at 14:27 UTC (comment 16)

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

Merged: [3013a36]

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 28, 2010 at 16:52 UTC (comment 17)

  • Keywords bookmarks, persistent deleted
  • Status changed from testing to closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: mcedit mcedit, the built-in text editor prio: low Minor problem or easily worked around ver: 4.7.3 Reproducible in version 4.7.3
Development

No branches or pull requests

1 participant