Skip to content

Refactor/buf doc loading#86

Merged
kibi2 merged 14 commits into
mainfrom
refactor/buf-doc-loading
May 29, 2026
Merged

Refactor/buf doc loading#86
kibi2 merged 14 commits into
mainfrom
refactor/buf-doc-loading

Conversation

@kibi2

@kibi2 kibi2 commented May 29, 2026

Copy link
Copy Markdown
Owner

Summary

This PR introduces a lightweight buffer state flag to distinguish between flat text buffers and tir-buf buffers.

Previously, the buffer type could be inferred by scanning the entire buffer content and checking whether it contained pipe (|) characters. While this approach worked, it required reading the full buffer repeatedly and introduced unnecessary overhead.

To avoid that cost, this PR stores the buffer state (FLAT) as a buffer-local flag instead.

In addition, this PR includes some internal cleanup:

  • renamed several functions for clarity
  • removed unused functions
  • updated and expanded test cases

Notes

The new flag slightly increases internal state management complexity, but should improve performance and simplify buffer-type checks in hot paths.

@codecov

codecov Bot commented May 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.95376% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
lua/tirenvi/core/dirty_range.lua 88.88% 4 Missing ⚠️
lua/tirenvi/app/pipeline.lua 97.22% 1 Missing ⚠️
lua/tirenvi/core/attrs.lua 75.00% 1 Missing ⚠️
lua/tirenvi/editor/autocmd.lua 95.65% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@kibi2 kibi2 force-pushed the refactor/buf-doc-loading branch from e892e58 to 5dd9bcd Compare May 29, 2026 01:44
@kibi2 kibi2 merged commit 4bf95be into main May 29, 2026
3 checks passed
@kibi2 kibi2 deleted the refactor/buf-doc-loading branch May 29, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant