Git Product home page Git Product logo

Comments (8)

LunarWatcher avatar LunarWatcher commented on September 23, 2024 1

Managed to repro with that one specifically. You could set that one to be specifically for HTML though (see g:AutoPairsLanguagePairs and temporarily autopairs#AutoPairsScriptInit). Gonna look into this though - the regex itself matches both, so I'm not entirely sure what happens here. Might be a borked balance check somewhere

from auto-pairs.

LunarWatcher avatar LunarWatcher commented on September 23, 2024 1

Try updating from the master branch. It was a borked balance check :')

TL;DR: count doesn't process regex, so your pair registered a close without an open, which tripped the balance check.

from auto-pairs.

jovenlin0527 avatar jovenlin0527 commented on September 23, 2024 1

It's working! Thank you.

from auto-pairs.

LunarWatcher avatar LunarWatcher commented on September 23, 2024

No repro in any other files but Rust files. Mildly sus it's down to the Rust plugin remapping stuff. Are you using that plugin? If yes, can you let g:rust_keep_autopairs_default = 1 for science? Might also be a part of the polyglot plugin, if you haven't explicitly defined a Rust plugin.

I have absolutely no clue why it only inserts one though -- can't repro that locally in or out of Rust files. What happens if you :verbose imap <?

from auto-pairs.

jovenlin0527 avatar jovenlin0527 commented on September 23, 2024

No repro in any other files but Rust files. Mildly sus it's down to the Rust plugin remapping stuff. Are you using that plugin? If yes, can you let g:rust_keep_autopairs_default = 1 for science? Might also be a part of the polyglot plugin, if you haven't explicitly defined a Rust plugin.

I use neither of those.

I have absolutely no clue why it only inserts one though -- can't repro that locally in or out of Rust files. What happens if you :verbose imap <?

It shows i < *@<C-R>=autopairs#AutoPairsInsert('<')<CR>.

I believe it's due to language specific pair. I just edited my HTML pair to be {'\w\zs<': '>'}, and this bug also shows up.

from auto-pairs.

LunarWatcher avatar LunarWatcher commented on September 23, 2024

I don't think it should cause issues, but not using \V in the regex method might come back to bite me. We'll see, didn't cause problems in testing - if it causes problems, feel free to open another issue or leave a comment here.

from auto-pairs.

jovenlin0527 avatar jovenlin0527 commented on September 23, 2024

No repro in any other files but Rust files. Mildly sus it's down to the Rust plugin remapping stuff. Are you using that plugin? If yes, can you let g:rust_keep_autopairs_default = 1 for science? Might also be a part of the polyglot plugin, if you haven't explicitly defined a Rust plugin.

By the way, I just installed that plugin, and it disables auto pair for <>. let g:rust_keep_autopairs_default enables it again.

Think you may want to know.

from auto-pairs.

LunarWatcher avatar LunarWatcher commented on September 23, 2024

Yeah, it forcibly overrides b:AutoPairs. The variable itself is largely meant for when you'd want a specific set of pairs for a buffer (i.e. for a specific filetype, as in a complete override instead of just custom additions, unless autopairs#AutoPairsDefine is used to add pairs).

Setting it that way is kinda counter-productive (in my opinion, to be clear), as it completely overrides user config with how this plugin is set up. Might have to find an alternate system that lets plugins and user options coexist, but I have no ideas for that atm. autopairs#AutoPairsDefine might already be a good choice, as it enables pair removal in the second argument (which is a vararg), but gonna have to deal with that later. Compatibility is also a bit of a problem -- I don't think I currently have enough "justification" or whatever to alter other plugins to facilitate this one. We'll see, future me's problem and whatnot :p

from auto-pairs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.