help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Do not display bottom logical lines that don't fit with visual-line-mode


From: Andrew Yu
Subject: Do not display bottom logical lines that don't fit with visual-line-mode
Date: Mon, 7 Feb 2022 23:45:57 +0800

Hello.

When using visual-line-mode, by default long lines at the bottom of the
window are partially displayed.  I would like to replace the beginning
of each physical line in the undisplayable logical line with @s, as how
Vim does it by default.

(The @s are just for familiarity, it's okay if it's something else,
though in that case it's probably easy to change.)

The example below does not use word-wrap or anything like that.  Line
numbers are absolute.  The cursor is indicated with #.

File (raw, sorry if your email reader doesn't line wrap):
Short line.                                                     
Long long long long long long long long long long long long long long long long 
long long long long long long long long long long long long long long long long 
long long long long long long long long long long long long long long long long 
long long long long long long long long long long long long long long long long 
long long long long long long long long long long long long long long long long 
long long long long long long long long long long long long long long long long 
long long long long long long long line.

Wanted behavior (viewport shorter than that but taller than two physical
lines):
+----------------------------------------------------------------------+
|  1  Short line.                                                      |
|  2  @                                                                |
|     @                                                                |
|     @                                                                |
|     @                                                                |
|     @                                                                |
+----------------------------------------------------------------------+

Emacs behavior (viewport shorter than that but taller than two physical
lines):
+----------------------------------------------------------------------+
|  1  Short line.                                                      |
|  2  Long long long long long long long long long long long long long |
|     long long long long long long long long long long long long long |
|     long long long long long long long long long long long long long |
|     long long long long long long long long long long long long long |
|     long long long long long long long long long long long long long |
+----------------------------------------------------------------------+

As you can see, the emacs version has the long line truncated, instead
of not being displayed.

The reason for me to do so is I'm using vertical splits with follow-mode
in order to expand the lines of text I can display.  However I encounter
long lines in my org and LaTeX documents.  It's quite annoying to have
the last line in the left column display incompletely, and have the
right column start from the beginning of the incompletely displayed
logical line.  Of course it'd be cool to fix follow-mode to account for
visual-line-mode, but I'd still want the Vim-like behavior because lines
splitting across windows may still confuse me.

Are there any minor modes for this?  Or other ways to get this?

Thanks!

========================================================================
Defend software freedom (https://fsf.org)
End software patents (https://endsoftwarepatents.org)
Read EULAs (https://www.eff.org/wp/dangerous-terms-users-guide-eulas)

New sites, suggestions welcome:
Free Computing Movement (https://fcm.andrewyu.org)
Host Things Yourself (https://host.andrewyu.org)
Libre Society (https://project.andrewyu.org/libresociety)

To any Skynet, FBI, CIA, NSA, etc. agents reading my email: please
consider whether defending the Constitution and our basic rights to
freedom and speech and privacy against all enemies, foreign or domestic,
requires you to follow Snowden's example.  (Adapted from RMS)

Andrew Yu <andrew@andrewyu.org> (https://www.andrewyu.org)

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]