2

I'm trying to write something that will disable a certain mode (fci-mode) if a buffer's visible width is under a certain amount. I know about the (window-width) function, however, that doesn't change if the window is vertically split (so the buffer is only half as wide).

Is there a method I can call that gives the visible width of a buffer in characters?

[EDIT] Stefan pointed out that (window-width) does change when a window is split. I was testing this incorrectly.

Lee H
  • 2,727
  • 1
  • 17
  • 31

1 Answers1

3

Have you tried this?

(window-total-width)

Also just be aware that a buffer's width in characters can vary wildly and gets affected by font width, window margins, frame margins, scroll bars, border thickness, text that have the box property enabled etc.... there's many many more but you get the idea.

Zypps987
  • 141
  • 2