togglePin method
Pin or unpin a history entry.
Implementation
void togglePin(int index) {
if (index < 0 || index >= _history.length) return;
final entry = _history[index];
_history[index] = SearchHistoryEntry(
pattern: entry.pattern,
scope: entry.scope,
options: entry.options,
timestamp: entry.timestamp,
pinned: !entry.pinned,
);
}