Extra text in cell after evaluation

2 views
Skip to first unread message

Rob Beezer

unread,
Nov 24, 2009, 10:28:18 PM11/24/09
to sage-n...@googlegroups.com
I noticed this morning at work (in class), and tonight at home, that with a
shift-enter to evaluate a cell, I'm getting an extra deposit of text. Doesn't
happen when I click the "evaluate" link. Screen shot shows "div" appended to
input after the evaluation every place I used shift-enter, and no addition the
one place I used "evaluate."

The extra text is not always "div" - just a minute ago it was "http:" (maybe
with // too?) but I can't seem to reproduce that.

sagenb.org in both cases, Firefox 3.0.13 on Ubuntu tonight, probably an earlier
version this morning, and on Windows this morning.

Rob
nb-extra-text.png

Pat LeSmithe

unread,
Nov 24, 2009, 10:44:57 PM11/24/09
to sage-n...@googlegroups.com
I've noticed this, too, on 64-bit Fedora 11-ish Linux, in

Firefox 3.5.5
Chromium 4.0.253.0
Opera 10.01

Introspection seems to trigger the problem. I tried entering

graphs.<TAB>

in a cell, selecting an item, adding "()", and keying "shift-enter".
The extraneous text in this case is "graphs."

Are there other triggers?

Rob Beezer

unread,
Nov 24, 2009, 11:23:33 PM11/24/09
to sage-notebook
Thanks, Pat - good to know its not just me. ;-)

On Nov 24, 7:44 pm, Pat LeSmithe <qed...@gmail.com> wrote:
> Are there other triggers?

I open an existing worksheet by clicking on it in the list, then shift-
enter on the first cell (with a command already in place) and I get
"http:/" appended.

Shift-enter on subsequent cells appends "http:/"

Once I click on "evaluate" the behavior seems to stop (ie no ill
effects from a "shift-enter"). This is in contrast to a new worksheet
where an intermediate "evaluate"-click doesn't seem to stop it.

This is very similar to Pat's example, but slightly different, and
reproducible for me:

1. H is an existing, defined permutation group
2. H.o <tab>
3. Arrow to the "order" method, <enter>
4. Type (), then <shift-enter>

Evaluates correctly, but cell contains "H.order()H.order()"
afterwards.

OR

Open a new worksheet, use <shift-enter> to run 2+2. Get a "div" on
the end. Edit the div away, place cursor in the middle of 2+2, <shift-
enter> and a "div" appears again but now at the location of the
cursor. So text is being inserted at the cursor, rather than being
appended?

This would pretty much seem to exhibit the range of behavior I saw
this morning, though I can't be at all sure of what I was seeing,
since I was more concerned with just editing stuff away as I re-ran
commands.

Rob

Pat LeSmithe

unread,
Nov 25, 2009, 3:03:25 AM11/25/09
to sage-n...@googlegroups.com
On 11/24/2009 08:23 PM, Rob Beezer wrote:
> On Nov 24, 7:44 pm, Pat LeSmithe <qed...@gmail.com> wrote:
>> Are there other triggers?
>
> I open an existing worksheet by clicking on it in the list, then shift-
> enter on the first cell (with a command already in place) and I get
> "http:/" appended.
>
> Shift-enter on subsequent cells appends "http:/"
>
> Once I click on "evaluate" the behavior seems to stop (ie no ill
> effects from a "shift-enter"). This is in contrast to a new worksheet
> where an intermediate "evaluate"-click doesn't seem to stop it.
>
> This is very similar to Pat's example, but slightly different, and
> reproducible for me:
>
> 1. H is an existing, defined permutation group
> 2. H.o <tab>
> 3. Arrow to the "order" method, <enter>
> 4. Type (), then <shift-enter>
>
> Evaluates correctly, but cell contains "H.order()H.order()"
> afterwards.
>
> OR
>
> Open a new worksheet, use <shift-enter> to run 2+2. Get a "div" on
> the end. Edit the div away, place cursor in the middle of 2+2, <shift-
> enter> and a "div" appears again but now at the location of the
> cursor. So text is being inserted at the cursor, rather than being
> appended?

Thanks very much for the examples.

It seems that whether the unwanted text shows up depends on how quickly
shift-enter is (un)pressed.

I think the problem is in or related to the input_keyup function in

sagenb/data/sage/js/notebook_lib.js

(see around line 820). In particular, inserting

return;

just before

// automatic indentation

appears to "solve" it.

William Stein

unread,
Dec 9, 2009, 8:11:11 PM12/9/09
to sage-n...@googlegroups.com, Tom Boothby
Hi Guys,

Did a ticket ever get posted? Did this ever get solved? This
change (that you suggest above) is *not* in sagenb-0.4.6, which is
about to be released (since obviously your "fix" is to disable
automatic indentation):

http://sage.math.washington.edu/home/wstein/patches/sagenb/sagenb-0.4.6.spkg

At Sage Days 18 during the talks this exact problem suddenly kept
happening a lot to *everybody*, it seemed. However, since I left
Sage Days I haven't seen it once myself. What's going on?

I'm cc'ing Tom, since the relevant code you think you tracked it to is by him.

William
Reply all
Reply to author
Forward
0 new messages