Code::Blocks Forums

User forums => Help => Topic started by: SimbaSpirit on October 19, 2008, 05:52:21 pm

Title: How do I incorporate '\n' into an abbreviation?
Post by: SimbaSpirit on October 19, 2008, 05:52:21 pm
I'm trying to make this abbreviation
cini (ctrl+j) = cin.ignore( numeric_limits <streamsize> ::max(), '\n' );

However, whenever I save my work, shut down the program, then reopen it I get
cini (ctrl+j) =
cin.ignore( numeric_limits <streamsize> ::max(), '
' );


How do I get C::B to actually insert the \n instead of evaluating it?
Title: Re: How do I incorporate '\n' into an abbreviation?
Post by: MortenMacFly on October 19, 2008, 07:55:16 pm
cini (ctrl+j) = cin.ignore( numeric_limits <streamsize> ::max(), '\n' );
I guess you already tried escaping - alias '\\n'???
Title: Re: How do I incorporate '\n' into an abbreviation?
Post by: SimbaSpirit on October 20, 2008, 02:25:19 am
Yeah I should have made another post saying I already tried that.

cin.ignore( numeric_limits <streamsize> ::max(), '\\n' );

becomes

cin.ignore( numeric_limits <streamsize> ::max(), '\
' );

At the moment I have replaced the n with a pipe, but this workaround would be a real pain in a larger template
Title: Re: How do I incorporate '\n' into an abbreviation?
Post by: SimbaSpirit on October 20, 2008, 06:16:19 am
Has anyone else made this work before?
Any other ideas?
Title: Re: How do I incorporate '\n' into an abbreviation?
Post by: SimbaSpirit on October 22, 2008, 04:44:32 am
Bump
Title: Re: How do I incorporate '\n' into an abbreviation?
Post by: MortenMacFly on October 22, 2008, 02:42:53 pm
Bump
I already had a look into and might have found the reason. I just don't have time for this now, but I am aware of the issue. Anyways: Please file a bug report at BerliOS so it does not get lost.