Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Code folding artifacts in some cases (repeated fold line) #16078

Open

Description

Edit by @rsese to clean up issue body and add latest details

Prerequisites

Description

There have been a number of reports of duplicated code fold lines since around Atom 1.21.2 but with some trouble coming up with specific steps to reproduce (e.g. no specific common community packages though a couple of folks mentioned it happened commonly for them in large files).

In #16078 (comment) we did get specific reproduction steps though.

Steps to Reproduce

via elpollodiablo84/language-matlab-plus#1 (comment) h/t @elpollodiablo84 (I couldn't reproduce with other packages installed so ended up temporarily resetting to factory defaults first):

  1. apm install language-matlab-plus
  2. Save and open https://github.com/elpollodiablo84/language-matlab-plus/blob/ffba8d71775e392b68882876bd877fb8f78206f8/test/test2.m
  3. atom test2.m
  4. Fold the function new_fun
  5. Fold the function secondaryFunction.
  6. Unfold secondaryFunction

Expected behavior: [What you expect to happen]

secondaryFunction function unfolds with no effect on the folded new_fun function.

Actual behavior: [What actually happens]

The first line of the folded new_fun will duplicate each time you fold/unfold secondaryFunction.

fold-dupe

GIF-age:

fold-dupe

Reproduces how often: [What percentage of the time does it reproduce?]

100%

Versions

Atom 1.30.0 and 1.32.0-nightly11.

macOS 10.12.6

Additional Information

Additional comments from elpollodiablo84/language-matlab-plus#1 (comment) related to language-matlab-plus:

The issue disappears in the following cases:

  • Disabling the decoration of persistent variables, commenting the line in ../lib/main.js:
    editor.decorateMarker(marker, {type: 'text', class: 'variable-persistent'});
  • Changing the type of the decoration in the previous line (Ex: highlight or line).
  • Disabling the function scope check , commenting functionNames.includes(v[0]) out of its if block.

Edited by @rsese to consolidate description in the issue body

Atom Version 1.21.2 latest
Mac Sierra 10.12.6, NVIDIA GeForce GT 750M 2048 MB, 2.5 GHz Intel Core i7, 16 GB 1600 MHz DDR3
Does not reproduce in safe mode (no linting)
Atom Core (editor)
intermittent behavior


If I Show Invisibles I cannot reproduce. It seems to be a specific file. I cannot find any invisible item.


if you fold all functions, if you make an error typing functions show up multiple times on the same line.
i.e. someFunc(){ = someFunc(){ = someFunc() { = where = is the marker that the function is folded


screen shot 2017-11-02 at 4 04 48 pm

This time it occurred by simply flicking the scroll up and down quickly. Mac, magic mouse.

I seems to be a redraw issue. If you scroll to where all of the folded functions are out of view, when scrolling them back into view they return to normal.


This is difficult to reproduce. I am linting and sometimes if I add a space after a }, wait for it to lint and error, then backspace and remove the space it will happen. It is very intermittent. Latest version of atom, editing react javascript jsx files, with linting.

Activity

  1. rsese commented on Nov 2, 2017

    @rsese
    Contributor

    Thanks for reaching out!

    Can you update the issue body to use the issue template? The information is super helpful and gives us a lot of basic information to help us investigate e.g. it asks what version of Atom you're running, what operating system + version you're running, does the behavior reproduce in safe mode, what are the exact steps to reproduce the behavior (as much detail as possible in the repro steps would be great), etc.

    A screencast/GIF of the behavior could be helpful too.


    We require the template to be filled out on all new issues and pull requests so if you can open a new issue with the template filled out, that would be helpful for us. We do this so that we can be certain we have all the information we need to address your submission efficiently. This allows the maintainers to spend more time fixing bugs, implementing enhancements, and reviewing and merging pull requests.

    Thanks for understanding and meeting us half way 😀

  2. ghost closed this as completedon Nov 3, 2017
  3. reopened this on Dec 6, 2017
  4. pbarbiero commented on Jan 2, 2018

    @pbarbiero

    I have also experienced this in the last couple atom versions. I didnt report it because I thought it to be a duplicate of #16289 but it clearly is not.

    Currently reproducing on Atom 1.23.1 x64 in Windows 10, although its rare and difficult.

    Its possible it could be related to other addons however, such as linter-ui and/or atom-prettier.

  5. ghost closed this as completedon Feb 12, 2018
  6. pbarbiero commented on Feb 12, 2018

    @pbarbiero

    @BountifulClutter I get this without using linter-csslint 2.0.0 -- I think this should be reopened.

  7. 12 remaining items

  8. rsese commented on Sep 14, 2018

    @rsese
    Contributor

    Thanks @elpollodiablo84 - with the repro steps in elpollodiablo84/language-matlab-plus#1 (comment) on macOS 10.12.6 and language-matlab-plus as the only installed community package, I can reproduce the duplicated folds. Can also reproduce on 1.32.0-nightly9.

    I'll update the issue body with these details.

  9. changed the title [-]Code Folding[/-] [+]Code folding artifacts in some cases (repeated fold line)[/+] on Sep 17, 2018
  10. nathansobo commented on Apr 18, 2019

    @nathansobo
    Contributor

    @rsese Just wanted to note that @Ben3eeE reached out to me about this one. I'd like to evaluate prioritizing it in our next meeting.

  11. rsese commented on Apr 19, 2019

    @rsese
    Contributor

    Added for discussion 👍

  12. doutatsu commented on Feb 4, 2021

    @doutatsu

    Is there any progress on this bug? I've been seeing this issue for over a year now...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions