<commit_before>package ui

import (
	"bytes"
	"errors"
	"fmt"
	"runtime"
	"strings"

	"github.com/nsf/termbox-go"
)

// A View is a window. It maintains its own internal buffer and cursor
// position.
type View struct {
	name             string
	x0, y0, x1, y1   int      //screen dimensions
	bufferX, bufferY int      //current position in the view buffer
	cursorX, cursorY int      //cursor position in the screen, valid values between 0 and x1, y1
	lines            [][]rune //the content buffer
	showCursor       bool

	tainted bool // marks if the viewBuffer must be updated
	//viewLines []viewLine // the view buffer

	markup *Markup
}

type viewLine struct {
	linesX, linesY int // coordinates relative to v.lines
	line           []rune
}

// ViewSize returns the width and the height of the View.
func (v *View) ViewSize() (width, height int) {
	return v.x1 - v.x0 - 1, v.y1 - v.y0 - 1
}

// Name returns the name of the view.
func (v *View) Name() string {
	return v.name
}

// setRune writes a rune at the given point, relative to the view.
func (v *View) setRune(x, y int, ch rune, fgColor, bgColor termbox.Attribute) error {
	maxX, maxY := v.ViewSize()
	if x < 0 || x >= maxX || y < 0 || y >= maxY {
		return invalidPointError(x, y)
	}

	termbox.SetCell(v.x0+x+1, v.y0+y+1, ch,
		termbox.Attribute(fgColor), termbox.Attribute(bgColor))
	return nil
}

// SetCursor sets the cursor position of the view at the given point,
// relative to the screen. An error is returned if the position is outside
// the screen limits.
func (v *View) setCursor(x, y int) error {
	maxX, maxY := v.ViewSize()
	if x < 0 || x >= maxX || y < 0 || y >= maxY {
		return invalidPointError(x, y)
	}
	v.cursorX = x
	v.cursorY = y
	return nil
}
<commit_msg>Remove unused code<commit_after>package ui

import (
	"bytes"
	"errors"
	"fmt"
	"runtime"
	"strings"

	"github.com/nsf/termbox-go"
)

// A View is a window. It maintains its own internal buffer and cursor
// position.
type View struct {
	name             string
	x0, y0, x1, y1   int      //screen dimensions
	bufferX, bufferY int      //current position in the view buffer
	cursorX, cursorY int      //cursor position in the screen, valid values between 0 and x1, y1
	lines            [][]rune //the content buffer
	showCursor       bool

	tainted bool // marks if the viewBuffer must be updated
	//viewLines []viewLine // the view buffer

	markup *Markup
}

type viewLine struct {
	linesX, linesY int // coordinates relative to v.lines
	line           []rune
}

// ViewSize returns the width and the height of the View.
func (v *View) ViewSize() (width, height int) {
	return v.x1 - v.x0 - 1, v.y1 - v.y0 - 1
}

// Name returns the name of the view.
func (v *View) Name() string {
	return v.name
}

// SetCursor sets the cursor position of the view at the given point,
// relative to the screen. An error is returned if the position is outside
// the screen limits.
func (v *View) setCursor(x, y int) error {
	maxX, maxY := v.ViewSize()
	if x < 0 || x >= maxX || y < 0 || y >= maxY {
		return invalidPointError(x, y)
	}
	v.cursorX = x
	v.cursorY = y
	return nil
}

{'fraction_non_alphanumeric': 0.11010946555054733, 'fraction_numerical': 0.01159047005795235, 'mean_word_length': 2.766060606060606, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3649712', 'n_tokens_mistral': 1079, 'n_tokens_neox': 1053, 'n_words': 424}