2 Commits

3 changed files with 8 additions and 2 deletions

View File

@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.1.9] - 2026-03-06
### 🐞 错误修复
- 修复diff截断时的字符边界问题
## [0.1.7] - 2026-02-14
### 🐞 错误修复

View File

@@ -1,6 +1,6 @@
[package]
name = "quicommit"
version = "0.1.8"
version = "0.1.9"
edition = "2024"
authors = ["Sidney Zhang <zly@lyzhang.me>"]
description = "A powerful Git assistant tool with AI-powered commit/tag/changelog generation(alpha version)"

View File

@@ -31,7 +31,8 @@ impl ContentGenerator {
// Truncate diff if too long
let max_diff_len = 4000;
let truncated_diff = if diff.len() > max_diff_len {
format!("{}\n... (truncated)", &diff[..max_diff_len])
let boundary = diff.floor_char_boundary(max_diff_len);
format!("{}\n... (truncated)", &diff[..boundary])
} else {
diff.to_string()
};