hrsh7th / nvim-insx

Flexible key mapping manager.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FR: do not auto-add `'` when in comment region

chrisgrieser opened this issue · comments

Using the presets, when typing a ' anywhere automatically adds another '. This is usually great, but inside comments, this is rather annoying, since in comments, I often want to write something like "isn't" or "it's", and always get an unnecessary extra ' there.

I'd suggest either not auto-enclosing ' in comments, or adding some conditionals like for example only adding ' if the previous character is a non-letter.

thanks for the quick fix! Unfortunately it seems the behavior has not changed; in a comment, it's still auto-pairing the '

Ah, Sorry.,I forgotten to add insx.with for preset.

@chrisgrieser

Hm...

  1. The standard preset already prevented auto-pairing the ' in string or comment syntax.
  2. The standard preset has test for this

So I can't understand why this problem is occured in your environment.
Could you provide more information such filetype or configuration?

that's weird. I checked that I am on the latest commit of the plugin.

I just use the preset:

	{ 
		"hrsh7th/nvim-insx",
		event = "InsertEnter",
		config = function() require("insx.preset.standard").setup() end,
	},

the auto-pairing for ' happens in every filetype I tested (lua, js, sh)

I found one problem. It may be related to this problem. I'll fix it.

This was a much more difficult problem than I thought.
I believe it is fixed now. Please check the operation.

can confirm issue is now fixed. Thanks a lot!