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

Lines shrink when both org-indent-mode and display-line-numbers-mode are on #17

Open
chuxubank opened this issue Dec 2, 2020 · 12 comments

Comments

@chuxubank
Copy link

chuxubank commented Dec 2, 2020

org-indent-mode: on
image

org-indent-mode: off
image

@chuxubank
Copy link
Author

If turn on org-indent-mode after valign-mode is on, this error shows up:

Debugger entered--Lisp error: (valign-parse-error "Missing the right bar (|)")
  signal(valign-parse-error ("Missing the right bar (|)"))
  valign-table-1()
  valign-table-maybe(nil t)
  valign-region(2427 2518)
  #f(compiled-function (fun) #<bytecode 0x1fe56aef6035>)(valign-region)
  run-hook-wrapped(#f(compiled-function (fun) #<bytecode 0x1fe56aef6035>) valign-region)
  jit-lock--run-functions(2427 2518)
  jit-lock-fontify-now(2018 2518)
  jit-lock-function(2018)
  window-text-pixel-size(#<window 3 on test.org> 2018 2019)
  valign--pixel-width-from-to(2018 2019)
  valign--table-2()
  valign-table-maybe(nil t)
  valign-region()
  valign--buffer-advice()
  run-hooks(org-indent-mode-hook org-indent-mode-on-hook)
  org-indent-mode(toggle)
  funcall-interactively(org-indent-mode toggle)
  call-interactively(org-indent-mode record nil)
  command-execute(org-indent-mode record)
  execute-extended-command(nil "org-indent-mode" #("org-indent-mod" 0 14 (ws-butler-chg chg)))
  funcall-interactively(execute-extended-command nil "org-indent-mode" #("org-indent-mod" 0 14 (ws-butler-chg chg)))
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

@casouri
Copy link
Owner

casouri commented Dec 2, 2020

That's probably because you turned on debug-on-error. Normally that signal is caught.

@casouri
Copy link
Owner

casouri commented Dec 2, 2020

The problem isn't in org indent mode but rather display-line-numbers-mode. I got it to work with org-indent-mode or display-line-numbers-mode alone, but when both are enabled there's some weird effect on how Emacs measures pixel width of a piece of text that I didn't figure out yet. So for now all you can do is to either disable line-numbers-mode or org-indent-mode.

@chuxubank
Copy link
Author

After turning off line numbers via doom/toggle-line-numbers, this error disappeared.
Everything looks nice, thanks!

@casouri
Copy link
Owner

casouri commented Dec 2, 2020

I'll try to get it to work when both modes are enabled, so let's keep this open.

@casouri casouri reopened this Dec 2, 2020
@chuxubank chuxubank changed the title Lines shrink in org-indent-mode Lines shrink when both org-indent-mode and display-line-numbers-mode is on Dec 2, 2020
@chuxubank chuxubank changed the title Lines shrink when both org-indent-mode and display-line-numbers-mode is on Lines shrink when both org-indent-mode and display-line-numbers-mode are on Dec 2, 2020
@Imymirror
Copy link

I use doom-emacs.
when I turn display-line-numbers-mode off and just turn org-indent-mode on, the issue still exist.

display-line-numbers-mode and org-indent-mode both on :
image

display-line-numbers-mode off and org-indent-mode on:
image

@casouri
Copy link
Owner

casouri commented Dec 2, 2020

Have you tried realigning by pressing tab?

@Imymirror
Copy link

Imymirror commented Dec 2, 2020

I didn't do anything, My feedback problem (text below the dividing line) has been solved!, it doesn't exist! now it works perfectly, i don't know what happen.


I use doom-emacs.
when I turn display-line-numbers-mode off and just turn org-indent-mode on, the issue still exist.

display-line-numbers-mode and org-indent-mode both on :
image

display-line-numbers-mode off and org-indent-mode on:
image

@casouri
Copy link
Owner

casouri commented Dec 2, 2020

Hmmm ok. Anyway, that's good news ;-)

@Stebalien
Copy link

I can reproduce:

* Foo
** Bar
*** Baz
| foo   | bar           | baz      |
| thing | (foo bar baz) | bla      |
| foo   | bar           | asdfasdf |
| <0>   |               |          |

Then run:

(org-indent-mode 1)
(org-table-shrink)
(valign-mode)

That yields:

2020-12-05-214419_508x313_scrot

@IceAsteroid
Copy link

It's been a while.

I'm using vanilla emacs, can confirm this still persists in version 29.4, when display-line-numbers-mode is turned on for an org-mode buffer.

It works fine until the org-table is modified and re-aligned with tab.

Is there still no solution for this?

@casouri
Copy link
Owner

casouri commented Feb 21, 2025

Unfortunately, yes. If SomeOne™ can look into this, that'll be great. Otherwise I don't thin this will be fixed anytime soon.

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

5 participants