processing / processing4

Processing is a flexible software sketchbook and a language for learning how to code.
https://processing.org
Other
23 stars 6 forks source link

Processing randomly inserts the characters '//<>//' into .pde files. #863

Open mbrotz opened 6 days ago

mbrotz commented 6 days ago

Most appropriate sub-area of Processing 4?

PDE

Processing version

4.3 / 4.3.1

Operating system

Windows/macOS

Steps to reproduce this

When i modify and save a file in processing it will randomly append the characters '//<>//' (without quotes) to random lines. These characters don't show up in the processing editor, but git detects them as modifications. They display normally in other text editors. I can remove these characters in a different text editor, but as soon as i modify and save the files in processing, the characters appear again. Sometimes on different lines, sometimes on the same lines. Some lines have multiple instances of these characters added. Over time more and more instances appear throughout my project.

What's going on there? Is this normal behaviour? How can i get rid of it?

I don't know if there is a way to reproduce it. I have removed all tools and libraries from my processing installation but it still happens.

Manuel Brotz

snippet

No response

Additional context

No response

SableRaf commented 5 days ago

Could you share a minimal example that causes the behavior in question? Ideally a public git repository on GitHub.

I'm unable to reproduce the issue. Here's why I have tried:

Steps

  1. Open VSCode
  2. Create a new folder
  3. Run git init
  4. Create a .pde file with a minimal sketch and save it
  5. Run git add -a and git commit -m "initial commit"
  6. Open the .pde file in Processing 4.3.1
  7. Make modifications and save the sketch
  8. Run git diff

Observation

No //<>// were added to the sketch.

Operating system

macOS 13.4 (22F66)

Stefterv commented 5 days ago

If I remember correctly those are the breakpoints see https://github.com/processing/processing4/issues/330

mbrotz commented 3 days ago

@Stefterv Thanks for the info!

@SableRaf I was able to confirm that these comments show up when you add breakpoints to the lines. But in a new project i cannot reproduce the behavior where processing randomly adds more and more of the comments to the codebase.

The snippet below is a git diff. It shows several lines with multiple instances of those markers added. In this case processing actually removed one instance from the lines, but several still remain on the same line.

No idea whats going on. I will try to explicitly disable all breakpoints to see what processing will do.

public void update() {
 -    final double positiveValue = clampDouble(Math.abs(positiveOutput.get()) - 0.5d, 0.0d, 0.5d);
 -    final double negativeValue = clampDouble(Math.abs(negativeOutput.get()) - 0.5d, 0.0d, 0.5d);
 -    final double signedValue = (positiveValue - negativeValue) * 2.0d;
 +    final double positiveValue = clampDouble(Math.abs(positiveOutput.get()) - Threshold, 0.0d, Remainder);
 +    final double negativeValue = clampDouble(Math.abs(negativeOutput.get()) - Threshold, 0.0d, Remainder);
 +    final double signedValue = positiveValue - negativeValue;
     if (Math.abs(signedValue) > threshold) {
       abs = 1.0d;
       sign = signedValue < 0.0d ? -1.0d : 1.0d;
@@ -370,10 +373,10 @@ public static abstract class AbstractComponents extends Abst
     Check.notNull(phase, "phase");
     return phases[phase.ordinal()].size();
   }
 -
 + //<>//
   public final int getInputSize() {
     return inputNodes.size();
 -  } //<>// //<>// //<>// //<>//
 +  } //<>// //<>// //<>//
  //<>// //<>//
   public final int getOutputSize() {
     return outputNodes.size();
@@ -402,10 +405,10 @@ public static abstract class AbstractComponents extends Abst
   }

   public final boolean outputUpdate() {
 -    return update(Phase.PreOutput) && update(Phase.Output) && update(Phase.PostOutput);
 +    return update(Phase.PreOutput) && update(Phase.Output) && update(Phase.PostOutput); //<>//
   }

 -  public final boolean update(final Phase phase) { //<>// //<>// //<>// //<>//
 +  public final boolean update(final Phase phase) { //<>// //<>// //<>//
     Check.notNull(phase, "phase"); //<>// //<>//
     for (final Component component : phases[phase.ordinal()])
       phase.update(component);
@@ -519,10 +522,10 @@ public static abstract class Component extends AbstractSimOb
     return outputNodes.get(index);
   }
mbrotz commented 1 day ago

I manually disabled all breakpoints in the processing ide, quit the ide and then removed all the remaining markers in another editor. Since then the markers did not reappear. I don't know yet if the buggy behavior reappears if a add new breakpoints.