dvdsk / prosesitter.nvim

A (work in progress) grammar, spelling and style plugin for Neovim
MIT License
25 stars 0 forks source link

Latex string capture group does not capture valid text #34

Closed dvdsk closed 2 years ago

dvdsk commented 2 years ago

example demo.tex change capitalization of the third sentence

dvdsk commented 2 years ago

only part of large lines is put into a lintrequest example doc:

\documentclass{article}
\begin{document}

prosesitter.nvim is a text linting tool that adds spell and style checking to your comments and strings. It uses vale to check what you write for style problems. that could vary from not using the passive voice and weasle words ('very' unique) to outdated or noninclusive terms. you can set up youur own style or copy an existing one. if you let prosesitter set up vale for you it will also setup some styles for you from vales style libary.

\end{document}

the lint request for this consists of:

prosesitter.nvim is a text linting tool that adds spell and style checking to your comments and strings. It uses vale to check what you write for style problems. that could vary from not using the passive voice and weasle words

missing the last part

dvdsk commented 2 years ago

An important note is that the test text is devided in three text nodes as the part inside the () forms a group on its own

dvdsk commented 2 years ago

Supporting multiple different captures within one line might complicate the code. Lets try to adjust the latex capture group to capture sentences with () in them

dvdsk commented 2 years ago

A better query is not gonna be enough:

a text \textbf{some text to spellcheck} more text

This example needs 3 'areas'. Since we recheck the entire line each time a callback fires we do not need more placeholder ext marks. However we do need multiple areas for one line.

Right now lint request meta (buf, id, start column, end column) is stored in a table keyed by placeholder extmark id. To support multiple areas this will have to change to an array of meta keyed by extmark id.

Todo:

dvdsk commented 2 years ago

Order of nodes is random. This was not an issue with one node per line.... however line content reshuffeling is a problem.

dvdsk commented 2 years ago

Right now lint request meta (buf, id, start column, end column) is stored in a table keyed by placeholder extmark id. To support multiple areas this will have to change to an array of meta keyed by extmark id.

issue: multiple edits on the same line will collect and duplicate.