tzachar / cmp-tabnine

TabNine plugin for hrsh7th/nvim-cmp
MIT License
286 stars 27 forks source link

-1 on lines_before was not needed #70

Closed allan-simon closed 1 year ago

allan-simon commented 1 year ago

otherwise the line just before was not included

allan-simon commented 1 year ago

without this change

when editing this :

# this will be shown
# this won't                                 
def isPrime(self, <------ the cursor is here                            
    toto     

you can see this request being sent

    Autocomplete = {
      after = "\n    toto",
      before = "# this will be shown\ndef isPrime(self",
tzachar commented 1 year ago

This Looks ok, but I don't think its related to the multi-line problem.

allan-simon commented 1 year ago

no it is not , not directly. it is just that when trying to trigger the multi-line proposition , at first I didn't get any because

# check if number is prime 
|  <----- cursor here

would not send the line above (i.e the comment) and hence no multi-line was proposed , so it merely helped to discover this bug

(and since I have made it, I overall , multi-line or not, get slightly better code completion proposition )