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

Dynamic paragraphing no longer usable #3996

Closed
mc-butler opened this issue Jun 23, 2019 · 14 comments
Closed

Dynamic paragraphing no longer usable #3996

mc-butler opened this issue Jun 23, 2019 · 14 comments
Assignees
Labels
area: mcedit mcedit, the built-in text editor prio: low Minor problem or easily worked around ver: 4.8.22 Reproducible in version 4.8.22
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/3996
Reporter JRottm (JRottm@….de)
Mentions egmont (@egmontkob)
Keywords dynamic, paragraphing

To reproduce:
1) open a new, empty file in mcedit
2) Options->General: enable Dynamic paragraphing. Hint: also set line length e.g. to 20, makes the next step faster, because you don't have to type so much.
3) Type rubbish words and occasional spaces e.g. "lorem ipsum dolor sit amet..." or whatever until you have filled 2-4 lines.
4) Start a new paragraph by pressing enter twice.
5) Repeat until you have 2-3 paragraphs.
6) Move cursor back to 1st paragraph.
7) Try to edit something in the 1st paragraph.

Expected behavior:
You can edit 1st paragraph. Lines should wrap dynamically if you add or delete words.

Observed behaviour:
After just 1 keypress (added or deleted letter) cursor immediately jumps to start of next paragraph. If you had intended to add a whole word in 1st paragraph you have to move cursor back, add another letter, move cursor back, add another letter, etc. This makes "dynamic paragraphing" utterly unusable.

Affected versions:

  • Debian 10 = mc 4.8.22 is broken
  • Debian 9 = mc 4.8.18 was broken
  • Debian 8 = mc 4.8.13 worked fine, if I remember correctly

My current system:
Debian 10, x86, 64 bit.
GNU Midnight Commander 4.8.22
Built with GLib 2.58.2
Using the S-Lang library with terminfo database
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
With support for X11 events
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ext2undelfs, ftpfs, sftpfs, fish
Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;
mc --configure-options: '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--libdir=${prefix}/lib/x86_64-linux-gnu' '--libexecdir=${prefix}/lib/x86_64-linux-gnu' '--runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' 'AWK=awk' 'X11_WWW=x-www-browser' '--libexecdir=/usr/lib' '--with-x' '--with-screen=slang' '--disable-rpath' '--disable-static' '--disable-silent-rules' '--enable-aspell' '--enable-vfs-sftp' '--enable-vfs-undelfs' '--enable-tests' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/mc-4.8.22=. -fstack-protector-strong -Wformat -Werror=format-security' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now -Wl,--as-needed' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'

Thanks, and best regards

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Jun 23, 2019 at 8:17 UTC (comment 1)

  • Cc set to egmont

Would be really awesome if you could bisect this... /cc egmont just because it faintly remember you did a lot of work on the editor / viewer back in the time.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jun 23, 2019 at 8:19 UTC (comment 2)

This is a result of #1666.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jun 23, 2019 at 8:28 UTC (comment 3)

Do we want move to the next paragraph after format of current one?

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on Jun 23, 2019 at 8:45 UTC (comment 4)

I worked on the viewer only, so that's not relevant here.

@mc-butler
Copy link
Author

Changed by JRottm (JRottm@….de) on Jun 23, 2019 at 10:05 UTC (comment 5)

Hi again, turns out memory decieved me. Debian 8 wasn't fine, but Debian 7 (4.8.3) was. Always bugged me, should've reported it earlier...

Downloaded bin packages from Ubuntu and Slackware to narrow it down:

  • 4.8.5 (Ubuntu, May 2013): works fine
  • 4.8.10 (Slackware, Oct 2013): Dyn. Para. has zero effect at all, completely nonfunctional
  • 4.8.12 (Ubuntu, Apr 2014): Dyn. Para. is back, but with bug as described above

I really can't see how this could be intentional, you can't edit a text if your cursor keeps jumping away. Even when you're already in the last paragraph the cursor jumps to the end of that after each letter. In its current form Dyn. Para. is useless except when adding to or deleting from the very end of the last paragraph.

