Autocorrect in Code Blocks iOS

Would it be possible to disable automatic corrections while in a code block? The editor automatically changing “var” to “car,” as well as the automatic usage of “curly quotes” instead of normal quotation marks are things that get slightly annoying when trying to quickly type something out on iOS.

2 Likes

Hello there!

Thank you so much for the feedback! I agree that the autocorrect inside code elements is not something one would like to have. Unfortunately the autocorrect setting is something that can be applied to the whole document at once, and is evaluated when you start editing.

We will try to find a workaround to this behaviour and, if it will play fine with the rest of the editor, we will implement it in.

:wave:

2 Likes

Thanks for the reply! I don’t know how this would work with the editor system (or if it’s too hack-y), but would it maybe be possible to tell the editor to end editing, change the setting, then resume editing?
Something like:

		textView.endEditing(true)
		textView.autocorrectionType = .no
		textView.becomeFirstResponder()

in my own experience this has worked without any weird animation glitches or anything, but I obviously have no idea what the actual code is like behind the editor, or if something like that would work at all for it.

Sorry, I just realized that I was looking at whether the suggestions appeared above the keyboard, not whether it actually did spellcheck — my bad —(maybe that would be .spellcheckType instead, but I’m not exactly sure)
thanks for making such an awesome editor! Much appreciated.

Yes, that’s what we have to check.

Most of the cases a .reloadInputViews() does the trick, but we have to investigate if it could interfere with other behaviours of the new editor.

Thank you very much for your feedback!

1 Like