Mercurial > vim
view src/testdir/test_searchpos.vim @ 32996:dd8da8f1c2bc v9.0.1790
patch 9.0.1790: Redundant LSP Content-Type header
Commit: https://github.com/vim/vim/commit/8fbd9449e71f2ad93e594be575209a7424eb093e
Author: Magnus Gro? <magnus@mggross.com>
Date: Sun Aug 27 00:49:51 2023 +0200
patch 9.0.1790: Redundant LSP Content-Type header
Problem: The Content-Type header is an optional header that some LSP
servers struggle with and may crash when encountering it.
Solution: Drop the Content-Type header from all messages, because we use
the default value anyway.
Because pretty much all popular LSP clients (e.g. coc.nvim, VSCode) do
not send the Content-Type header, the LSP server ecosystem has developed
such that some LSP servers may even crash when encountering it.
To improve compatibility with these misbehaving LSP servers, we drop
this header as well.
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Magnus Gro? <magnus@mggross.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 27 Aug 2023 11:15:03 +0200 |
parents | 08940efa6b4e |
children |
line wrap: on
line source
" Tests for searchpos() func Test_searchpos() new one 0put ='1a3' 1put ='123xyz' call cursor(1, 1) call assert_equal([1, 1, 2], searchpos('\%(\([a-z]\)\|\_.\)\{-}xyz', 'pcW')) call cursor(1, 2) call assert_equal([2, 1, 1], '\%(\([a-z]\)\|\_.\)\{-}xyz'->searchpos('pcW')) set cpo-=c call cursor(1, 2) call assert_equal([1, 2, 2], searchpos('\%(\([a-z]\)\|\_.\)\{-}xyz', 'pcW')) call cursor(1, 3) call assert_equal([1, 3, 1], searchpos('\%(\([a-z]\)\|\_.\)\{-}xyz', 'pcW')) " Now with \zs, first match is in column 0, "a" is matched. call cursor(1, 3) call assert_equal([2, 4, 2], searchpos('\%(\([a-z]\)\|\_.\)\{-}\zsxyz', 'pcW')) " With z flag start at cursor column, don't see the "a". call cursor(1, 3) call assert_equal([2, 4, 1], searchpos('\%(\([a-z]\)\|\_.\)\{-}\zsxyz', 'pcWz')) set cpo+=c " close the window q! endfunc " vim: shiftwidth=2 sts=2 expandtab