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

Support for lua [=[...]=] string? #73

Open
Bekaboo opened this issue Jan 10, 2024 · 4 comments
Open

Support for lua [=[...]=] string? #73

Bekaboo opened this issue Jan 10, 2024 · 4 comments

Comments

@Bekaboo
Copy link

Bekaboo commented Jan 10, 2024

I know it might be hard or tricky but is it possible to auto-pair [=[...]=] lua string?

With this config:

require('ultimate-autopair').setup({
  { '[=[', ']=]', ft = { 'lua' } },
})

the current behavior will left one extra square bracket after the string:

|        -->  type [
[|]     --> type =
[=|]   --> type [
[=[|]=]]
@Bekaboo
Copy link
Author

Bekaboo commented Jan 10, 2024

Nevermind, I find out:

  { '[=[', ']=', ft = { 'lua' } },
  {
    '[=[',
    ']=]',
    ft = { 'lua' },
    disable_start = true,
    disable_end = true,
  },

@Bekaboo Bekaboo closed this as completed Jan 10, 2024
@Bekaboo
Copy link
Author

Bekaboo commented Jan 10, 2024

Now the only question is that how to pair [==[ with ]==], [===[ with ]===], etc. since lua supports any numbers of = in between brackets for nesting purposes...

@Bekaboo Bekaboo reopened this Jan 10, 2024
@altermo
Copy link
Owner

altermo commented Jan 10, 2024

First; I fixed a bug so that { '[=[', ']=]', ft={ 'lua' } } doesn't insert an extra square bracket (this was already implemented but only worked for two char pairs). (7e28167)
Second; Not yet possible (to do arbitrary-character pair), but it is planned for the next version (keep this issue open until then).

@Bekaboo
Copy link
Author

Bekaboo commented Jan 10, 2024

Appreciate your quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants