Skip to main content

Module token_under_cursor

Module token_under_cursor 

Source
Expand description

Token classification under cursor (URL / file / directory / word).

Retrieves current line + cursor column, extracts contiguous non‑whitespace token, classifies via filesystem inspection or URL parsing, returning a tagged Lua table.

EnumsΒ§

TokenUnderCursor
Classified representation of the token found under the cursor.

ConstantsΒ§

FILE_CMD_CACHE πŸ”’
Cache file -I results to avoid spawning a process per cursor movement / hover. Keyed by path string; only successful results are cached.

FunctionsΒ§

convert_visual_to_byte_idx πŸ”’
Convert a visual (character) index into a byte index for the supplied string s.
exec_file_cmd_cached πŸ”’
Cached wrapper around ytil_sys::file::exec_file_cmd that avoids spawning a file -I process for previously seen paths. Only successful results are cached.
extract_https_or_http_link πŸ”’
extract_markdown_link πŸ”’
get
Retrieve and classify the non-whitespace token under the cursor in the current window.
get_token_under_cursor_in_normal_buffer πŸ”’
get_token_under_cursor_in_terminal_buffer πŸ”’
get_word_at_index πŸ”’
Find the non-whitespace token in the supplied string s containing the visual index idx.