diff --git a/README.md b/README.md index 625d14fc..74a4d28b 100644 --- a/README.md +++ b/README.md @@ -1481,17 +1481,17 @@ multiple `dropbar_menu_entry_t` instances while a `dropbar_menu_entry_t` has the following methods: -| Method | Description | -| ------ | ------ | -| `dropbar_menu_entry_t:new(opts: dropbar_menu_entry_t?): dropbar_menu_entry_t` | constructor of `dropbar_menu_entry_t` | -| `dropbar_menu_entry_t:del()` | destructor of `dropbar_menu_entry_t` | -| `dropbar_menu_entry_t:cat(): string, dropbar_menu_hl_info_t` | concatenate the components into a string, returns the string and highlight info[`dropbar_menu_hl_info_t`](#dropbar_menu_hl_info_t) | -| `dropbar_menu_entry_t:displaywidth(): integer` | calculate the display width of the entry | -| `dropbar_menu_entry_t:bytewidth(): integer` | calculate the byte width of the entry | -| `dropbar_menu_entry_t:first_clickable(offset: integer?): dropbar_symbol_t?, { start: integer, end: integer }?` | get the first clickable component[`dropbar_symbol_t`](#dropbar_symbol_t) and its range in the dropbar menu entry starting from `offset`, which defaults to 0 | -| `dropbar_menu_entry_t:get_component_at(col: integer): dropbar_symbol_t?, { start: integer, end: integer }?` | get the component[`dropbar_symbol_t`](#dropbar_symbol_t) at column position `col` and the range it occupies in the menu entry | -| `dropbar_menu_entry_t:prev_clickable(col: integer): dropbar_symbol_t?, { start: integer, end: integer }?` | get the previous clickable component[`dropbar_symbol_t`](#dropbar_symbol_t) and its range in the dropbar menu entry given current column position `col` | -| `dropbar_menu_entry_t:next_clickable(col: integer): dropbar_symbol_t?, { start: integer, end: integer }?` | get the next clickable component[`dropbar_symbol_t`](#dropbar_symbol_t) and its range in the dropbar menu entry given current column position `col` | +| Method | Description | +| ------ | ------ | +| `dropbar_menu_entry_t:new(opts: dropbar_menu_entry_t?): dropbar_menu_entry_t` | constructor of `dropbar_menu_entry_t` | +| `dropbar_menu_entry_t:del()` | destructor of `dropbar_menu_entry_t` | +| `dropbar_menu_entry_t:cat(): string, dropbar_menu_hl_info_t` | concatenate the components into a string, returns the string and highlight info[`dropbar_menu_hl_info_t`](#dropbar_menu_hl_info_t) | +| `dropbar_menu_entry_t:displaywidth(): integer` | calculate the display width of the entry | +| `dropbar_menu_entry_t:bytewidth(): integer` | calculate the byte width of the entry | +| `dropbar_menu_entry_t:first_clickable(offset: integer?): dropbar_symbol_t?, { start: integer, end: integer }?` | get the first clickable component[`dropbar_symbol_t`](#dropbar_symbol_t) and its range in the dropbar menu entry starting from `offset`, which defaults to 0 | +| `dropbar_menu_entry_t:get_component_at(col: integer, look_ahead: boolean?): dropbar_symbol_t?, { start: integer, end: integer }?` | get the component[`dropbar_symbol_t`](#dropbar_symbol_t) at column position `col` and the range it occupies in the menu entry | +| `dropbar_menu_entry_t:prev_clickable(col: integer): dropbar_symbol_t?, { start: integer, end: integer }?` | get the previous clickable component[`dropbar_symbol_t`](#dropbar_symbol_t) and its range in the dropbar menu entry given current column position `col` | +| `dropbar_menu_entry_t:next_clickable(col: integer): dropbar_symbol_t?, { start: integer, end: integer }?` | get the next clickable component[`dropbar_symbol_t`](#dropbar_symbol_t) and its range in the dropbar menu entry given current column position `col` | #### `dropbar_menu_hl_info_t` diff --git a/doc/dropbar.txt b/doc/dropbar.txt index 6c3a6546..0b1a266c 100644 --- a/doc/dropbar.txt +++ b/doc/dropbar.txt @@ -1743,13 +1743,16 @@ dropbar_menu_entry_t:first_clickable([{offset}]) component occupies in the menu *dropbar_menu_entry_t:get_component_at()* -dropbar_menu_entry_t:get_component_at({col}) +dropbar_menu_entry_t:get_component_at({col}[, {look_ahead}]) Get the compoenent at column position {col} and the range it occupies in the menu entry Parameters ~ • {col} (integer): column number, 1-based, byte-indexed + • {look_ahead} (boolean?): + whether to look ahead to find a component if no component is + found at {col} Returns ~ (`dropbar_symbol_t`?): the component at the position