I guess I could attempt to bisect, however it's obvious that this is not just 1 unlucky commit, some kind of rework took place 4.8.5→10, which then someone tried to fix 4.8.10→12, and only got it almost right. And even if I find the (at least) 2 commits in question, I doubt you'll be able to revert them, the code surely has changed too much. So if you ask me to bisect, I will, but only if you think it will actually help you.

Thanks & regards

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jun 23, 2019 at 14:04 UTC (comment 5.6)

Replying to JRottm:

So if you ask me to bisect, I will, but only if you think it will actually help you.

I've already found the bad commit (see comment:2).

I would like to get a reply to my question in comment:3:

Do we want move to the next paragraph after format of current one?

@mc-butler
Copy link
Author

Changed by JRottm (JRottm@….de) on Jun 23, 2019 at 16:30 UTC (comment 7)

IMHO current behavior makes no sense. If one's intention was to only format all paragraphs, one after the other, why would you have to add/delete a letter in each to trigger the formatting. If someone wants batch-formatting they'd just filter it through fold(1). Rather, it's supposed to wrap dynamically while you're editing your text, but you can't edit when the cursor keeps jumping away.

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on Jun 23, 2019 at 17:35 UTC (comment 7.8)

If someone wants batch-formatting they'd just filter it through fold(1).

Nitpicking: There's a function for this in mcedit: F9 -> Format -> Format paragraph (M-p). This action should (and does) jump to the beginning of the next paragraph, so that you can simply repeat it multiple times (or hold M-p) to get it repeated for multiple paragraphs.

Rather, it's supposed to wrap dynamically while you're editing your text, but you can't edit when the cursor keeps jumping away.

I fully agree. While typing (or erasing) text, the cursor needs to stay at the same logical position within the text during automatic formatting, so that (apart from space <-> newline conversions) the text ends up being whatever you type. Otherwise this functionality is useless.

Two side notes:

As I'm testing this feature now, I face other buggy behavior as well. There's nothing concrete I could reproduce and report at this moment, but I've faced a line getting wrapped much sooner than desired; also a complete line getting erased from the display, as part of a bigger display corruption where each line got fixed as soon as the cursor entered it.

If this feature has been broken for 5-6 years without anyone reporting it, it's pretty much a sign that hardly anyone wishes to have this mode. Instead of fixing it, removing it for good is another possibility to consider. I mean, OP would sure be disappointed by this resolution, but from the project's maintenance point of view it might make sense. Note: I'm not saying this is what the project should do, I'm just saying it might be a reasonable step to consider. (Do popular text editors, e.g. vim and emacs have such a mode?)

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jun 23, 2019 at 17:46 UTC (comment 9)

The simple fix is revert of [ccb7ab3] and reopen of #1666.

If we do that, dynamic formatting gets working again. But if paragraph is formatted, dynamic formatting is not working.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jul 6, 2019 at 9:10 UTC (comment 10)

  • Owner set to andrew_b
  • Branch state changed from no branch to on review
  • Status changed from new to accepted
  • Milestone changed from Future Releases to 4.8.24

Branch: 3996_dynamic_format_fix
[6b21b8f4e67635f993b7ec0895398a3a1e9bef59]

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jul 20, 2019 at 15:58 UTC (comment 11)

  • Votes set to andrew_b
  • Branch state changed from on review to approved

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jul 20, 2019 at 16:00 UTC (comment 12)

  • Status changed from accepted to testing
  • Resolution set to fixed
  • Votes changed from andrew_b to committed-master

Merged to master: [3a1f3d7].

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jul 20, 2019 at 16:02 UTC (comment 13)

  • Status changed from testing to closed

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jul 20, 2019 at 16:03 UTC (comment 14)

#1666 reopened.

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.8.22 Reproducible in version 4.8.22
Development

No branches or pull requests

2 participants