nvim-neorg / neorg-telescope

Telescope.nvim integration for Neorg
GNU General Public License v3.0
187 stars 24 forks source link

fix: Get lines so search_headings won't be empty #25

Closed TJ-Adams closed 1 year ago

TJ-Adams commented 1 year ago

This change gets the buffer number and lines each time the search_headings command is called so the resultant list of headings won't be empty.

Hey all, I'm not too familiar with the repository but I did some quick digging and saw that search headings would have an empty list because "lines" wasn't valid and there'd be nothing to match against. You can test the command by running Telescope neorg search_headings but this should fix it. I saw someone in the discord mention they had the same issue.

Let me know if there's anything else I need to do etc to make it merge-able. Thank you.

max397574 commented 1 year ago

didn't realize this issue existed it can be fixed in a different way the problem is that the call to nvim_buf_get_lines is at the top of the file so it will only be called on first load of the module. it should be in the function you could do this or you can close this pr and I do it myself

TJ-Adams commented 1 year ago

Hey,

Thank you for the extra information. I changed the implementation to how you described it and it's working. Let me know if there's anything else I should do to get the pull request approved!

Oh also I changed the wording of the commit message. Let me know if it looks good or not.

max397574 commented 1 year ago

thank you very much