fix bug #595, with spell check

Originally committed to SVN as r2196.
This commit is contained in:
pstatic 2008-06-01 03:44:41 +00:00
parent e091763052
commit 5942928b45
2 changed files with 8 additions and 0 deletions

View file

@ -237,6 +237,7 @@ void HunspellSpellChecker::SetLanguage(wxString language) {
if (language.IsEmpty()) return;
// Get dir name
//FIXME: this should use ?user instead of ?data; however, since it apparently works already on win32, I'm not gonna mess with it right now :p
wxString path = DecodeRelativePath(Options.AsText(_T("Dictionaries path")),StandardPaths::DecodePath(_T("?data/"))) + _T("/");
wxString userPath = StandardPaths::DecodePath(_T("?user/dictionaries/user_"));
@ -245,6 +246,8 @@ void HunspellSpellChecker::SetLanguage(wxString language) {
dicpath = path + language + _T(".dic");
usrdicpath = userPath + language + _T(".dic");
printf("Using dictionary %ls for spellchecking\n", dicpath.c_str());
// Check if language is available
if (!wxFileExists(affpath) || !wxFileExists(dicpath)) return;

View file

@ -691,6 +691,11 @@ void SubsTextEditCtrl::StyleSpellCheck(int start, int len) {
SetUnicodeStyling(s,e-s,32);
}
}
// It seems like wxStyledTextCtrl wants you to finish styling at the end of the text.
// I don't really understand why, it's not documented anywhere I can find, but this fixes bug #595.
StartUnicodeStyling(text.Length(), 0);
SetUnicodeStyling(text.Length(), 0, 0);
}