Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » formatter doesn't remove empty lines
formatter doesn't remove empty lines [message #933741] Fri, 05 October 2012 09:49 Go to next message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Hi!

If I use setLineWrap(1) and there are already n lines present, they are not reduced to 1, but there will be n+1.

Consequently, when I press Ctrl-F several times in a row, then an empty line is added every time.

The same thing happens if I use setSpace("\n"): new lines just get added.

Is this how it's meant to be, or am I using it wrong?

best regards,
Vlad
Re: formatter doesn't remove empty lines [message #935236 is a reply to message #933741] Sat, 06 October 2012 21:04 Go to previous messageGo to next message
Boris Brodski is currently offline Boris BrodskiFriend
Messages: 112
Registered: July 2009
Senior Member
Hello Vlad,


I recommend to use the setLineWrap version with 3 parameters:

public LinewrapLocator setLinewrap(int minWraps, int defaultWraps, int maxWraps)


Here you can set the minimal allowed count of lines, default count of lines and maximal allowed count of lines.
If the maximal allowed count of line overtaken, the formatter will remove some empty lines to reduce the count of it to the maximum value.


Regards,
Boris
Re: formatter doesn't remove empty lines [message #935931 is a reply to message #935236] Sun, 07 October 2012 13:33 Go to previous message
Vlad Dumitrescu is currently offline Vlad DumitrescuFriend
Messages: 431
Registered: July 2009
Location: Gothenburg
Senior Member
Hi Boris,

Of course I tried that too, and anyway, setLinewrap() just calls setLineWrap(1) which just calls setLineWrap(1,1,1).

After some digging, it looks like the problem appeared because of a terminal that was a little weird (could end with non-ignored whitespace). Removing that fixed it.

regards,
Vlad
Previous Topic:idea for xbase crib sheet.
Next Topic:Exporting Parser+Generator as standalone jar file
Goto Forum:
  


Current Time: Tue Apr 16 03:56:52 GMT 2024

Powered by FUDForum. Page generated in 0.24165 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top