Skip to content

Conversation

@paaguti
Copy link

@paaguti paaguti commented Feb 12, 2025

A way to control when to auto_enclose punctuation characters.

@orbitalquark
Copy link
Owner

orbitalquark commented Feb 17, 2025

I'm going to propose this:

 events.connect(events.KEYPRESS, function(key)
 	if not M.auto_enclose or buffer.selection_empty or not key:find('^%p$') then return end
 	if ui.command_entry.active then return end
+	if textadept.snippets.active and not M.auto_pairs[key] then return end -- likely placeholder
 	M.enclose(key, M.auto_pairs[key] or key, true)
 	return true -- prevent typing
 end, 1)

I am not in favor of adding another textadept.editing option, and since we are the only two who have been inconvenienced enough to bring it up, then I think this is okay. Should anyone complain, we can revisit :)

Does this work for you? Or do you also experience the issue outside of snippets?

@paaguti
Copy link
Author

paaguti commented Feb 20, 2025

OK, let's go ahead, and keep my PR as a backupif complains start raining ;-)

@orbitalquark
Copy link
Owner

Committed in eae67d4

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

Successfully merging this pull request may close these issues.

2 participants