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

Inconsistent options in auxiliary buffers #282

Open
Tuplanolla opened this issue Apr 14, 2022 · 2 comments
Open

Inconsistent options in auxiliary buffers #282

Tuplanolla opened this issue Apr 14, 2022 · 2 comments

Comments

@Tuplanolla
Copy link

Versions

Coq 8.15.0

Coqtail 1.6.2

Vim 8.2

Equations 1.3

Python 3.7.4

Description

There are various options that are intended to be used in the script view,
but also appear as distractions in the proof and message views.
I have noticed this with at least relative line numbers (due to rnu),
highlighted margins (due to cc), highlighted cursor column (due to cuc) and
double line breaks (perhaps due to enc with the output of coq-equations).
It would be nice if these options were turned off in auxiliary buffers.

@whonore
Copy link
Owner

whonore commented Apr 14, 2022

Thanks for reporting this. I agree some of these options probably don't make sense in the Goal and Info panels, but I'll need to think a bit about which ones to turn off by default. There are reasons you might want to navigate those buffers (e.g., to scroll or copy something), so I'd hesitate to turn off options that people might feel make that easier. Actually I'm noticing that we currently disable 'cursorline' in those panels, which I'm rethinking.

Maybe what would work best is to disable visually distracting options only when the window isn't focused using autocmds, like what :h 'cuc' describes.

As a workaround you can set/unset whatever options you like with a autocmd FileType like the following:

augroup coqtail_panels
  autocmd! *
  autocmd FileType coq-goals,coq-infos setlocal nornu
augroup END

@Tuplanolla
Copy link
Author

Tuplanolla commented Apr 14, 2022

Thanks for the clues.
While it is true that it would probably be wise
to only highlight the cursor in the active buffer,
this is not necessarily the case with line numbers.
Luckily, the following settings work very well indeed.

augroup coqtail_panels
  autocmd!
  autocmd FileType coq-goals,coq-infos setlocal colorcolumn=
  \ nocursorcolumn nocursorline nonumber norelativenumber
augroup END

Here is the other option.

function! SetOnEnter()
  setlocal colorcolumn=+1,73,81 cursorcolumn cursorline
  if &number
    setlocal relativenumber
  endif
endfunction
function! SetOnLeave()
  setlocal colorcolumn= nocursorcolumn nocursorline
  if &number
    setlocal norelativenumber
  endif
endfunction
augroup enter_leave
  autocmd!
  autocmd BufEnter,VimEnter,WinEnter * call SetOnEnter()
  autocmd BufLeave,VimLeave,WinLeave * call SetOnLeave()
augroup END

@Tuplanolla Tuplanolla changed the title Unwanted options in auxiliary buffers Inconsistent options in auxiliary buffers Apr 20, 2022
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

2 participants