setSelectedIndex(index) {
		this.selectedIndex = index;
		console.log(`setSelectedIndex called with index: ${index}`);

		if (index !== null) {
			// Calculate the line number of the selected index
			const lineNumber = Math.floor(index / this.bytesPerRow);
			const lineHeight = 16; // Height of one row in pixels
			const scrollTop = lineNumber * lineHeight;

			// Determine visible range
			const visibleStartLine = Math.floor(this.hexeditContent.scrollTop / lineHeight);
			const visibleEndLine = visibleStartLine + this.visibleRows;

			console.log(`setSelectedIndex: lineNumber=${lineNumber}, visibleStartLine=${visibleStartLine}, visibleEndLine=${visibleEndLine}`);

			// If the selected line is out of the visible range, update scrollTop
			if (lineNumber < visibleStartLine || lineNumber >= visibleEndLine) {
				const newScrollTop = Math.max(0, (lineNumber * lineHeight) - ((this.visibleRows / 2) * lineHeight));
				this.hexeditContent.scrollTop = newScrollTop;
				console.log(`setSelectedIndex: Updated scrollTop to ${this.hexeditContent.scrollTop}`);
			}
		}

		this.updateSelection();
	}
Sets the currently selected byte index and updates the view.

@param {number|null} index - The byte index to select, or null to clear selection.