Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Appending a newline to a Document
Appending a newline to a Document [message #250252] Mon, 07 June 2004 20:18 Go to next message
Del Myers is currently offline Del MyersFriend
Messages: 69
Registered: July 2009
Member
Hi,

I'm working on a little view that receives text messages and appends them to
the end of a document. I have no trouble getting regular strings to append
using document.replace(document.getLength(), 0, text) except if the text
begins or ends with a newline character. If the text starts with a newline,
then the document gets cleared. If it ends with a newline, no subsequent
messages will be logged in the view.

I would like the messages to be able to start and end with newlines so that
the text doesn't run in one big, long string. I'm using 3.0 M9. Does anyone
have any ideas?

Del.
Re: Appending a newline to a Document [message #250397 is a reply to message #250252] Tue, 08 June 2004 10:20 Go to previous messageGo to next message
Tom Hofmann is currently offline Tom HofmannFriend
Messages: 770
Registered: July 2009
Senior Member
What you do should work. What are the document contents (document.get())
after a replace that does not work? Is document content wrong, or is it
just what is being displayed in your view?

If you don't find out what's wrong, you should file a bug report against
platform-text.

-t

Del wrote:
> Hi,
>
> I'm working on a little view that receives text messages and appends them to
> the end of a document. I have no trouble getting regular strings to append
> using document.replace(document.getLength(), 0, text) except if the text
> begins or ends with a newline character. If the text starts with a newline,
> then the document gets cleared. If it ends with a newline, no subsequent
> messages will be logged in the view.
>
> I would like the messages to be able to start and end with newlines so that
> the text doesn't run in one big, long string. I'm using 3.0 M9. Does anyone
> have any ideas?
>
> Del.
>
>
Re: Appending a newline to a Document [message #250558 is a reply to message #250397] Tue, 08 June 2004 16:09 Go to previous message
Del Myers is currently offline Del MyersFriend
Messages: 69
Registered: July 2009
Member
I just figured it out, thanks.

The document.get() showed the right information, so the content was right.
There was a problem with the view. I played around with the SWT style for a
little while and everything was fine.

Del


"Tom Eicher" <eclipse@tom.eicher.name> wrote in message
news:ca43e9$kfu$1@eclipse.org...
> What you do should work. What are the document contents (document.get())
> after a replace that does not work? Is document content wrong, or is it
> just what is being displayed in your view?
>
> If you don't find out what's wrong, you should file a bug report against
> platform-text.
>
> -t
>
> Del wrote:
> > Hi,
> >
> > I'm working on a little view that receives text messages and appends
them to
> > the end of a document. I have no trouble getting regular strings to
append
> > using document.replace(document.getLength(), 0, text) except if the text
> > begins or ends with a newline character. If the text starts with a
newline,
> > then the document gets cleared. If it ends with a newline, no subsequent
> > messages will be logged in the view.
> >
> > I would like the messages to be able to start and end with newlines so
that
> > the text doesn't run in one big, long string. I'm using 3.0 M9. Does
anyone
> > have any ideas?
> >
> > Del.
> >
> >
Previous Topic:Plugins not loaded
Next Topic:What happened to the JFace content-assist lightbulb decoration in M8?
Goto Forum:
  


Current Time: Tue Nov 12 19:50:49 GMT 2024

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

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

Back to the top