From c3e2926f17e38e89eef570666b59aa9ffdeaf0f0 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 27 Jun 2025 21:55:33 +0200 Subject: [PATCH] docs: deprecate :ownsyntax --- runtime/doc/cmdline.txt | 1 - runtime/doc/deprecated.txt | 2 +- runtime/doc/index.txt | 1 - runtime/doc/syntax.txt | 35 ++--------------------------------- src/nvim/syntax.c | 1 + 5 files changed, 4 insertions(+), 36 deletions(-) diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index d0c7aa475f..e2cc1eef59 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -568,7 +568,6 @@ that see the '"' as part of their argument: :menu (and the like) :mkspell :normal - :ownsyntax :popup :registers :return diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt index a2676171c1..99300750c3 100644 --- a/runtime/doc/deprecated.txt +++ b/runtime/doc/deprecated.txt @@ -26,7 +26,7 @@ DIAGNOSTICS HIGHLIGHTS -• todo +• *:ownsyntax* *w:current_syntax* Use 'winhighlight' instead. LSP diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index dc847c0b5b..b74479fe5c 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1473,7 +1473,6 @@ tag command action ~ |:options| :opt[ions] open the options-window |:ounmap| :ou[nmap] like ":unmap" but for Operator-pending mode |:ounmenu| :ounme[nu] remove menu for Operator-pending mode -|:ownsyntax| :ow[nsyntax] set new local syntax highlight for this window |:packadd| :pa[ckadd] add a plugin from 'packpath' |:packloadall| :packl[oadall] load all packages under 'packpath' |:pbuffer| :pb[uffer] edit buffer in the preview window diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index d4fbf4564c..c3731a47ee 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -5505,38 +5505,7 @@ And put these lines in your vimrc: > autocmd BufRead,BufNewFile *.[ch] endif ============================================================================== -17. Window-local syntax *:ownsyntax* - -Normally all windows on a buffer share the same syntax settings. It is -possible, however, to set a particular window on a file to have its own -private syntax setting. A possible example would be to edit LaTeX source -with conventional highlighting in one window, while seeing the same source -highlighted differently (so as to hide control sequences and indicate bold, -italic etc regions) in another. The 'scrollbind' option is useful here. - -To set the current window to have the syntax "foo", separately from all other -windows on the buffer: > - :ownsyntax foo -< *w:current_syntax* -This will set the "w:current_syntax" variable to "foo". The value of -"b:current_syntax" does not change. This is implemented by saving and -restoring "b:current_syntax", since the syntax files do set -"b:current_syntax". The value set by the syntax file is assigned to -"w:current_syntax". -Note: This resets the 'spell', 'spellcapcheck', 'spellfile' and 'spelloptions' -options. - -Once a window has its own syntax, syntax commands executed from other windows -on the same buffer (including :syntax clear) have no effect. Conversely, -syntax commands executed from that window do not affect other windows on the -same buffer. - -A window with its own syntax reverts to normal behavior when another buffer -is loaded into that window or the file is reloaded. -When splitting the window, the new window will use the original syntax. - -============================================================================== -18. Color xterms *xterm-color* *color-xterm* +17. Color xterms *xterm-color* *color-xterm* *colortest.vim* To test your color setup, a file has been included in the Vim distribution. @@ -5546,7 +5515,7 @@ To use it, execute this command: > Nvim uses 256-color and |true-color| terminal capabilities wherever possible. ============================================================================== -19. When syntax is slow *:syntime* +18. When syntax is slow *:syntime* This is aimed at authors of a syntax file. diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 6a41c2ad05..f4bf220898 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -5252,6 +5252,7 @@ void ex_syntax(exarg_T *eap) } } +/// @deprecated void ex_ownsyntax(exarg_T *eap) { if (curwin->w_s == &curwin->w_buffer->b_s) {