Skip to content

Commit aa4afa4

Browse files
committed
chore: update version to 0.2.9; enhance changelog and fix highlighting logic
1 parent 7784516 commit aa4afa4

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,8 @@
117117
## 0.2.8
118118

119119
* Fix: Large files crash
120-
* Enhancement: Batched highlighting
120+
* Enhancement: Batched highlighting
121+
122+
## 0.2.9
123+
124+
* Fix: Removed grapheme characters

lib/code_crafter/code_crafter_controller.dart

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,7 @@ class CodeCrafterController extends TextEditingController {
377377
for (int lineIdx = 0; lineIdx < nodeLines.length; lineIdx++) {
378378
final line = nodeLines[lineIdx];
379379
final startOfLineOffset = offset;
380-
final lineChars = line.characters;
381-
offset +=
382-
lineChars.length + (lineIdx == nodeLines.length - 1 ? 0 : 1);
383-
380+
offset += line.length + (lineIdx == nodeLines.length - 1 ? 0 : 1);
384381
final match = RegExp(r'^(\s*)').firstMatch(line);
385382
final leading = match?.group(0) ?? '';
386383
final indentLen = leading.length;
@@ -392,9 +389,9 @@ class CodeCrafterController extends TextEditingController {
392389
String accumulatedText = '';
393390
TextStyle? currentStyle;
394391

395-
for (int col = 0; col < lineChars.length; col++) {
392+
for (int col = 0; col < line.length; col++) {
396393
final globalIdx = startOfLineOffset + col;
397-
String ch = lineChars.elementAt(col);
394+
String ch = line[col];
398395
if (ch == ' ' && guideCols.contains(col)) ch = '│';
399396

400397
final bool isMatch = globalIdx == b1 || globalIdx == b2;

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: flutter_code_crafter
22
description: "Powerful code editor with AI code completion and LSP support"
3-
version: 0.2.8
3+
version: 0.2.9
44
homepage: https://github.com/heckmon/flutter_code_crafter
55

66
environment:
7-
sdk: ^3.8.1
7+
sdk: ^3.9.0
88
flutter: ">=1.17.0"
99

1010
dependencies:

0 commit comments

Comments
 (0)