Skip to content
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

Fast wrap highlighting is wrong with lines that contain tabs #452

Closed
temhelk opened this issue Apr 25, 2024 · 2 comments · Fixed by #453
Closed

Fast wrap highlighting is wrong with lines that contain tabs #452

temhelk opened this issue Apr 25, 2024 · 2 comments · Fixed by #453
Labels
bug Something isn't working

Comments

@temhelk
Copy link
Contributor

temhelk commented Apr 25, 2024

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()]]
@temhelk temhelk added the bug Something isn't working label Apr 25, 2024
@temhelk
Copy link
Contributor Author

temhelk commented Apr 26, 2024

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.

@windwp
Copy link
Owner

windwp commented Apr 29, 2024

thank ,you can send a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants