Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

fix(inlay_hints): disable strict_indexing for nvim_buf_get_lines #353

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Mar 17, 2023

  1. Configuration menu
    Copy the full SHA
    a093f37 View commit details
    Browse the repository at this point in the history

Commits on May 20, 2023

  1. Configuration menu
    Copy the full SHA
    0fc421b View commit details
    Browse the repository at this point in the history
  2. fix(inlay_hints): disable strict_indexing for nvim_buf_get_lines

    The last parameter of vim.api.nvim_buf_get_lines() is a boolean called
    "strict_indexing". It causes the following behaviour:
    - When strict_indexing is "true" out of bounds indices cause an error
    - When strict_indexing is "false" out of bounds indices are clamped to
    the nearest valid index.
    
    Now nvim_buf_get_lines() returns an array, which might be empty. So
    attempting to access the first element (our line) could evaluate to nil.
    
    So we use "" as the fallback line string value.
    arindas committed May 20, 2023
    Configuration menu
    Copy the full SHA
    23fac87 View commit details
    Browse the repository at this point in the history