Giter VIP home page Giter VIP logo

Comments (7)

bcc32 avatar bcc32 commented on May 24, 2024 2

I was able to get Emacs to display more spaces than necessary, even when using emacs -Q. It attempts to set the width based on the widest line number it might have to show in the window, and this involves some heuristics, which may occasionally have errors. If this behavior bothers you, I would advise customizing the variables in the "Display Line Numbers" group (SPC SPC customize-group RET display-line-numbers RET

For example, setting display-line-numbers-width-start to t ("Minimum width for buffer's line count: on") will cause it to be computed once, up front, for each buffer, and never resized.

from spacemacs.

bcc32 avatar bcc32 commented on May 24, 2024

Spacemacs is just enabling the built-in line numbering logic in Emacs, like so:

(prog1 (display-line-numbers-mode)
            (setq display-line-numbers 'relative))

I suspect this is a bug in Emacs itself. Are you able to reproduce this using emacs -q (and with the above Elisp snippet)?

from spacemacs.

winsphinx avatar winsphinx commented on May 24, 2024

On original emacs -q mode, there is NOT the bug: BOTH have the space ahead.

image

from spacemacs.

smile13241324 avatar smile13241324 commented on May 24, 2024

I am sorry but I am completely at a loss what you mean, can you provide some more detailed instructions on what is wrong and how to reproduce it? Also please post your system details which you can obtain via spacemacs/report-issue.

Given from what you have written I assume there is an issue with automatically added blanks, this could be caused by dotspacemacs-use-clean-aindent-mode being non-nil in your dotfile. The package this setting refers to is very old and can cause such issues in more modern modes, please disable it in your dotfile and post if the issue persist.

Thanks.

from spacemacs.

winsphinx avatar winsphinx commented on May 24, 2024

Thanks.

I tried to set dotspacemacs-use-clean-aindent-mode to nil (according to the .spacemacs.template, default is t) and reomve the package clean-aindent-mode, but it still shows the bug:

repoducing steps:

  1. set line number mode to visual-line-mode;
  2. move the cursor to the line < 30L, it seems correctly: no blank before the line number;
  3. move down the cursor to > line 30+, obviously a space appears. Move up and down, the blank goes away and comes back;

Then according to @bcc32's post, I tried his code in emacs -q, i saw a leading blank appears on every line.

no matter if there are blanks or not, I wish it remains consistent when moving up and down.

from spacemacs.

bcc32 avatar bcc32 commented on May 24, 2024

@smile13241324, the spaces appear visually (that is to say, not in the buffer itself) in the left margin, just left of the line numbers. Basically, the width of the numbers is inconsistent when scrolling through the buffer, which is pretty weird. I haven't figured out what causes this, yet.

from spacemacs.

smile13241324 avatar smile13241324 commented on May 24, 2024

Then this is an emacs issue. I am going to close this ticket.

from spacemacs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.