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

autocomplete causes double open tags #9

Open
wraithrose opened this issue May 9, 2020 · 1 comment
Open

autocomplete causes double open tags #9

wraithrose opened this issue May 9, 2020 · 1 comment

Comments

@wraithrose
Copy link

For example, if I am trying to bold some dialogue, I type { and autocomplete offers up the bold tags for me, but when I select it, instead of completing what's already there, it just pastes in the whole snippet, resulting in double brackets at the beginning:

{{b} {/b}

Thought it might be an issue with Sublime, but it doesn't do this with this package disabled, and I have nothing else installed? (very new to renpy and sublime!)

@koroshiya
Copy link
Owner

Hmm, that's a tricky one. The problem appears to be that sublime-completions files don't consider those sorts of characters to be part of the trigger.

So even though the auto-complete trigger (defined in TextTags.sublime-autocompletions) is defined as "{b}", Sublime Text only really cares about the "b". This is why you can trigger the auto-complete by entering "b", but not by entering "{" by itself. And also why once you've written the full "{b}", the auto-complete can't be triggered anymore, since the last character is "}" which it doesn't consider part of the trigger.

I've seen this problem occur in other syntax packages, particularly HTML auto-completions. The only solution I'm aware of is to remove the .sublime-autocompletions file altogether and replace it with a manual tag auto-completion plugin written in Python. I'd rather not do that (sublime-autocompletions files are supposed to remove the need for doing that), so I'll look around a bit before making any changes.

For this particular case (the bold text tag) I'd recommend using the hotkey instead. I've defined three hotkeys inside of the .sublime-keymap files: ctrl+i for italic, ctrl+b for bold, ctrl+u for underline (super instead of ctrl for MacOS). That doesn't resolve the underlying issue, but I find it easier for inserting formatting in Renpy text.

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