Keep print-it output on the same line in GTPlayground

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Keep print-it output on the same line in GTPlayground

Peter Uhnak
Hi,

currently when you print the last statement in the playground and press enter (to insert the comment into the playground) it outputs it after, which is good.

However if I then go back and evaluate a line above, it places the output on the _next_ line, just before the next statement, which is quite annoying.





Can this be changed, so it keeps it in line like this?



Thanks,
Peter
Reply | Threaded
Open this post in threaded view
|

Re: Keep print-it output on the same line in GTPlayground

Pavel Krivanek-3
Andrei, 

what is the reason for placing print-it result alway at the end of line?
See atEndOfLineInsertAndSelect:.

Cheers,
-- Pavel


2016-05-03 9:27 GMT+02:00 Peter Uhnák <[hidden email]>:
Hi,

currently when you print the last statement in the playground and press enter (to insert the comment into the playground) it outputs it after, which is good.

However if I then go back and evaluate a line above, it places the output on the _next_ line, just before the next statement, which is quite annoying.





Can this be changed, so it keeps it in line like this?



Thanks,
Peter

Reply | Threaded
Open this post in threaded view
|

Re: Keep print-it output on the same line in GTPlayground

Pavel Krivanek-3
ehm, always

2016-05-03 9:44 GMT+02:00 Pavel Krivanek <[hidden email]>:
Andrei, 

what is the reason for placing print-it result alway at the end of line?
See atEndOfLineInsertAndSelect:.

Cheers,
-- Pavel


2016-05-03 9:27 GMT+02:00 Peter Uhnák <[hidden email]>:
Hi,

currently when you print the last statement in the playground and press enter (to insert the comment into the playground) it outputs it after, which is good.

However if I then go back and evaluate a line above, it places the output on the _next_ line, just before the next statement, which is quite annoying.





Can this be changed, so it keeps it in line like this?



Thanks,
Peter


Reply | Threaded
Open this post in threaded view
|

Re: Keep print-it output on the same line in GTPlayground

Andrei Chis
In reply to this post by Pavel Krivanek-3
Hi Pavel,

From what I remember there were some discussions last year when we added this feature and the conclusion was to print the result on the next line.
Maybe we can find a better heuristic for placing the result.

Cheers,
Andrei

On Tue, May 3, 2016 at 9:44 AM, Pavel Krivanek <[hidden email]> wrote:
Andrei, 

what is the reason for placing print-it result alway at the end of line?
See atEndOfLineInsertAndSelect:.

Cheers,
-- Pavel


2016-05-03 9:27 GMT+02:00 Peter Uhnák <[hidden email]>:
Hi,

currently when you print the last statement in the playground and press enter (to insert the comment into the playground) it outputs it after, which is good.

However if I then go back and evaluate a line above, it places the output on the _next_ line, just before the next statement, which is quite annoying.





Can this be changed, so it keeps it in line like this?



Thanks,
Peter


Reply | Threaded
Open this post in threaded view
|

Re: Keep print-it output on the same line in GTPlayground

Peter Uhnak
the conclusion was to print the result on the next line.

Well this isn't true for the last line.

The problem isn't just that it prints on the next line for the intermediate results, but that it puts it before the next content.
Even if it was on a line of it's own it would be much better.

Peter
Reply | Threaded
Open this post in threaded view
|

Re: Keep print-it output on the same line in GTPlayground

Andrei Chis


On Tue, May 3, 2016 at 10:26 AM, Peter Uhnák <[hidden email]> wrote:
the conclusion was to print the result on the next line.

Well this isn't true for the last line.

Yes, right now it only inserts it on the new line if there is a line.
 

The problem isn't just that it prints on the next line for the intermediate results, but that it puts it before the next content.
Even if it was on a line of it's own it would be much better.

We could change it to always insert a new line and add the printed content to that line. 
But should it add an extra line if there already exists an empty line bellow?

Andrei
 

Peter

Reply | Threaded
Open this post in threaded view
|

