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 for */_ not working (same with multiple chars - **/__) #413

Open
JosefLitos opened this issue Nov 7, 2023 · 6 comments
Open
Labels
bug Something isn't working

Comments

@JosefLitos
Copy link
Contributor

JosefLitos commented Nov 7, 2023

Description

fast wrap won't trigger upon pressing keybind when trying to use it for * or **/__ (markdown)

Mapping bug

No response

Steps to reproduce

Try to do a fast wrap of ** or even just *

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()
	local nap = require 'nvim-autopairs'
	nap.setup {
		ts_config = {
			lua = { 'string' }, -- it will not add pair on that treesitter node
			javascript = { 'template_string' },
		},
		disable_filetype = { 'rnvimr', 'NvimTree' },
		fast_wrap = {
			map = '<M-w>',
			chars = { '{', '[', '(', '"', "'", '`', '**', '_' },
			pattern = '[\'")>%]},: ]',
			end_key = '$',
			before_key = 'q',
			after_key = 'e',
			keys = "qwertasdfgzxcvb12345[poiu';lkjh/.,mny-0987",
			check_comma = true,
			highlight = 'IncSearch',
			highlight_grey = '',
			use_virt_lines = false,
		},
		ignored_next_char = '[^.,;>)%]}]',
	}
	local Rule = require 'nvim-autopairs.rule'
	local cond = require 'nvim-autopairs.conds'
	nap.add_rules {
		Rule('**', '**', 'markdown'):with_pair(cond.not_after_regex '[^.,;>)%]}]'),
		Rule('_', '_', 'markdown'):with_pair(cond.not_after_regex '[^.,;>)%]}]'),
	}
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()]]
@JosefLitos JosefLitos added the bug Something isn't working label Nov 7, 2023
Copy link

stale bot commented Jan 6, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jan 6, 2024
@JosefLitos
Copy link
Contributor Author

I would like to at least understand why singular _ does wrap, but * doesn't.

@stale stale bot removed the wontfix This will not be worked on label Jan 7, 2024
Copy link

stale bot commented Mar 7, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Mar 7, 2024
@JosefLitos
Copy link
Contributor Author

JosefLitos commented Mar 9, 2024

This bot should've been automatically marked as useless because it has not had any useful impact on the issue, let alone the comment and email spam forced by this "feature".

@stale stale bot removed the wontfix This will not be worked on label Mar 9, 2024
Copy link

stale bot commented May 9, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label May 9, 2024
@JosefLitos
Copy link
Contributor Author

This bot is the literal definition of a spam generator

@stale stale bot removed the wontfix This will not be worked on label May 9, 2024
@JosefLitos JosefLitos changed the title fast wrap for * not working (same with multichars - **/__) fast wrap for */_ not working (same with multiple chars - **/__) May 9, 2024
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

No branches or pull requests

1 participant