News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Problem with comments

Started by Lqwertz80, March 23, 2013, 02:38:46 AM

Previous topic - Next topic

Lqwertz80

Hi,
Sorry, I do not speak very good english!
Who can help me?
I have the latest version C::B 12.11 installed, everything is ok to compile my projects in C and C++.
But all comments and "char string" are highlighted in red. I've see if it's possible disable an option but I do not found.
It's really not pleasant to work in editor with this.
I hope my question is understandable.

Thank you in advance.

oBFusCATed

Yes, disable the spellcheck plugin or install some dictionaries.

http://wiki.codeblocks.org/index.php?title=SpellChecker_plugin

@dev:
1. Probably we should do something about this problem?
2. Disable spellcheck by default?
3. Provide dictionaries?
4. Don't highlight anything if there is no dictionary?

It seems that 4 is the best option...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Alpha

Click in the bottom right hand corner (on the flag), then select a language.

Quote from: oBFusCATed on March 23, 2013, 03:46:51 AM
@dev:
1. Probably we should do something about this problem?
2. Disable spellcheck by default?
3. Provide dictionaries?
4. Don't highlight anything if there is no dictionary?
The functioning in the trunk is better than in 12.11; in 12.11, if there are no dictionaries, spellcheck automatically disables itself.  Unfortunately, if it does find dictionaries, but none of them are its default language, it will enable on an invalid dictionary.
In the trunk, it selects the user specified dictionary, if available, otherwise the system local, if available, otherwise the first valid dictionary, otherwise disable.

oBFusCATed

Quote from: Alpha on March 23, 2013, 04:00:03 AM
The functioning in the trunk is better than in 12.11; in 12.11, if there are no dictionaries, spellcheck automatically disables itself.  Unfortunately, if it does find dictionaries, but none of them are its default language, it will enable on an invalid dictionary.
How can it find dictionaries on Windows without the help of the users? As most reports are from Windows users if I recall right.

Quote from: Alpha on March 23, 2013, 04:00:03 AM
In the trunk, it selects the user specified dictionary, if available, otherwise the system local, if available, otherwise the first valid dictionary, otherwise disable.
I think we should remove this "first valid dictionary". Even using the system's local is dangerous. It should default to English most probably, because most code is written in English.
And after we switch it to English if there are reports, we should just disable it by default and be done with it :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Alpha

Quote from: oBFusCATed on March 23, 2013, 04:36:13 AM
How can it find dictionaries on Windows without the help of the users?
Magic ;) .
... actually, it guesses a few likely locations:
src/plugins/contrib/SpellChecker/SpellCheckerConfig.cpp

const wxString SpellCheckerConfig::GetDictionaryPath()const
{
    wxArrayString dictPaths;
    dictPaths.Add(m_DictPath);
    Manager::Get()->GetMacrosManager()->ReplaceEnvVars(dictPaths[0]);
    if (platform::windows)
    {
        wxString programs = wxT("C:\\Program Files");
        wxGetEnv(wxT("ProgramFiles"), &programs);
        dictPaths.Add(programs + wxT("\\Mozilla Firefox\\dictionaries"));
        dictPaths.Add(programs + wxT("\\Mozilla\\Firefox\\dictionaries"));
        dictPaths.Add(programs + wxT("\\Mozilla Thunderbird\\dictionaries"));
        dictPaths.Add(programs + wxT("\\Mozilla\\Thunderbird\\dictionaries"));
        wxString libreOffice = wxFindFirstFile(programs + wxT("\\*LibreOffice*"), wxDIR);
        wxString openOffice = wxFindFirstFile(programs + wxT("\\*OpenOffice*"), wxDIR);
        wxArrayString langs = GetArrayFromString(wxT("en;fr;es;de"));
        for (size_t i = 0; i < langs.GetCount(); ++i)
        {
            if (!libreOffice.IsEmpty())
                dictPaths.Add(libreOffice + wxT("\\share\\extensions\\dict-") + langs[i]);
            if (!openOffice.IsEmpty())
                dictPaths.Add(openOffice + wxT("\\share\\extensions\\dict-") + langs[i]);
        }
    }
    else
    {
        dictPaths.Add(wxT("/usr/share/hunspell"));
        dictPaths.Add(wxT("/usr/share/myspell/dicts"));
    }
    dictPaths.Add(m_pPlugin->GetOnlineCheckerConfigPath());
    for (size_t i = 0; i < dictPaths.GetCount(); ++i)
    {
        if (wxDirExists(dictPaths[i]) && !wxFindFirstFile(dictPaths[i] + wxFILE_SEP_PATH + wxT("*.dic"), wxFILE).IsEmpty())
            return dictPaths[i];
    }
    return dictPaths[0];
}

Jenna

Quote from: oBFusCATed on March 23, 2013, 04:36:13 AM
How can it find dictionaries on Windows without the help of the users? As most reports are from Windows users if I recall right.

People should learn to read !!
If you start C::B with an unconfigured spellchecker-plugin you get an annoying dialog telling you, that you need dictionaries, with a link to the appropriate wiki-site: http://wiki.codeblocks.org/index.php?title=SpellChecker_plugin .

Most people tend to close such dialogs immediately, because they are used to try to work without reading manuals (and similar) and bother others instead.

Alpha

Quote from: oBFusCATed on March 23, 2013, 04:36:13 AM
I think we should remove this "first valid dictionary". Even using the system's local is dangerous. It should default to English most probably, because most code is written in English.
I will write up a patch, but which English:

    m_LanguageNamesMap[_T("en")]    = _T("English");
    m_LanguageNamesMap[_T("en_AU")] = _T("English (Australia)");
    m_LanguageNamesMap[_T("en_CA")] = _T("English (Canada)");
    m_LanguageNamesMap[_T("en_GB")] = _T("English (United Kingdom)");
    m_LanguageNamesMap[_T("en_NZ")] = _T("English (New Zealand)");
    m_LanguageNamesMap[_T("en_US")] = _T("English (United States)");
    m_LanguageNamesMap[_T("en_ZA")] = _T("English (South Africa)");


Quote from: jens on March 23, 2013, 04:21:20 PM
If you start C::B with an unconfigured spellchecker-plugin you get an annoying dialog telling you, that you need dictionaries, with a link to the appropriate wiki-site: http://wiki.codeblocks.org/index.php?title=SpellChecker_plugin .
I am not certain, but I think this dialog might fail to show up if a dictionary location is correctly guessed; I will be switching this to always show up on first run.

Biplab

Quote from: oBFusCATed on March 23, 2013, 03:46:51 AM
Yes, disable the spellcheck plugin or install some dictionaries.

http://wiki.codeblocks.org/index.php?title=SpellChecker_plugin

@dev:
1. Probably we should do something about this problem?
2. Disable spellcheck by default?
3. Provide dictionaries?
4. Don't highlight anything if there is no dictionary?

It seems that 4 is the best option...

Disable this plugin by default. Those who need it will enable it. It is unnecessary to force it to users.
Be a part of the solution, not a part of the problem.

Alpha

Attached is my recommended solution.

ptDev

#9
In my installer, I modified SpellChecker so that US English is the default. I also make the installation of en-US compulsory if SpellChecker happens to be installed.

This avoids the aforementioned problems.

Lqwertz80

Thank you for all your answers!
In first time I've disable dictionnary => Ok!
In seconde time I downloaded the correct dictionnary and any is correct.

Regards and thanks!

oBFusCATed

Quote from: jens on March 23, 2013, 04:21:20 PM
People should learn to read !!
Haven't you learned already that they won't do it. There is another new topic about the same thing.
Probably if we switch to a mailing list the thing will get better, but a forum is too easy to subscribe :)

How hard would it be to recreate the installer for windows with the spellchecker disabled by default?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Alpha

Quote from: oBFusCATed on March 24, 2013, 11:26:19 PM
How hard would it be to recreate the installer for windows with the spellchecker disabled by default?
I think it would be in our best interest to rebuild the windows installer (if that is not too much work), as it seems this problem has come up from multiple users.  The simplest change would be to just disable it.  I prefer the changes from my patch -> add an enable/disable indicator, insure it is only activated if a valid dictionary is selected, first run default: English (US).  (But of course I would prefer my changes ;), otherwise why would I write them?)
I guess it would be up to whoever repackages (assuming we do) as to what changes are made.

oBFusCATed

Quote from: oBFusCATed on March 24, 2013, 11:26:19 PM
How hard would it be to recreate the installer for windows with the spellchecker disabled by default?
Another option is to put a big red message on the download page about the problem :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Alpha

Quote from: oBFusCATed on March 25, 2013, 09:16:47 AM
Another option is to put a big red message on the download page about the problem :)
... And underline the message with a red squiggly line ;).