Author Topic: Color coding issue in python  (Read 422 times)

rowbearto

  • Senior Community Member
  • Posts: 2256
  • Hero Points: 132
Color coding issue in python
« on: August 26, 2022, 01:44:04 pm »
See attached screenshot. When a quoted string line ends with \ the color coding is wrong.

Here is the code in the screenshot:

Code: [Select]
    debugLogWrite(f"External command failed:\n\
                  \n     cmd: {args[0]}\
                  \n retcode: {args[1]}\
                  \n  stderr: {args[2]}\
                  \n  stdout: {args[3]}")

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6455
  • Hero Points: 503
Re: Color coding issue in python
« Reply #1 on: August 26, 2022, 05:51:08 pm »
Reproduced. The problem is more complicated than just the line ending with a \.

This is example works fine:
Code: [Select]
print(f"\
      \
      This should be string color");

This is a smaller example of the bug:
Code: [Select]
print(f"\
      {}\
      This should be string color");

This bug requires braces to be in the string preceding the trailing \. Weird.