<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/runtime/lua/vim/treesitter/_fold.lua, branch userreg</title>
<subtitle>Neovim fork with Rahm's personal hacks.</subtitle>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/'/>
<entry>
<title>fix(treesitter): make Visual hl work consistently with foldtext (#25484)</title>
<updated>2023-10-03T05:07:03+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2023-10-03T05:07:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=3af59a415c98afc42755308e56912b302ad5eb3d'/>
<id>3af59a415c98afc42755308e56912b302ad5eb3d</id>
<content type='text'>
Problem:  Visual highlight is inconsistent on a folded line with
          treesitter foldtext.
Solution: Don't added Folded highlight as it is already in background.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:  Visual highlight is inconsistent on a folded line with
          treesitter foldtext.
Solution: Don't added Folded highlight as it is already in background.</pre>
</div>
</content>
</entry>
<entry>
<title>feat(treesitter): add foldtext with treesitter highlighting (#25391)</title>
<updated>2023-10-01T19:10:51+00:00</updated>
<author>
<name>Till Bungert</name>
<email>tillbungert@gmail.com</email>
</author>
<published>2023-10-01T19:10:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=9ce1623837a817c3f4f5deff9c8ba862578b6009'/>
<id>9ce1623837a817c3f4f5deff9c8ba862578b6009</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(treesitter): don't update fold if tree is unchanged</title>
<updated>2023-09-13T07:51:54+00:00</updated>
<author>
<name>Jaehwang Jung</name>
<email>tomtomjhj@gmail.com</email>
</author>
<published>2023-08-20T05:17:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=4607807f9fcb83d4e183f6f67e705ffd7f451077'/>
<id>4607807f9fcb83d4e183f6f67e705ffd7f451077</id>
<content type='text'>
Problem:
Folds are opened when the visible range changes even if there are no
modifications to the buffer, e.g, when using zM for the first time. If
the parsed tree was invalid, on_win re-parses and gets empty tree
changes, which triggers fold updates.

Solution:
Don't update folds in on_changedtree if there are no changes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
Folds are opened when the visible range changes even if there are no
modifications to the buffer, e.g, when using zM for the first time. If
the parsed tree was invalid, on_win re-parses and gets empty tree
changes, which triggers fold updates.

Solution:
Don't update folds in on_changedtree if there are no changes.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(treesitter): update folds only once on InsertLeave</title>
<updated>2023-08-29T08:02:02+00:00</updated>
<author>
<name>Jaehwang Jung</name>
<email>tomtomjhj@gmail.com</email>
</author>
<published>2023-08-24T08:32:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=ffb340bf63af42ac347e23e0488898adc4391328'/>
<id>ffb340bf63af42ac347e23e0488898adc4391328</id>
<content type='text'>
Problem:
With treesitter fold, InsertLeave can be slow, because a single session
of insert mode may schedule multiple fold updates in on_bytes and
on_changedtree.

Solution:
Don't create duplicate autocmds.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
With treesitter fold, InsertLeave can be slow, because a single session
of insert mode may schedule multiple fold updates in on_bytes and
on_changedtree.

Solution:
Don't create duplicate autocmds.
</pre>
</div>
</content>
</entry>
<entry>
<title>feat(treesitter)!: incremental injection parsing</title>
<updated>2023-08-12T15:11:36+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2023-08-10T13:21:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=2ca076e45fb3f1c08f6a1a374834df0701b8d778'/>
<id>2ca076e45fb3f1c08f6a1a374834df0701b8d778</id>
<content type='text'>
Problem:

Treesitter highlighting is slow for large files with lots of injections.

Solution:

Only parse injections we are going to render during a redraw cycle.

---

- `LanguageTree:parse()` will no longer parse injections by default and
  now requires an explicit range argument to be passed.

- `TSHighlighter` now parses injections incrementally during on_win
  callbacks for the line range being rendered.

- Plugins which require certain injections to be parsed must run
  `parser:parse({ start_row, end_row })` before using the tree.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:

Treesitter highlighting is slow for large files with lots of injections.

Solution:

Only parse injections we are going to render during a redraw cycle.

---

- `LanguageTree:parse()` will no longer parse injections by default and
  now requires an explicit range argument to be passed.

- `TSHighlighter` now parses injections incrementally during on_win
  callbacks for the line range being rendered.

- Plugins which require certain injections to be parsed must run
  `parser:parse({ start_row, end_row })` before using the tree.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(treesitter): update folds in all relevant windows (#24230)</title>
<updated>2023-07-07T10:12:46+00:00</updated>
<author>
<name>Jaehwang Jung</name>
<email>tomtomjhj@gmail.com</email>
</author>
<published>2023-07-07T10:12:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=c44d819ae1f29cd34ee3b2350b5c702caed949c3'/>
<id>c44d819ae1f29cd34ee3b2350b5c702caed949c3</id>
<content type='text'>
Problem: When using treesitter foldexpr,
* :diffput/get open diff folds, and
* folds are not updated in other windows that contain the updated
  buffer.

Solution: Update folds in all windows that contain the updated buffer
and use expr foldmethod.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem: When using treesitter foldexpr,
* :diffput/get open diff folds, and
* folds are not updated in other windows that contain the updated
  buffer.

Solution: Update folds in all windows that contain the updated buffer
and use expr foldmethod.</pre>
</div>
</content>
</entry>
<entry>
<title>fix(treesitter): make foldexpr work without highlighting (#24167)</title>
<updated>2023-06-27T18:05:09+00:00</updated>
<author>
<name>Jaehwang Jung</name>
<email>tomtomjhj@gmail.com</email>
</author>
<published>2023-06-27T18:05:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=c7e7f1d4b4b62c75bb54e652f25c6c6b8785a7f4'/>
<id>c7e7f1d4b4b62c75bb54e652f25c6c6b8785a7f4</id>
<content type='text'>
Problem: Treesitter fold is not updated if treesitter hightlight is not
active. More precisely, updating folds requires `LanguageTree:parse()`.

Solution: Call `parse()` before computing folds and compute folds when
lines are added/removed.

This doesn't guarantee correctness of the folds, because some changes
that don't add/remove line won't update the folds even if they should
(e.g. adding pair of braces). But it is good enough for most cases,
while not introducing big overhead.

Also, if highlighting is active, it is likely that
`TSHighlighter._on_buf` already ran `parse()` (or vice versa).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem: Treesitter fold is not updated if treesitter hightlight is not
active. More precisely, updating folds requires `LanguageTree:parse()`.

Solution: Call `parse()` before computing folds and compute folds when
lines are added/removed.

This doesn't guarantee correctness of the folds, because some changes
that don't add/remove line won't update the folds even if they should
(e.g. adding pair of braces). But it is good enough for most cases,
while not introducing big overhead.

Also, if highlighting is active, it is likely that
`TSHighlighter._on_buf` already ran `parse()` (or vice versa).</pre>
</div>
</content>
</entry>
<entry>
<title>fix(treesitter): allow foldexpr without highlights (#23672)</title>
<updated>2023-05-18T09:52:01+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2023-05-18T09:52:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=ef64e225f6f6c01280aa8472bebe812016f357bf'/>
<id>ef64e225f6f6c01280aa8472bebe812016f357bf</id>
<content type='text'>
Ref nvim-treesitter/nvim-treesitter#4748</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ref nvim-treesitter/nvim-treesitter#4748</pre>
</div>
</content>
</entry>
<entry>
<title>perf(treesitter): insert/remove items efficiently (#23443)</title>
<updated>2023-05-02T21:27:14+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2023-05-02T21:27:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=3ba930844c302dc43d32a30ed453667409596c4a'/>
<id>3ba930844c302dc43d32a30ed453667409596c4a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(treesitter): do not calc folds on unloaded buffers</title>
<updated>2023-05-02T09:07:18+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2023-05-02T09:07:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=fba18a3b62310f4535d979a05288101b9af2ef50'/>
<id>fba18a3b62310f4535d979a05288101b9af2ef50</id>
<content type='text'>
Fixes #23423</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #23423</pre>
</div>
</content>
</entry>
</feed>
