Skip to content

Question about the code: function File:get_node_at_cursor(cursor) #504

Answered by jgollenz
Maltimore asked this question in Q&A
Discussion options

You must be logged in to vote

From :h nvim_win_get_cursor():

nvim_win_get_cursor({window})                          *nvim_win_get_cursor()*
    Gets the (1,0)-indexed, buffer-relative cursor position for a given window
    (different windows showing the same buffer have independent cursor
    positions). |api-indexing|

    Parameters:  
      • {window}  Window handle, or 0 for current window

    Return:  
        (row, col) tuple

cursor[2] is already 0-indexed, but cursor[1] is not.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Maltimore
Comment options

Answer selected by Maltimore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants