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

End button in MC viewer jumps too far #2135

Closed
mc-butler opened this issue Apr 7, 2010 · 32 comments
Closed

End button in MC viewer jumps too far #2135

mc-butler opened this issue Apr 7, 2010 · 32 comments
Assignees
Labels
area: mcview mcview, the built-in text editor prio: medium Has the potential to affect progress ver: 4.7.1 Reproducible in version 4.7.1
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/2135
Reporter birdie (aros@….com)
Mentions egmont@….com (@egmontkob), gotar@….pl

I don't know if it's already been reported but since MC 4.7.1 it became terribly inconvenient to jump to the end of any file in mcviewer: end button jumps such a way the only and last line of a file is visible, so you have to scroll back a little to actually see a file tail.

If you try to tail view dozens of files, scrolling back each one of them becomes a very tedious task.

Note

Original attachments:

@mc-butler
Copy link
Author

Changed by marrtins (marrtins@….net) on Apr 14, 2010 at 5:05 UTC (comment 1)

  • Type changed from defect to enhancement

Yes, this is annoying, please fix! At least now viewer scrolls down fast with large files too.

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Apr 14, 2010 at 5:21 UTC (comment 2)

marrtins, birdie
please show version of mc

$ mc -V

birdie, set
mcview_eof=~ in your ini file to make easier to see the end of file

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Apr 14, 2010 at 8:55 UTC (comment 2.3)

mc-4.7.1-2.fc13.i686

Replying to angel_il:

marrtins, birdie
please show version of mc

$ mc -V

birdie, set
mcview_eof=~ in your ini file to make easier to see the end of file

That didn't help at all, mc still jumps beyond the end of file and shows a lot of ~, see the attached screenshot.

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Apr 14, 2010 at 8:57 UTC

With "mcview_eof=~" set.

@mc-butler
Copy link
Author

Changed by marrtins (marrtins@….net) on Apr 26, 2010 at 15:33 UTC (comment 4)

My version:

GNU Midnight Commander 4.7.1
Virtual File System: tarfs, extfs, cpiofs, ftpfs, fish
With builtin Editor
Using system-installed S-Lang library with terminfo database
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
With internationalization support
With multiple codepages support
Data types: char 8 int 32 long 32 void * 32 off_t 64 ecs_char 8

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on May 5, 2010 at 11:58 UTC (comment 5)

  • Cc set to egmont@….com

+1 for fixing it please! This is a very annoying regression in the just-to-be-released stable 4.7.2.

In order to see as much as fits on the screen from the end of the file, instead of pressing End now I have to press End, then Pageup, then Down. Or End and then longpress the Up key.

The behavior of the End key should be the same as in the panels: the last line of the file should appear on the bottom of the available area; just as the last file appears in the bottom row, with lots of other filenames also visible in the mean time.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on May 5, 2010 at 12:54 UTC (comment 6)

There are some non-trivial problems with this issue. We would not fix this problem very quickly and finally get a slow viewer in some cases.

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on May 5, 2010 at 14:10 UTC (comment 7)

  • Owner set to slavazanko
  • Status changed from new to accepted
  • Severity changed from no branch to on review

Well... created branch 2135_viewer_jump_to_eof

Changesets:

  • [7975b3ed1377d6fb0e906a2f39176d4d29a60f16]: fix of jump to end of file in viewer.
  • [6a37c6666e69d14bc5ebaef260b2ddcfa0931d63]: Fixed behavior after pressing PageDown at end of file

Review, please.

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on May 5, 2010 at 14:18 UTC (comment 8)

These patches work nice for me so far. Thanks very much guys!

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on May 5, 2010 at 17:41 UTC (comment 9)

  • Votes set to andrew_b
  • Milestone changed from 4.7 to 4.7.2

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on May 5, 2010 at 18:19 UTC (comment 10)

  • Votes changed from andrew_b to ossi andrew_b angel_il
  • Severity changed from on review to approved

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on May 5, 2010 at 18:30 UTC (comment 11)

  • Keywords set to stable-candidate
  • Resolution set to fixed
  • Severity changed from approved to merged
  • Status changed from accepted to testing
  • Votes changed from ossi andrew_b angel_il to committed-master

merge [cd6d024]

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on May 5, 2010 at 18:31 UTC (comment 12)

  • Status changed from testing to closed

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on May 7, 2010 at 8:55 UTC (comment 13)

Thanks very much guys, especially for making it into 4.7.2!

Quick question: are you maybe considering backporting the second part of the patch to the stable 4.7.0.x branch? PageDown was able to scroll up too much, ever since my earliest MC memories, and finally it no longer happens, hooray! Nice usability improvement!

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on May 7, 2010 at 9:20 UTC (comment 13.14)

Replying to egmont:

Thanks very much guys, especially for making it into 4.7.2!

Quick question: are you maybe considering backporting the second part of the patch to the stable 4.7.0.x branch? PageDown was able to scroll up too much, ever since my earliest MC memories, and finally it no longer happens, hooray! Nice usability improvement!

