A new topic of code formatting

  • Sue_H

    SSC Guru

    Points: 90165

    It isn't honoring the line feeds, carriage return betweeen code chunks - adding into the editor or if pasted from SSMS.

    Try one pasted from notepad:

    SELECT 
    sp.state_desc,
    sp.permission_name,
    p.name,
    sp.class_desc
    FROM sys.server_permissions AS sp
    JOIN sys.server_principals AS p
    ON sp.grantee_principal_id = p.principal_id
    WHERE permission_name = 'VIEW SERVER STATE'





    --after some cr lf...
    SELECT
    p.[name],
    sp.permission_name,
    sp.state_desc,
    sp.class_desc
    FROM sys.server_permissions AS sp
    JOIN sys.server_principals AS p
    ON sp.grantee_principal_id = p.principal_id
    WHERE p.[name] = 'YourTestLogin'
  • Steve Jones - SSC Editor

    SSC Guru

    Points: 715375

    It's compressing line feeds into one, removing blank lines.

    When you write that it's not honoring them, I think of lines being combined.  It does honor a line feed, but removes empty lines, which is a bug.

  • Sue_H

    SSC Guru

    Points: 90165

    Thanks, yes that's what it's doing. My bad for using the term "honoring", should have phrased that differently.

     

    Sue

  • Steve Jones - SSC Editor

    SSC Guru

    Points: 715375

    No  worries, I figured it out. This migration has made me painfully aware of how poorly I sometimes describe things to developers. I'm more empathetic to users struggling to express themselves.

Viewing 4 posts - 16 through 19 (of 19 total)

You must be logged in to reply to this topic. Login to reply