updateSelection() {
		// Restore the background color of the previous selection if any
		if (this.previousSelectedIndex !== null) {
			const prevHexSpan = this.hexview.querySelector(`span[data-byte-index="${this.previousSelectedIndex}"]`);
			const prevTextSpan = this.textview.querySelector(`span[data-byte-index="${this.previousSelectedIndex}"]`);
			if (prevHexSpan && prevTextSpan) {
				// Remove active cursor classes
				prevHexSpan.classList.remove('active-view-cursor');
				prevTextSpan.classList.remove('active-view-cursor');

				// Restore background based on whether it was part of a match
				const wasInMatch = this.matches.some(match => this.previousSelectedIndex >= match.index && this.previousSelectedIndex < match.index + match.length);
				if (wasInMatch) {
					prevHexSpan.classList.add('highlighted');
					prevTextSpan.classList.add('highlighted');
				} else {
					prevHexSpan.classList.remove('highlighted');
					prevTextSpan.classList.remove('highlighted');
				}
			}
		}

		// Clear previous selection classes from active and passive views
		Array.from(this.hexedit.querySelectorAll(".active-view-cursor, .passive-view-cursor, .highlighted"))
			.forEach(e => e.classList.remove("active-view-cursor", "passive-view-cursor", "highlighted"));

		if (this.selectedIndex === null) return;

		// Check if selectedIndex is within the rendered range
		if (this.selectedIndex >= this.startIndex && this.selectedIndex < this.startIndex + this.visibleByteCount) {
			const hexSpan = this.hexview.querySelector(`span[data-byte-index="${this.selectedIndex}"]`);
			const textSpan = this.textview.querySelector(`span[data-byte-index="${this.selectedIndex}"]`);
			if (hexSpan && textSpan) {
				// Determine if the selected byte is part of a match
				const isInMatch = this.matches.some(match => this.selectedIndex >= match.index && this.selectedIndex < match.index + match.length);

				// Store current selected index as previous for next update
				this.previousSelectedIndex = this.selectedIndex;

				if (this.activeView === 'hex') {
					// Active view is Hex
					hexSpan.classList.add("active-view-cursor"); // Blinking blue
					// Passive view (Text)
					textSpan.classList.add("passive-view-cursor"); // Always light blue
				} else if (this.activeView === 'text') {
					// Active view is Text
					textSpan.classList.add("active-view-cursor"); // Blinking blue
					// Passive view (Hex)
					hexSpan.classList.add("passive-view-cursor"); // Always light blue
				}

				// Highlight the selected byte if it was part of a match
				if (isInMatch) {
					if (this.activeView === 'hex') {
						hexSpan.classList.add('highlighted');
					} else if (this.activeView === 'text') {
						textSpan.classList.add('highlighted');
					}
				}

				// Enable immediate editing in active view
				if (this.activeView === 'hex') {
					this.editHex = true;
				} else if (this.activeView === 'text') {
					this.editHex = false;
				}

				// Focus the active view to enable immediate editing
				this.focusActiveView();
			}
		}
	}
Updates the visual selection in the hex and text views.