Ticket #2543 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years ago

Hex viewer mode does not restore cursor position

Reported by: vitalif Owned by: andrew_b
Priority: minor Milestone: 4.8.0
Component: mcview Version: master
Keywords: Cc: gotar@…
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master committed-stable

Description

If you are in hex viewer mode and mcview_remember_file_position=1, the viewer restores view->dpy_start, but does not restore view->hex_cursor. So the restored position is basically useless in hex mode, because when you move cursor, you go back to the beginning of file.

Attaching a patch fixing this issue.

Attachments

viewer-remember-hex-position.diff (1.5 KB) - added by vitalif 8 years ago.
Restore position in hex viewer mode, save hex_cursor, not dpy_start in hex mode

Change History

Changed 8 years ago by vitalif

Restore position in hex viewer mode, save hex_cursor, not dpy_start in hex mode

comment:1 Changed 8 years ago by gotar

  • Cc gotar@… added
  • Branch state set to no branch

comment:2 Changed 8 years ago by andrew_b

  • Status changed from new to accepted
  • Votes for changeset set to andrew_b
  • Owner set to andrew_b
  • Branch state changed from no branch to on review
  • Milestone changed from 4.8 to 4.8.0
  • Keywords stable-candidate added

Thanks!
Patch was applied with minor modifications.

Branch: 2543_hexview_cursor_position (parent: master)
changeset:6253decba56beeaa08b19e15223b934ae5ab4afd

comment:3 follow-up: ↓ 4 Changed 8 years ago by slavazanko

  • Open in mcview any big text file.
  • Go to some position in a middle of text file.
  • Toggle HEX view mode (F4).
  • Place cursor at middle of any line (before \n symbol)
  • Toggle normal view mode (F4)
  • press UP key

Expected action: viewer will scroll up by one line.
Actual action: viewer scrolled up by few lines.

Last edited 8 years ago by slavazanko (previous) (diff)

comment:4 in reply to: ↑ 3 ; follow-up: ↓ 5 Changed 8 years ago by andrew_b

Replying to slavazanko:

Expected action: viewer will scroll up by one line.
Actual action: viewer scrolled up by few lines.

Yes. But this is not a result of the patch. The switch between view modes is buggy in current master. The new ticket is required for that.

comment:5 in reply to: ↑ 4 Changed 8 years ago by andrew_b

  • Votes for changeset andrew_b deleted

Fixed: b471db490548dc71d0333f3d4bf61c1f0767d460

Review and vote please.

Last edited 8 years ago by andrew_b (previous) (diff)

comment:6 Changed 8 years ago by slavazanko

  • Votes for changeset set to slavazanko

comment:7 Changed 8 years ago by angel_il

  • Votes for changeset changed from slavazanko to slavazanko angel_il
  • Branch state changed from on review to approved

comment:8 Changed 8 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from slavazanko angel_il to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

Merged to master.
changeset:bcd5db8a6af6762182ef99f8d4070809ea49e3ba

git log --pretty=oneline 07c14a4..bcd5db8

comment:9 Changed 8 years ago by andrew_b

Cherry-picked to 4.7.5-stable.
Initial changeset:fe240f11029ef36b2731a13bce4f331bb95a4c42

git log --pretty=oneline c21f9d0..8272760

comment:10 Changed 8 years ago by andrew_b

  • Status changed from testing to closed
  • Keywords stable-candidate removed
  • Votes for changeset changed from committed-master to committed-master committed-stable
Note: See TracTickets for help on using tickets.