Skip to content

Size of Table of Contents (ToC) is not fixed #2060

@cdelledonne

Description

@cdelledonne

Issue

Hi, I've been experiencing the following problem: with a Table of Content (Toc) open, which in my configuration is a 30-column vertical window, changing the layout of the current tab, the size of the ToC changes too. See below for how to reproduce this.

minimal.vim

VimTeX's configuration

let g:vimtex_fold_enabled = 1
let g:vimtex_toc_config = {
        \ 'name': 'ToC',
        \ 'split_pos': 'vert topleft',
        \ 'split_width': 30,
        \ }
let g:vimtex_compiler_progname = 'nvr'

Commands/Input

  1. In a TeX project, open just one window with a .tex buffer, which should take the entire width of Vim.
  2. Then, run :VimtexTocOpen. This should open a 30-column vertical window, to the very left of the screen.
  3. Then, move the cursor to the window containing the .tex buffer, and run :vs. This should split the window vertically.
  4. Then, close one of the two windows containing the .tex buffer with :q. At this point, the ToC will have resized to take half the screen's size.

Observed Behaviour

The one described at point 4. above.

Expected Behaviour

I would expect (or, I should say, I would prefer) the ToC window to maintain its size when the rest of the layout changes, unless of course the ToC window is the last window. Running the following two commands inside the ToC window yields this desired behaviour:

:setlocal winfixwidth
:setlocal winfixheight

I was wondering whether this could be made the default behaviour.

Output from VimtexInfo

System info
  OS: Linux 5.12.6-300.fc34.x86_64
  Vim version: NVIM v0.4.4
  Has clientserver: true
  Servername: /tmp/nvimqR8U0q/0

VimTeX project: main
  base: main.tex
  root: /path/to/project/
  tex: /path/to/project/main.tex
  out: 
  log: 
  aux: 
  fls: 
  main parser: fallback
  source files:
    ...
  compiler: latexmk
    configuration: 
      continuous: 1
      callback: 1
      build_dir: build
      latexmk options:
        -verbose
        -file-line-error
        -synctex=1
        -interaction=nonstopmode
      latexmk engine: -pdf
  viewer: General
  qf: LaTeX logfile
    addqflist: 544
    fix_paths: 545
    set_errorformat: 543
  document class: article
  packages:
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions