13

How do I turn off the "spell-checker like" feature in CodeBlocks on windows?

I also just now realized that if I add a "\" (back-slash) to the end of my comment, the next line if code is also commented. Has this always been standard for c++?

enter image description here

9
  • 5
    Yes, the backslash at the end of the line continues it on the next line. You should be able to go Plugins->Manage Plugins...->SpellChecker->Disable for the red lines.
    – chris
    Jan 10, 2013 at 22:44
  • that spell checker can be pretty useful, actually. Any specific reason why you'd like to turn it off, just out of curiosity? Jan 10, 2013 at 22:46
  • @BartekBanachewicz, It's caught a few mistakes I've had, but I have to give the OP that it is pretty annoying sometimes.
    – chris
    Jan 10, 2013 at 22:46
  • @RiaD, I'm not sure what's up with that. Mine doesn't highlight any for the exact same code, though I have seen it become pretty bad.
    – chris
    Jan 10, 2013 at 22:48
  • I suppose it might be beneficial since I am still learning, but I was hoping that I could turn it off for comments only. It is making longer comments harder to read.
    – Leonardo
    Jan 10, 2013 at 22:48

4 Answers 4

16

Mine was underlining all my comments and strings, too. Turns out when I downloaded codeblocks, the language wasn't set to English. If you look in the bottom right corner of the codeblocks window, there is a little flag. You can right click it and select the correct language. Hope this helps!

2
  • 3
    And to add words to the dictionary, you can right-click on the word and select "Spelling suggestions for '<word>'" followed by "Add '<word>' to dictionary". (Also, +1 because, while not specifically addressing either of the OP's questions, this is possibly the most useful answer.) Apr 14, 2013 at 17:08
  • 1
    It seems to me that this should be the accepted solution since disabling a feature is just working around it, rather than solving it.
    – KeyszerS
    Dec 17, 2013 at 13:50
14
  1. Open Code::Blocks.
  2. Go to plugins -> Manage Plugins
  3. Select Spell Checker and disable it.
1

Has this always been standard for c++?

Well, rather for the C preprocessor (which C++ uses exhaustively). Yes, it's a documented feature: the backslash-newline sequence acts as a line continuation marker (i. e., the backslash "invalidates", escapes the newline, effectively making the preprocessor treat the consecutive lines separated by backslashes as one line).

3
  • I'd also add that it even makes sense! (which is funny, since it's C) Since all special chars are preceeded by \ , \ before newline seems natural. Jan 10, 2013 at 22:50
  • 1
    @BartekBanachewicz Yes, quite. I don't agree with the sarcastic part, though :P C is one of the most logical languages, IMO.
    – user529758
    Jan 10, 2013 at 22:51
  • True, it does make sense given that you understand the preprocessor treats each character including newline as a single element of a character array. Whereas entering \\n in a string literal would evaluate to two characters \n.
    – Leonardo
    Jan 10, 2013 at 22:57
1

The falsely underlined words, might be caused by not having a dictionary selected. This is how I fixed it.

Click Settings->Editor->Spell Checker(on left of dialog) then under Language select a dictionary in the drop down.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.