windwp / nvim-autopairs

autopairs for neovim written in lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fast wrap highlighting is wrong with lines that contain tabs

temhelk opened this issue · comments

Description

When fast wrap is used on lines that contain tabs it looks like the highlighting adds only one space per tab character and that makes the highlighted positions wrong.

Mapping bug

No response

Steps to reproduce

In the minimal config the fast wrap was enabled fast_wrap = {}

The fast wrap was used with the tab character in the beginning and some text afterwards (see screenshots)

Example with default tabstop=8
image

And with tabstop=2
image

Minimal config

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'
local function load_plugins()
  require('packer').startup {
    {
      'wbthomason/packer.nvim',
      {
        'windwp/nvim-autopairs',
      },
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
      display = { non_interactive = true },
    },
  }
end
_G.load_config = function()
  require('nvim-autopairs').setup({
    fast_wrap = {}
  })
end
if vim.fn.isdirectory(install_path) == 0 then
  print("Installing nvim-autopairs and dependencies.")
  vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path }
end
load_plugins()
require('packer').sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]]

I've tried to solve it, not sure if that's the best way, but it appears to work. temhelk@d9af165
If that's a satisfactory solution and it doesn't break anything I can open a pull request.

thank ,you can send a PR