I do not know and am not sure whether you need to backport new viewer into 4.7.0.х

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on May 7, 2010 at 11:35 UTC (comment 15)

Oh, the whole viewer is new? I thought it would be just a trivial merge. Forget it then :)

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on May 7, 2010 at 11:47 UTC (comment 16)

Yes, for stable we have old slow viewer. For 'master' branch viewer was rewritten.

@mc-butler
Copy link
Author

Changed by gotar (gotar@….pl) on May 9, 2010 at 17:55 UTC (comment 17)

  • Type changed from enhancement to defect
  • Cc changed from egmont@….com to egmont@….com, gotar@….pl
  • Status changed from closed to reopened
  • Resolution fixed deleted

With this patch you've broken one of the old viewer features (for me, see #1778). So I've got hopefully compromise proposition for the first part, which also addresses two of three issues I've found:

  1. 175 view->dpy_end = last_byte;

it's not true: from line 159 condition - 'visible part' (view->dpy_end - view->dpy_start) larger than 'remaining part' (last_byte - view->dpy_end) doesn't mean we'll end up at the end, as it depends at least on forward newline count we don't know. Oh, and it is being set at 168.

  1. 180 for (i = 0; i < lines && view->dpy_end < last_byte && new_offset < last_byte; i++)

we don't track view->dpy_end so it's pointless to check this condition, the value will be updated later.

  1. once again - condition from 159th line won't handle the case, when lines below currently visible area contain more than is displayed (just imagine 100 empty lines followed by some long ones, especially with disabled wrap mode) - I left this untouched, as it's more rare case and resolving it requires tracking view->dpy_end everytime.

What I suggest is fixing PgDn in a way, that it switches to one-line mode after EOF and add a check to ensure, that at least one last line stays visible (4.7.1 behaviour of end/pgdn was irritating indeed).

@mc-butler
Copy link
Author

Changed by gotar (gotar@….pl) on May 9, 2010 at 17:56 UTC

mcview_move_down.patch

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on May 9, 2010 at 18:05 UTC (comment 18)

  • Milestone changed from 4.7.2 to 4.7.3

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Jul 5, 2010 at 20:31 UTC (comment 19)

  • Milestone changed from 4.7.3 to 4.7.4

@mc-butler
Copy link
Author

Changed by gotar (gotar@….pl) on Nov 4, 2010 at 12:46 UTC (comment 20)

  • Milestone changed from 4.7.4 to 4.7.5
  • Severity changed from merged to on rework

Two slight changes to my patch:

  1. leave 'off_t new_offset = 0;'
  2. 'if(view->dpy_end>=last_byte) break;' instead 'lines=0' (and move to the end of the loop).

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Nov 4, 2010 at 14:17 UTC

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Nov 4, 2010 at 14:22 UTC (comment 21)

  • Votes committed-master deleted

I've attached new patch.

With this pathch, PageDown at the last page scrolls file line by line instead of entire page.

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Nov 5, 2010 at 11:10 UTC (comment 22)

  • Severity changed from on rework to on review
  • Status changed from reopened to accepted
  • Keywords stable-candidate deleted

With this pathch, PageDown at the last page scrolls file line by line instead of entire page.

In my point of view, this should be feature... ;)

Created branch 2135_end_button_in_viewer
[5253200]

review, please.

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Nov 5, 2010 at 11:13 UTC (comment 21.23)

Replying to andrew_b:

I've attached new patch.

With this pathch, PageDown at the last page scrolls file line by line instead of entire page.

IMO when we've reached the end of file, MC just shouldn't do anything if I try to scroll down even more. Scrolling line by line will most likely confuse people ("WTF is my MC doing?")

@mc-butler
Copy link
Author

Changed by gotar (gotar@….pl) on Nov 5, 2010 at 11:26 UTC (comment 23.24)

Replying to birdie:

IMO when we've reached the end of file, MC just shouldn't do anything if I try to scroll down even more. Scrolling line by line will most likely confuse people ("WTF is my MC doing?")

And IMO it should be possible to scroll so high as it was possible to do earlier: #1778. Switching to 1-line mode prevents user from immediately scrolling off entire content, and notices him about file coming to the end (if he doesn't see percentage indicator).

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Nov 5, 2010 at 11:43 UTC

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Nov 5, 2010 at 11:51 UTC (comment 26)

  • Votes set to andrew_b

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Nov 5, 2010 at 11:52 UTC (comment 27)

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

patch made by gotar, therefore my vote here.

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Nov 5, 2010 at 11:58 UTC (comment 28)

  • Blocking #2411 deleted
  • Status changed from accepted to testing
  • Severity changed from approved to merged
  • Votes changed from andrew_b slavazanko to commited-master
  • Resolution set to fixed

Merged in master: [ce3f0fe]

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Nov 5, 2010 at 11:58 UTC (comment 29)

  • 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: mcview mcview, the built-in text editor prio: medium Has the potential to affect progress ver: 4.7.1 Reproducible in version 4.7.1
Development

No branches or pull requests

2 participants