Skip to content

Add rainbow colors and highlighting for markdown files in the source editor #7793

Open

Description

@ronblum

System details

RStudio Edition : Desktop & Server
RStudio Version : 1.4.804-1
OS Version      : MacOS 10.15.6 & Red Hat 8.2
R Version       : 4.0.2

Steps to reproduce the problem

Create a Markdown file (not R Markdown) with the following chunk:

```{r rainbow}
([{([{}])}])
```

Describe the problem in detail

In source mode for a Markdown file (not R Markdown), rainbow parens aren’t used. However, when switching to visual mode, rainbow parens are used.

Describe the behavior you expected

Preferably, rainbow colors will be used, as they do in visual mode and in R Markdown files.

Activity

  1. added this to the v1.4 milestone on Sep 15, 2020
  2. mikebessuille commented on Sep 21, 2020

    @mikebessuille
    Contributor

    rainbow parens is not meant for publishing, so we do not expect this to work in a Markdown file where the code is not being edited for execution.

  3. ronblum commented on Sep 21, 2020

    @ronblum
    ContributorAuthor

    @mikebessuille Rainbow parens show up in visual mode for Markdown files, so the source and visual mode are inconsistent. Should they be disabled in visual mode?

  4. mikebessuille commented on Sep 21, 2020

    @mikebessuille
    Contributor

    in that case, perhaps they should be disabled in Visual Mode, not sure. Yes I think they should be consistent between visual mode and "regular mode".

  5. jjallaire commented on Sep 21, 2020

    @jjallaire
    Member

    Code in markdown files is indeed executed so needs to have identical behavior as source mode.

    I can't quite follow what the defect is here (i.e. what is inconsistent). If rainbow parens are enabled they should show up in both source and visual mode (and conversely not show up when disabled).

  6. ronblum commented on Sep 21, 2020

    @ronblum
    ContributorAuthor

    The difference is that all parens remain a single color in source mode, but in rainbow colors in visual mode. E.g.

    ```{r}
    (((((((())))))))
    ```
    

    is monochromatic in source mode:
    monochrome

    but in rainbow colors in visual mode:
    rainbow

    This is only true for Markdown. R Markdown is consistently rainbows.

  7. jjallaire commented on Sep 21, 2020

    @jjallaire
    Member

    @jmcphers Can we see what's going on here? I still don't understand from the bug description what the setting actually is when you observe this behavior. This seems like it would be a P0 bug for preview (so I'll target it there for now) if rainbow parens were always displayed in visual mode no matter what the setting).

  8. modified the milestones: v1.4, v1.4-preview on Sep 21, 2020
  9. 16 remaining items

  10. mikebessuille commented on Oct 2, 2020

    @mikebessuille
    Contributor

    Right. So, then it comes back to what I said earlier on this ticket. This is not a regression; this never worked in source mode for Markdown files. So... this wouldn't meet my bar at this point in the release for 1.4. In my opinion. Anyone else feel strongly that it needs to be fixed urgently?

  11. kevinushey commented on Oct 2, 2020

    @kevinushey
    Collaborator

    We've considered highlighting plain Markdown files as though they were R Markdown files in the past, but ultimately never decided to make that change.

    FWIW, users can manually change the filetype using the file type menu at the bottom right of the editor viewport.

  12. ronblum commented on Oct 5, 2020

    @ronblum
    ContributorAuthor

    The current state, in 1.4, has an inconsistency in markdown:
    - Highlighting and rainbow parens are present in visual mode.
    - Highlighting and rainbow parens are not present in source mode.

    Are we OK with this current state in 1.4? I say yes. If anyone disagrees, please say so.

  13. changed the title [-]Rainbow colors and themes show up for Markdown files in visual mode but not source mode[/-] [+]Add rainbow colors and themes show up for markdown files in the source editor[/+] on Oct 5, 2020
  14. changed the title [-]Add rainbow colors and themes show up for markdown files in the source editor[/-] [+]Add rainbow colors and themes for markdown files in the source editor[/+] on Oct 5, 2020
  15. changed the title [-]Add rainbow colors and themes for markdown files in the source editor[/-] [+]Add rainbow colors and highlighting for markdown files in the source editor[/+] on Oct 5, 2020
  16. modified the milestones: v1.4, Later on Oct 5, 2020
  17. kevinushey commented on Oct 5, 2020

    @kevinushey
    Collaborator

    Given that this only affects plain Markdown documents (and not R Markdown documents) I think it's okay to leave out of v1.4.

  18. added this to the Later milestone on Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions