neoclide / coc-yaml

Yaml language server extension for coc.nvim
MIT License
248 stars 23 forks source link

Strange spaces are inserted if coc.preferences.formatOnType is set #51

Closed yutkat closed 2 years ago

yutkat commented 3 years ago

When I insert a bullet in yaml with coc.preferences.formatOnType enabled, it inserts weirdly

https://user-images.githubusercontent.com/8683947/142221101-dd580c0f-f11b-4f3b-b85d-b744a4faaca0.mp4

neovim version: v0.6.0-dev+582-g87a053f12

minimal init.lua

vim.cmd [[syntax enable]]
vim.cmd [[filetype plugin indent on]]

local execute = vim.api.nvim_command
local install_path = vim.fn.stdpath('data')..'/site/pack/packer/opt/packer.nvim'

if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
  execute('!git clone https://github.com/wbthomason/packer.nvim '..install_path)
end

vim.cmd [[packadd packer.nvim]]

-- trailing whitespace
vim.cmd [[
hi TrailingWhitespace ctermbg=red guibg=red
call matchadd("TrailingWhitespace", '\v\s+$')
]]

return require('packer').startup(function()
  use {'wbthomason/packer.nvim', opt = true}
  use {'neoclide/coc.nvim',
    branch = 'release',
    config = function()
       vim.cmd[[call coc#config('coc.preferences.formatOnType', 'true')]]
       vim.g.coc_global_extensions = {'coc-yaml'}
    end}
end)
~
fannheyward commented 3 years ago

Reproduced