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

fix copying setl options for buffer currently displayed in another window #7551

Merged
merged 1 commit into from Jun 22, 2018

Conversation

Projects
None yet
4 participants
@bfredl
Member

bfredl commented Nov 13, 2017

In this sequence of commands the buffer-local value of window option winhl is copied

e /tmp/xx
split
e /tmp/yy
setl winhl=Normal:ErrorMsg
b /tmp/xx
wincmd w
b /tmp/yy

but NOT in this sequence

e /tmp/xx
split
e /tmp/yy
setl winhl=Normal:ErrorMsg
wincmd w
b /tmp/yy

This seem counter to the intended behavior stated at

* If the buffer wasn't used in this window before, use the values from
. At least the discrepancy seems quite jarring.

As discussed with @leonerd on IRC/Gitter, this will make filetype autocmds that setl window options behave more reasonably.

@bfredl bfredl changed the title from [WIP] fix copying setl options for buffer currently displayed in another buffer to [WIP] fix copying setl options for buffer currently displayed in another window Nov 13, 2017

@bfredl

This comment has been minimized.

Member

bfredl commented Nov 13, 2017

I get same discrepancy with vim, tested with setl number instead of setl winhl.

@brammool is this a bug, or intentional behavior?

@brammool

This comment has been minimized.

brammool commented Nov 13, 2017

So, when wi_optset is false, you use the options from the window directly.
That makes sense, more like what a user would expect.
Can you please make a pull request for Vim (with a test would be nice)?

@marvim marvim added the WIP label Nov 13, 2017

@bfredl

This comment has been minimized.

Member

bfredl commented Nov 13, 2017

I will make a PR with tests, maybe tomorrow.

@justinmk

This comment has been minimized.

Member

justinmk commented Jun 21, 2018

Vim merged this in vim/vim@25782a7

@bfredl

This comment has been minimized.

Member

bfredl commented Jun 21, 2018

@justinmk Ok if I just take the new-style test? Or should I port it to lua?

@justinmk

This comment has been minimized.

Member

justinmk commented Jun 21, 2018

@bfredl don't need to port it.

@bfredl bfredl force-pushed the bfredl:setl_bufwin branch 2 times, most recently from e20e600 to 90147d2 Jun 21, 2018

buffer: fix copying setl options for buffer currently displayed in an…
…other window

vim-patch:8.0.1836: buffer-local window options may not be recent
Problem:    Buffer-local window options may not be recent if the buffer is
            still open in another window.
Solution:   Copy the options from the window instead of the outdated window
            options. (Bjorn Linse, closes vim/vim#2336)
vim/vim@25782a7

@bfredl bfredl force-pushed the bfredl:setl_bufwin branch from 90147d2 to 8917e0c Jun 21, 2018

@bfredl

This comment has been minimized.

Member

bfredl commented Jun 22, 2018

failures unrelated.

@bfredl bfredl merged commit bf2460e into neovim:master Jun 22, 2018

1 of 3 checks passed

QuickBuild Build pr-7551 finished with status FAILED
Details
continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@justinmk justinmk removed the WIP label Jun 22, 2018

@justinmk justinmk changed the title from [WIP] fix copying setl options for buffer currently displayed in another window to fix copying setl options for buffer currently displayed in another window Jun 22, 2018

@justinmk justinmk added the bug-vim label Jun 22, 2018

@janlazo janlazo referenced this pull request Jun 22, 2018

Closed

vim-patch:8.0.1836 #8624

justinmk added a commit that referenced this pull request Jul 18, 2018

NVIM v0.3.1
FEATURES:
07499a8 #8709 man.vim: C highlighting for EXAMPLES section
07f82ad #8699 TUI: urxvt: also send xterm focus-reporting seqs
40911e4 #8616 API: emit nvim_buf_lines_event from :terminal
c46997a #8546 fillchars: Add "eob" flag

FIXES:
74d19f6 #8576 startup: avoid blank stdin buffer if other files were opened
4874214 #8737 Only waitpid() for processes that we care about
cd6e7e8 #8743 Check all child processes for exit in SIGCHLD handler
c230ef2 #8746 channel.c: Prevent channel_destroy_early() from freeing uninitialized rpc stuff
0ed8b12 #8681 transstr_buf: fix length comparison
d241f27 #8708 TUI: Fix standout mode
9afed40 #8698 man.vim: fix for mandoc
e889640 #8682 provider/node: npm --loglevel silent
1cbc830 #8613 API: nvim_win_set_cursor: set curswant
bf6048e #8628 checkhealth: Python: fix VIRTUAL_ENV check
3cc3506 #8528 checkhealth: node.js: also search yarn

CHANGES:
b751449 #8619 defaults: shortmess+=F
1248178 #8578 highlight: high-priority CursorLine if fg is set.
01570f1 #8726 terminal: handle &confirm and :confirm on unloading
56065bb #8721 screen: truncate showmode messages
bf2460e #7551 buffer: fix copying :setlocal options
c1c14fa #8520 Ex mode: always "improved" (gQ)
050f397 #7992 options: remove 'maxcombine` option (always 6)

INTERNAL:
463da84 #7992 screen: use UTF-8 representation

UtkarshMe added a commit to UtkarshMe/neovim that referenced this pull request Jul 28, 2018

NVIM v0.3.1
FEATURES:
07499a8 neovim#8709 man.vim: C highlighting for EXAMPLES section
07f82ad neovim#8699 TUI: urxvt: also send xterm focus-reporting seqs
40911e4 neovim#8616 API: emit nvim_buf_lines_event from :terminal
c46997a neovim#8546 fillchars: Add "eob" flag

FIXES:
74d19f6 neovim#8576 startup: avoid blank stdin buffer if other files were opened
4874214 neovim#8737 Only waitpid() for processes that we care about
cd6e7e8 neovim#8743 Check all child processes for exit in SIGCHLD handler
c230ef2 neovim#8746 channel.c: Prevent channel_destroy_early() from freeing uninitialized rpc stuff
0ed8b12 neovim#8681 transstr_buf: fix length comparison
d241f27 neovim#8708 TUI: Fix standout mode
9afed40 neovim#8698 man.vim: fix for mandoc
e889640 neovim#8682 provider/node: npm --loglevel silent
1cbc830 neovim#8613 API: nvim_win_set_cursor: set curswant
bf6048e neovim#8628 checkhealth: Python: fix VIRTUAL_ENV check
3cc3506 neovim#8528 checkhealth: node.js: also search yarn

CHANGES:
b751449 neovim#8619 defaults: shortmess+=F
1248178 neovim#8578 highlight: high-priority CursorLine if fg is set.
01570f1 neovim#8726 terminal: handle &confirm and :confirm on unloading
56065bb neovim#8721 screen: truncate showmode messages
bf2460e neovim#7551 buffer: fix copying :setlocal options
c1c14fa neovim#8520 Ex mode: always "improved" (gQ)
050f397 neovim#7992 options: remove 'maxcombine` option (always 6)

INTERNAL:
463da84 neovim#7992 screen: use UTF-8 representation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment