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

Issues with rendering of custom Source Markers #12425

Closed
gadenbuie opened this issue Dec 12, 2022 · 1 comment
Closed

Issues with rendering of custom Source Markers #12425

gadenbuie opened this issue Dec 12, 2022 · 1 comment
Assignees
Labels

Comments

@gadenbuie
Copy link
Member

System details

RStudio Edition : Desktop [Open Source]
RStudio Version : 2023.3.0.14
OS Version      : OS X  12.5.1
R Version       : R version 3.6.3 (2020-02-29)

Steps to reproduce the problem

I think this is a regression; it was, at some point, possible to color and format source marker messages, but it no longer seems to be working as expected.

  1. Run this script to create a test script. It will open another R script.

    tmpfile <- tempfile(fileext = ".R")
    
    writeLines(con = tmpfile,
    'foo <- cli::bg_br_white(cli::col_red("I am red!"))
    bar <- cli::bg_br_yellow(cli::col_cyan("I am cyan!"))
    
    markers <- list(
      list(
        type = "error",
        file = tmpfile,
        line = 6,
        column = 1,
        message = foo),
      list(
        type = "info", 
        file = tmpfile,
        line = 12,
        column = 1,
        message = bar))
    
    rstudioapi::sourceMarkers("Test Name", markers)
    '
    )
    
    file.edit(tmpfile)
  2. Run the opened R script to create the custom source markers.

  3. Problem: Observe that the markers do not appear in the current source file.

    image

  4. Click on a marker in the Markers pane. The file will open and the cursor will be on the line with the marker. Hover over the marker image.

    image

  5. Problem: The ANSI SGR colors of the marker text are escaped and appear in the message, rather than being applied to the message colors.

    image

Describe the problem in detail

See above

Describe the behavior you expected

I was expecting messages to be colored as described in #10062.

@gadenbuie gadenbuie added bug new New incoming issues, ready for initial review. labels Dec 12, 2022
@romainfrancois romainfrancois removed the new New incoming issues, ready for initial review. label Dec 13, 2022
@romainfrancois romainfrancois added this to the Cherry Blossom milestone Dec 14, 2022
@ronblum ronblum self-assigned this Feb 10, 2023
@ronblum
Copy link
Contributor

ronblum commented Feb 10, 2023

Verified in 2023.03.0-daily+312 on MacOS 13.2. The message is now displayed with the text in color instead of the escaped code.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants