Skip to content

Visual selection clipped to 250000 characters in file with long lines #1962

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

Open
bcc32 opened this issue Feb 25, 2025 · 0 comments
Open

Visual selection clipped to 250000 characters in file with long lines #1962

bcc32 opened this issue Feb 25, 2025 · 0 comments

Comments

@bcc32
Copy link
Contributor

bcc32 commented Feb 25, 2025

Issue type

  • Bug report

Environment

Emacs version: GNU Emacs 30.1.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.12, Xaw scroll bars) of 2025-02-24
Operating System: Rocky Linux 8.10 (Green Obsidian)
Evil version: Evil version 1.15.0
Evil installation type: NonGNU ELPA
Graphical/Terminal: Graphical
Tested in a make emacs session (see CONTRIBUTING.md): Yes

Reproduction steps

  • Start Emacs (make emacs)

  • Open a file with very long lines. I started with a 15MB or so text
    file with large tables. Maybe some large CSV would work here.

    I believe it is sufficient to use a file where
    (long-line-optimizations-p) would return non-nil and whose size is
    greater than 500000 characters.

  • C-x h y

  • In a new empty buffer, press p

Expected behavior

The whole first file's contents should be pasted into the new buffer.

After C-x h is pressed in the first buffer, (region-end) returns 250,001.

Actual behavior

Only the first 250,000 characters are copied.

After C-x h is pressed in the first buffer, (region-end) should
return the number of characters in the file, plus one.

Further notes

Moving the selection around and trying to expand it by hand does not
help; the size of the selection stays consistently around 250,000
characters even as the bounds move forward and back through the
buffer.

long-line-optimizations-region-size defaults to 500,000. According
to its docstring, for buffers where (long-line-optimizations-p) is
non-nil, pre-command-hook and post-command-hook are executed on a
narrowed buffer, whose narrowed region size is specified by this
variable.

However, just setting this variable to avoid the restriction seems to
be not recommended, according to its docstring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant