pub fn process(&self) -> Option<TermResult<'_>> {
        // Ensure position is on a UTF-8 character boundary to prevent panics
        let safe_position = if self.line.is_char_boundary(self.position) {
            self.position
        } else {
            // Find the nearest lower character boundary
            (0..self.position)
                .rev()
                .find(|&i| self.line.is_char_boundary(i))
                .unwrap_or(0)
        };

        let prefix = &self.line[..safe_position];
        let at_pos = prefix.rfind('@')?;
        let start_pos = at_pos + 1;
        let term = &self.line[start_pos..safe_position];

        // Reject terms containing spaces
        if term.contains(' ') {
            return None;
        }

        Some(TermResult { span: Span::new(start_pos, safe_position), term })
    }
Get the search term from the line based on '@' marker or cursor position

If '@' marker is present, returns the word following it.
Otherwise, returns the word at the cursor position.
If no word is found, returns None.
crates/forge_main/src/completer/search_term.rs