Open pmario opened 2 years ago
Thanks @pmario that's a good idea.
I've been digging into this. What is the preferred strategy here?
To add a "spellcheck" or similarly named attribute to the EditTextWidget
?
Or maybe ContentType
could be used to enable/disable spellchecking?
Hi @amreus
To add a "spellcheck" or similarly named attribute to the
EditTextWidget
?
Yes I think that makes sense.
The OP asks for a per-tiddler setting, but I'm not sure that it's worth the visual clutter. I'd also rather avoid adding new UI strings for this, so perhaps it could be a hidden setting.
Yes I think that makes sense.
Ok. I'm still trying to get a grip on the internals but will continue to study.
The OP asks for a per-tiddler setting
I'm the OP. I didn't mention a per-tiddler setting, in fact I mentioned that a global per-wiki setting would be my preference. But if the setting is per wiki, then it would seem a new widget attribute would be unnecessary?
I'm the OP. I didn't mention a per-tiddler setting, in fact I mentioned that a global per-wiki setting would be my preference. But if the setting is per wiki, then it would seem a new widget attribute would be unnecessary?
We should still implement it via a new attribute for flexibility.
Just an update and note for myself and comments.
Spellchecking defaults to "yes".
There may exist a config tiddler named $:/config/TextEditor/Spellchecking
with accepted values of "yes" and "no". The edit-widget looks to this tiddler to enable/disable spellchecking. If the tiddler exists and its text field is set to "no", only then is spellchecking disabled for the dom element (textarea).
The above global Spellchecking is over-ridden by a spellchecking
attribute of the edit-text widget if it is used.
Sound right?
Sound right?
Yes, thank you @amreus. Let me know if you run into any blocks.
I did not do any sort of UI, but the diffs can be viewed here:
If it's headed in the right direction, I can do a pull request.
This can be used as a toggle for test.
$:/config/TextEditor/Spellchecking enabled? <$checkbox
tiddler="$:/config/TextEditor/Spellchecking" field=text checked=yes
unchecked=no default=yes> {{$:/config/TextEditor/Spellchecking}}</$checkbox>
I think the refresh mechanism needs to check against attribute changes and config-tiddler change.
I think the refresh mechanism needs to check against attribute changes and config-tiddler change.
I did wonder about that. Out of curiosity, what is the scenario where the attribute change is what causes a refresh?
I did wonder about that. Out of curiosity, what is the scenario where the attribute change is what causes a refresh?
If I use my own config tiddler and connect it to the widget call.
In principele, it doesn't really matter. If the attribute is there, there is a chance that it will change. So the refresh-handling has to be there.
I think the refresh mechanism needs to check against attribute changes and config-tiddler change.
Ok added. I also squashed the silly minor commits.
Tony asked a question about using this with codemirror plugin. I didn't have a good answer about that. Is it an problem?
Tony asked a question about using this with codemirror plugin. I didn't have a good answer about that. Is it an problem?
There has been a discussion at GG and a workaround was suggested, that I think is perfectly fine.
See: https://github.com/Jermolene/TiddlyWiki5/issues/5841 and: https://groups.google.com/g/tiddlywiki/c/PwoBZHggN2s/m/XGUnRTTNAgAJ
Other open Issues: https://github.com/Jermolene/TiddlyWiki5/issues?q=is%3Aissue+is%3Aopen+spell+check
Some time ago I found out, that CM5 has an option to turn on spellchecking. https://codemirror.net/5/doc/manual.html search for "spellcheck"
The request comes from: https://talk.tiddlywiki.org/t/turn-off-spellcheck/4378
It's requested to toggle the browser spellchecker on a per tiddler-editor basis with a keyboard shortcut or a toolbar button. There should be a small spell-check indicator too
It should be relatively straight forward. https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck