echasnovski / mini.nvim

Library of 40+ independent Lua modules improving overall Neovim (version 0.8 and higher) experience with minimal effort
MIT License
4.45k stars 171 forks source link

mini.pairs: Triple quotes / backticks #1005

Closed keonly closed 2 days ago

keonly commented 2 days ago

Contributing guidelines

Module(s)

mini.pairs

Description

When typing triple quotes / backticks (e.g., raw string in Python, code block in Markdown), mini.pairs writes only one quote / backtick behind the cursor.

mini.pairs seems to be understanding each symbol separately; when three symbols are entered, it adds one symbol after the first one, thinks the second symbol is the closing symbol for the first one, and adds one symbol after the third one.

Neovim version

0.10.0

Steps to reproduce

  1. Open a file.
  2. Enter insert mode.
  3. Write three quotes / backticks.

Expected behavior

Three quotes / backticks are generated behind the cursor.

Actual behavior

Only one is generated behind the cursor.

https://github.com/echasnovski/mini.nvim/assets/70371393/970e09bf-edf4-4568-83de-dbd34be01b32

echasnovski commented 2 days ago

Thanks for the issue!

This is an intended behavior because pair can consist only from two characters and customization can be done only based on two-character cursor neighborhood . See #31 for more details.

Closing as duplicate.