feat: move word and line count output to finalize method

Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-26 19:20:14 -03:00
parent 0b57da071a
commit cf4254750d

View File

@@ -183,27 +183,7 @@ impl MetaPlugin for TextMetaPlugin {
// If we've reached our buffer limit and haven't finalized yet // If we've reached our buffer limit and haven't finalized yet
if self.buffer.len() >= self.max_buffer_size && !self.is_finalized { if self.buffer.len() >= self.max_buffer_size && !self.is_finalized {
// We already determined it's text at this point, so we can finalize // Mark as finalized but don't output word/line counts here
if self.is_binary_content == Some(false) {
// Output word and line counts
if let Some(meta_data) = crate::meta_plugin::process_metadata_outputs(
"text_word_count",
self.word_count.to_string(),
self.base.outputs()
) {
metadata.push(meta_data);
}
if let Some(meta_data) = crate::meta_plugin::process_metadata_outputs(
"text_line_count",
self.line_count.to_string(),
self.base.outputs()
) {
metadata.push(meta_data);
}
}
// Mark as finalized
self.is_finalized = true; self.is_finalized = true;
} }