<commit_before>React = require 'react'
{div} = require 'reactionary'
{multiplyString} = require 'underscore-plus'

module.exports =
GutterComponent = React.createClass
  render: ->
    {editor, visibleRowRange} = @props
    [startRow, endRow] = visibleRowRange
    lineHeightInPixels = editor.getLineHeight()
    precedingHeight = startRow * lineHeightInPixels
    followingHeight = (editor.getScreenLineCount() - endRow) * lineHeightInPixels
    maxDigits = editor.getLastBufferRow().toString().length
    style =
      height: editor.getScrollHeight()
      WebkitTransform: "translateY(#{-editor.getScrollTop()}px)"
    wrapCount = 0

    div className: 'gutter',
      div className: 'line-numbers', style: style, [
        div className: 'spacer', key: 'top-spacer', style: {height: precedingHeight}
        (for bufferRow in @props.editor.bufferRowsForScreenRows(startRow, endRow - 1)
          if bufferRow is lastBufferRow
            lineNumber = '•'
            key = "#{bufferRow}-#{++wrapCount}"
          else
            lastBufferRow = bufferRow
            wrapCount = 0
            lineNumber = (bufferRow + 1).toString()
            key = bufferRow.toString()

          LineNumberComponent({lineNumber, maxDigits, bufferRow, key}))...
        div className: 'spacer', key: 'bottom-spacer', style: {height: followingHeight}
      ]

LineNumberComponent = React.createClass
  render: ->
    {bufferRow} = @props
    div
      className: "line-number line-number-#{bufferRow}"
      'data-buffer-row': bufferRow
      dangerouslySetInnerHTML: {__html: @buildInnerHTML()}<commit_msg>:lipstick:<commit_after>React = require 'react'
{div} = require 'reactionary'
{multiplyString} = require 'underscore-plus'

module.exports =
GutterComponent = React.createClass
  render: ->
    {editor, visibleRowRange} = @props
    [startRow, endRow] = visibleRowRange
    lineHeightInPixels = editor.getLineHeight()
    precedingHeight = startRow * lineHeightInPixels
    followingHeight = (editor.getScreenLineCount() - endRow) * lineHeightInPixels
    maxDigits = editor.getLastBufferRow().toString().length
    style =
      height: editor.getScrollHeight()
      WebkitTransform: "translateY(#{-editor.getScrollTop()}px)"
    wrapCount = 0

    lineNumbers = []
    for bufferRow in @props.editor.bufferRowsForScreenRows(startRow, endRow - 1)
      if bufferRow is lastBufferRow
        lineNumber = '•'
        key = "#{bufferRow}-#{++wrapCount}"
      else
        lastBufferRow = bufferRow
        wrapCount = 0
        lineNumber = (bufferRow + 1).toString()
        key = bufferRow.toString()

      lineNumbers.push(LineNumberComponent({lineNumber, maxDigits, bufferRow, key}))
      lastBufferRow = bufferRow

    div className: 'gutter',
      div className: 'line-numbers', style: style, [
        div className: 'spacer', key: 'top-spacer', style: {height: precedingHeight}
        lineNumbers...
        div className: 'spacer', key: 'bottom-spacer', style: {height: followingHeight}
      ]

LineNumberComponent = React.createClass
  render: ->
    {bufferRow} = @props
    div
      className: "line-number line-number-#{bufferRow}"
      'data-buffer-row': bufferRow
      dangerouslySetInnerHTML: {__html: @buildInnerHTML()}
{'fraction_non_alphanumeric': 0.11933395004625347, 'fraction_numerical': 0.002466851680542707, 'mean_word_length': 3.291005291005291, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7362546', 'n_tokens_mistral': 956, 'n_tokens_neox': 937, 'n_words': 209}