pharo icon indicating copy to clipboard operation
pharo copied to clipboard

Cmp-P (PrintIt) in the comment tab of a class just flashes without showing a result

Open macta opened this issue 1 year ago • 2 comments

Bug description In the comment tab of a class, if you have a line of code and position the cursor at the end of the line and press cmd-p you don't see a result - just a black flash and no output.

To Reproduce Steps to reproduce the behavior:

  1. Put a comment in a class tab like: Date now.
  2. Save the comment but then edit it again (not sure I like way comments work anymore - having to edit them to use them like a playground feels clunky)
  3. Place cursor after the "." and press cmd-p
  4. The line flashes but no output is shown

Expected behavior Should get a popup panel showing the result of evaluation

Screenshots n/a

Version information:

  • OS: OSX
  • Version: [e.g. 1.6.1]
  • Pharo Version - P12 downloaded 25/Apr

Expected development cost unsure

Additional context This works fine on P11.

If you hilite the text to evaluate - it works fine (its just the shortcut that evaluates a whole line without selection that doens't work). If there is a syntax error in the code - it doesn't show the error, so I don't think its even trying to evaluate it properly

Further testing shows this actually only happens if there is a single line of text in the comment. If multiple lines present then it works fine.

macta avatar Apr 25 '24 20:04 macta

Hi @macta

I'm using P13 here. and trying to better understand the issue. When I see a class comment, and click there, there is no cursor for me so it isn't clear what would be evaluated unless you select the code. And if I hit cmd+p then nothing happens. I understood is because it is a read-only presenter then printing a value would need to modify-it (so it should be editable enabling the edit mode?).

If I hit cmd-i then the inspector is opened as usual:

Screenshot 2024-05-24 at 11 43 10

So the issue is about requesting to make the comment editable when hitting cmd-p?

I couldn't reproduce the flash in P13.

hernanmd avatar May 24 '24 09:05 hernanmd

Hi - while it would be great to evaluate code without having to edit (I'm not sure the read only mode of comments is that helpful) I am talking about what happens when you go into edit mode (so you can evaluate code).

HOWEVER the additional context comment has an important note - I later noticed that this only a problem if you have a single line of text in the comment (multiple lines work fine) e.g.

This one works: image

This one doesn't and shows a flash: image

Interesting that even a blank line above it shows the same problem (so its not just a single line). Even putting a comment above it has the same error.

image

macta avatar May 25 '24 09:05 macta