Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mbrotz opened this issue Nov 28, 2024 · 4 comments
Open

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

mbrotz opened this issue Nov 28, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@mbrotz
Copy link

mbrotz commented Nov 28, 2024

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

@mbrotz mbrotz added the bug Something isn't working label Nov 28, 2024
@SableRaf
Copy link
Collaborator

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
Copy link
Collaborator

If I remember correctly those are the breakpoints see #330

@mbrotz
Copy link
Author

mbrotz commented Nov 30, 2024

@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
Copy link
Author

mbrotz commented Dec 3, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants