0

As @drew asked me to do here I'm asking one question per problem

I'm trying to enable/disable visual-fill-column when there is one window/multiple windows.

(defun my-visual-fill-one-window ()
  (global-visual-fill-column-mode -1)
  (if (one-window-p)
    (global-visual-fill-column-mode 1)
    (global-visual-fill-column-mode -1)))
    
(add-hook 'window-state-change-hook 'my-visual-fill-one-window)

Could it be possible to adapt this function to work not when there's only one window but when they are just split vertically

Muihlinn
  • 2,576
  • 1
  • 14
  • 22
Lhooq
  • 230
  • 3
  • 10

1 Answers1

1

Try replacing one-window-p with window-full-width-p.

Function: window-full-width-p &optional window

This function returns non-nil if window has no other window to the left or right in its frame, i.e., its total width equals that of the root window on that frame. If window is omitted or nil, it defaults to the selected window.

https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Sizes.html.

Arch Stanton
  • 1,525
  • 9
  • 22