Skip to content

Feature Request: Synchronize number of lines between two side-by-side codeblocks with word-wrap #519

Open
@brianjenkins94

Description

@brianjenkins94

(Left example taken from https://codehike.org/docs/code/word-wrap and squishing it)

 1 function lorem(ipsum,     | # This line happens to fit    |
   dolor, sit) {             |   comfortably                 |
 2   ipsum.amet(             |                               |
 3     { consectetur: [0, 1] | # This line is also fine      |
       },                    |                               |
 4     {                     | # This line is too long and   |
 ·                           |   pushes the left down (but   |
 ·                           |   doesn't change its content) |
 5       adipiscing:         |                               |
         elit.sed,           |                               |
 6       eiusmod: "lorem     |                               |
         ipsum dolor sit     |                               |
         amet",              |                               |
 7       sit,                |                               |
 8     },                    |                               |
 9   )                       |                               |
10 }                         |                               |

Sites like https://www.diffchecker.com/ are able to do this to display side-by-side diffs. My use case more closely relates to literate programming.

The gist being: two arbitrarily wide codeblocks with word-wrap should be able to be displayed side-by-side but still have longer lines alongside eachother.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions