Author Topic: Auto-Completion (Ctrl-J) not substituting \n and \t  (Read 6227 times)

Offline a1fred0

  • Single posting newcomer
  • *
  • Posts: 3
Auto-Completion (Ctrl-J) not substituting \n and \t
« on: August 23, 2010, 10:26:17 am »
Just built CB and wxWidgets(2.8.11) from source - svn build rev 6502 (2010-08-20 06:00:37) gcc 4.4.1 Windows/unicode - 32 bit

Auto completion is not substituting \n and \t correctly:

e.g. Type forb -> hit Ctrl-J output is: for ( ; ; )\n{\n\t\n}

I searched forums and can find no mention, however, there is an open bug report #017416 that looks the same issue.
On debugger it seems to me that stepping
Code
code.Replace(_T("\n"), _T('\n') + lineIndent);
in cbEditor::AutoComplete() has no effect on contents of 'code'

Can anyone confirm they see the same issue?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Auto-Completion (Ctrl-J) not substituting \n and \t
« Reply #1 on: August 23, 2010, 03:02:37 pm »
e.g. Type forb -> hit Ctrl-J output is: for ( ; ; )\n{\n\t\n}
It's not a bug, it's a mistake in the tempates. Open the abbreviations, change the templates to have true \n \r and it'll work.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline a1fred0

  • Single posting newcomer
  • *
  • Posts: 3
Re: Auto-Completion (Ctrl-J) not substituting \n and \t
« Reply #2 on: August 23, 2010, 03:57:26 pm »
Excellent!! - changed the templates to real newlines as suggested.  Working perfectly. :-)