Skip to content

Getting a tighter fit around the text #27

@pygy

Description

@pygy

Adding

    if (input.charAt(input.length - 1) === '\n') input += "\n"

at the start of color() and

.ldt pre:empty::after {
  display:block;
  content: " "
}

in the CSS file lets one set the rows to the exact number of lines at the end of update().

This results in a better behavior IMO (no container overflow).

Live example with a "gutter" plugin adapted to the new number of rows.

Edit: :empty is IE9+. I don't know how important IE7 compat is to you and the LDT user base at this point... I'd expect it to be low... I can send a PR if you're interested.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions