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

Feature request: auto surround quotes #444

Open
Kuroonehalf opened this issue Oct 12, 2024 · 9 comments
Open

Feature request: auto surround quotes #444

Kuroonehalf opened this issue Oct 12, 2024 · 9 comments

Comments

@Kuroonehalf
Copy link

Unsure if the default behavior in other editors applies to single tick quotes, since it could interfere with apostrophes in strings, but I figure this should be easy enough to add for double tick quotes. I write game scripts in a python language so I use quotes constantly, and quote auto surround is a nice QOL feature.

@focus-editor
Copy link
Owner

focus-editor commented Oct 12, 2024 via email

@Kuroonehalf
Copy link
Author

I assume you mean the auto_surround_with_brackets_and_quotes option. Even with it toggled on, I don't seem to get any quote auto surround. Is it supposed to work?

@focus-editor
Copy link
Owner

focus-editor commented Oct 12, 2024 via email

@Kuroonehalf
Copy link
Author

Kuroonehalf commented Oct 12, 2024

Oh, I understand now. You make a selection, then press quote. I mean I'd like it to work without selection, the way auto surround brackets/braces work. You open quote, and it automatically places another quote in front of the cursor.

@focus-editor
Copy link
Owner

focus-editor commented Oct 12, 2024 via email

@Kuroonehalf
Copy link
Author

Right. Types another quote, 1 character ahead of the cursor. The basic implemention of this seems like it might be that simple.

A more fancy implementation might want to detect when the quote is opening or closing a string, and if it's closing, don't type the extra quote. It should also account for deleting an empty quote string (i.e. [quote][cursor][quote]), which ideally should delete both quotes.

I forgot to mention, but this feature is also nice so that when you're typing a string, it doesn't interpret it as code and syntax highlight it incorrectly.

@focus-editor
Copy link
Owner

focus-editor commented Oct 13, 2024 via email

@Kuroonehalf
Copy link
Author

I'm not sure I understand this possible annoying scenario. When would the added quote get in the way? Generally, all quotes opened must be closed, no? You open it, type whatever you want to type, then press right to go to the right of the closing quote. Unless you're single tick quoting a double tick quote, but that strikes me as an exceedingly rare scenario. On the other hand, any random game script will have thousands of lines in quotes, and a little QOL feature like this would go a long way. I guess if you're really opposed I'll drop my case, but it's a feature that would be useful to many.

@focus-editor
Copy link
Owner

focus-editor commented Oct 13, 2024 via email

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