kdheepak / cmp-latex-symbols

Add latex symbol support for nvim-cmp.
MIT License
134 stars 9 forks source link

Fix temporary text #3

Closed hrsh7th closed 3 years ago

hrsh7th commented 3 years ago

This PR fixes https://github.com/hrsh7th/nvim-cmp/issues/83

kdheepak commented 3 years ago

Thank you! I don’t exactly understand why this change was necessary though. Maybe I have to read the LSP spec more closely.

hrsh7th commented 3 years ago

some of the text \pi# (# is cursor)

In this case, your specified keyword pattern will detects pi as the replacing range (it does not includes \)

So if the item confirmed, \ is not replacing.

New implementation contains \ as word, so nvim-cmp automatically detect \pi as the replacing range.

Anyway, it is works now but I recommend specifying \\[^[:blank:]]* as keyword pattern.

kdheepak commented 3 years ago

Thanks for the suggestion. The exact keyword pattern you suggested doesn't work (I believe it is invalid syntax), but I moved the last closing bracket and that seems to work. I've made a PR with that change.

I'm actually getting some odd behavior with trigger for the keyword pattern:

\sum<CR> -> ∑ -- Works as expected

\sum \s -- Auto complete does not trigger

https://user-images.githubusercontent.com/1813121/131003487-665a182f-e22a-4ff6-bd8e-adbeadc51157.mov

This is happening regardless of the old or new keyword pattern. I think this didn't happen before. Maybe another bug? Should I report this upstream?