rafamadriz / friendly-snippets

Set of preconfigured snippets for different languages.
MIT License
1.95k stars 439 forks source link

The latex dots snippet prevents one from typing paragraphs. #394

Open mashtonian opened 8 months ago

mashtonian commented 8 months ago

When writing a large amount of text, multiple paragraphs, and having auto-completion enabled in your snippet engine, the 'dots' snippet intercedes when finishing a paragraph. The end of paragraph one is a '.' followed by 'Enter', which triggers the snippet insertion of '\dots'.

OkelleyDevelopment commented 7 months ago

Hi @mashtonian, I double checked and agree this should be changed to avoid the collision.

Ref: ./snippets/latex.json snippet:

    "etc": {
        "prefix": "...",
        "body": "\\dots",
        "description": "\\dots"
    },

Now the question to answer is: what would be a better prefix? I'm considering dots or perhaps we simply remove the snippet entirely. :thinking:

mashtonian commented 7 months ago

Great. Thanks.

What about a pair of dots followed by enter, as opposed to a single one?

On Mon, 12 Feb 2024, 06:25 OkelleyDevelopment, @.***> wrote:

Hi @mashtonian https://github.com/mashtonian, I double checked and agree this should be changed to avoid the collision.

Ref: ./snippets/latex.json snippet:

"etc": {
    "prefix": "...",
    "body": "\\dots",
    "description": "\\dots"
},

Now the question to answer is: what would be a better prefix? I'm considering dots or perhaps we simply remove the snippet entirely. 🤔

— Reply to this email directly, view it on GitHub https://github.com/rafamadriz/friendly-snippets/issues/394#issuecomment-1938081655, or unsubscribe https://github.com/notifications/unsubscribe-auth/APZQI47GWZO2P625WRRLBWDYTGRTLAVCNFSM6AAAAABBYMES6WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZYGA4DCNRVGU . You are receiving this because you were mentioned.Message ID: @.***>

JFMarten commented 5 months ago

Hi, any progress on this topic? I just stumbled across this behavior.

OkelleyDevelopment commented 5 months ago

Hi @JFMarten and @mashtonian, I've tried the .. method and (to no surprise) it didn't provide any different behavior. The issue we're encountering is that the snippet engine is matching on . (the first dot of the three) and so when you enter to the next line it's selecting it.

This leads me to possible "fixes"

Thoughts or objections? Feel free to raise a PR too (not trying to gatekeep a fix :sweat_smile: )

surmish commented 3 months ago

Not sure why snippets exist for 1 word commands in the first place. Wouldn't this just spam the completion menu, snippets shouldn't be used as a language reference.

mashtonian commented 1 week ago

Apologies for huge delay in replying.

My preference would be for the alphanumeric prefixes, such as "dots" or "elip".

Not sure I feel confident enough to submit a PR, but will have a look and see.

M