Skip to content

Commit 526caef

Browse files
unhappychoiceclaude
andcommitted
fix: restore enter symbol (↵) display in ratatui interface
The enter symbol was not being displayed in the ratatui-based display because newline characters were being skipped without rendering the visual marker. This fix adds the enter symbol (↵) rendering with proper styling based on typing position and state. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a10840e commit 526caef

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/game/display_ratatui.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,25 @@ impl GameDisplayRatatui {
171171
for (i, &ch) in self.chars.iter().enumerate() {
172172
// Handle explicit newlines
173173
if ch == '\n' {
174+
// Use cached properties for newline styling
175+
let should_skip = skip_cache.get(&i).copied().unwrap_or(false);
176+
let is_comment = comment_cache.get(&i).copied().unwrap_or(false);
177+
let is_current_line = line_number == current_line_number;
178+
179+
if !should_skip {
180+
let style = self.get_char_style_with_highlight(
181+
i,
182+
current_position,
183+
should_skip,
184+
is_comment,
185+
current_mistake_position,
186+
is_current_line,
187+
);
188+
189+
// Show newline as enter symbol
190+
current_line_spans.push(Span::styled("↵".to_string(), style));
191+
}
192+
174193
lines.push(Line::from(current_line_spans));
175194
current_line_spans = Vec::new();
176195
current_line_width = 0;

0 commit comments

Comments
 (0)