<commit_before>// X509LS
// Copyright 2013 <NAME>

#include "x509ls/cli/base/text_control.h"

#include <assert.h>
#include <stddef.h>
#include <stdio.h>

#include <algorithm>

using std::min;
using std::max;

namespace x509ls {
TextControl::TextControl(CliControl* parent, const string& text)
  :
    CliControl(parent),
    pad_(NULL),
    text_(text),
    first_visible_line_index_(0),
    line_count_(0) {
}

TextControl::~TextControl() {
  if (pad_) {
    delwin(pad_);
  }
}

bool TextControl::Scroll(const enum ScrollDirection direction, int lines) {
  if (!pad_) {
    return false;
  }

  WINDOW* window = Window();
  assert(window != NULL);

  int adjustment = lines != 0 ? lines : Rows();
  if (direction == kDirectionUp) {
    adjustment = -adjustment;
  }<commit_msg>Removes unused reference to WINDOW*<commit_after>// X509LS
// Copyright 2013 <NAME>

#include "x509ls/cli/base/text_control.h"

#include <assert.h>
#include <stddef.h>
#include <stdio.h>

#include <algorithm>

using std::min;
using std::max;

namespace x509ls {
TextControl::TextControl(CliControl* parent, const string& text)
  :
    CliControl(parent),
    pad_(NULL),
    text_(text),
    first_visible_line_index_(0),
    line_count_(0) {
}

TextControl::~TextControl() {
  if (pad_) {
    delwin(pad_);
  }
}

bool TextControl::Scroll(const enum ScrollDirection direction, int lines) {
  if (!pad_) {
    return false;
  }

  int adjustment = lines != 0 ? lines : Rows();
  if (direction == kDirectionUp) {
    adjustment = -adjustment;
  }
{'fraction_non_alphanumeric': 0.14501312335958005, 'fraction_numerical': 0.02099737532808399, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '499109', 'n_tokens_mistral': 564, 'n_tokens_neox': 528, 'n_words': 123}