Re: Keep print-it output on the same line in GTPlayground

Nicolai Hess-3-2


2016-05-03 13:26 GMT+02:00 Andrei Chis <[hidden email]>:


On Tue, May 3, 2016 at 10:26 AM, Peter Uhnák <[hidden email]> wrote:
the conclusion was to print the result on the next line.

Well this isn't true for the last line.

Yes, right now it only inserts it on the new line if there is a line.
 

The problem isn't just that it prints on the next line for the intermediate results, but that it puts it before the next content.
Even if it was on a line of it's own it would be much better.

We could change it to always insert a new line and add the printed content to that line. 
But should it add an extra line if there already exists an empty line bellow?

I would change it to "always print on the same line"
 

Andrei
 

Peter


Reply | Threaded
Open this post in threaded view
|

Re: Keep print-it output on the same line in GTPlayground

Peter Uhnak


On Tue, May 3, 2016 at 1:56 PM, Nicolai Hess <[hidden email]> wrote:


2016-05-03 13:26 GMT+02:00 Andrei Chis <[hidden email]>:


On Tue, May 3, 2016 at 10:26 AM, Peter Uhnák <[hidden email]> wrote:
the conclusion was to print the result on the next line.

Well this isn't true for the last line.

Yes, right now it only inserts it on the new line if there is a line.
 

The problem isn't just that it prints on the next line for the intermediate results, but that it puts it before the next content.
Even if it was on a line of it's own it would be much better.

We could change it to always insert a new line and add the printed content to that line. 
But should it add an extra line if there already exists an empty line bellow?

I would change it to "always print on the same line"

+1
Reply | Threaded
Open this post in threaded view
|

Re: Keep print-it output on the same line in GTPlayground

Denis Kudriashov
+1

2016-05-03 14:41 GMT+02:00 Peter Uhnák <[hidden email]>:


On Tue, May 3, 2016 at 1:56 PM, Nicolai Hess <[hidden email]> wrote:


2016-05-03 13:26 GMT+02:00 Andrei Chis <[hidden email]>:


On Tue, May 3, 2016 at 10:26 AM, Peter Uhnák <[hidden email]> wrote:
the conclusion was to print the result on the next line.

Well this isn't true for the last line.

Yes, right now it only inserts it on the new line if there is a line.
 

The problem isn't just that it prints on the next line for the intermediate results, but that it puts it before the next content.
Even if it was on a line of it's own it would be much better.

We could change it to always insert a new line and add the printed content to that line. 
But should it add an extra line if there already exists an empty line bellow?

I would change it to "always print on the same line"

+1

Reply | Threaded
Open this post in threaded view
|

Re: Keep print-it output on the same line in GTPlayground

Peter Uhnak
Since I didn't want to wait, for now I've fixed it (for myself) by changing it to

RubTextEditor>>atEndOfLineInsertAndSelect: aString
| last lastChar |
last := (self encompassParagraph: self selectionInterval) last.
(self textArea text at: last) = Character cr
ifFalse: [ last := last + 1 ].
self insertAndSelect: aString at: last

On Tue, May 3, 2016 at 3:05 PM, Denis Kudriashov <[hidden email]> wrote:
+1

2016-05-03 14:41 GMT+02:00 Peter Uhnák <[hidden email]>:


On Tue, May 3, 2016 at 1:56 PM, Nicolai Hess <[hidden email]> wrote:


2016-05-03 13:26 GMT+02:00 Andrei Chis <[hidden email]>:


On Tue, May 3, 2016 at 10:26 AM, Peter Uhnák <[hidden email]> wrote:
the conclusion was to print the result on the next line.

Well this isn't true for the last line.

Yes, right now it only inserts it on the new line if there is a line.
 

The problem isn't just that it prints on the next line for the intermediate results, but that it puts it before the next content.
Even if it was on a line of it's own it would be much better.

We could change it to always insert a new line and add the printed content to that line. 
But should it add an extra line if there already exists an empty line bellow?

I would change it to "always print on the same line"

+1