Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
46ecf70
feat: add window management foundation for split support
fcoury Jun 17, 2025
317188b
feat: implement foundation for window splits and management
fcoury Jun 17, 2025
7ea16ad
feat: implement comprehensive window splitting functionality
fcoury Jun 17, 2025
601c660
feat: make overlays window-aware
fcoury Jun 17, 2025
ed7cda5
feat: make status line window-aware
fcoury Jun 17, 2025
d412ae6
feat: implement window resizing functionality
fcoury Jun 17, 2025
36b0e60
feat: implement mouse support for window selection
fcoury Jun 17, 2025
5ae572b
docs: update window implementation plan with completed features
fcoury Jun 17, 2025
1127a38
fix: prevent arithmetic underflow in cursor positioning
fcoury Jun 17, 2025
ba45c66
fix: sync window state and render after all actions
fcoury Jun 17, 2025
4ed68a4
fix: window separator intersection detection and rendering
fcoury Jun 17, 2025
8326aa1
fix: improve window separator T-junction detection
fcoury Jun 17, 2025
b477496
fix: complete rewrite of window separator intersection detection
fcoury Jun 17, 2025
8d0036c
fix: implement two-pass algorithm for window separator rendering
fcoury Jun 17, 2025
c5b7eef
fix: improve character selection logic for window separators
fcoury Jun 17, 2025
d5a514e
fix: correct window separator intersection detection
fcoury Jun 17, 2025
f0fc809
fix: resolve all warnings and clippy errors
fcoury Jun 17, 2025
02b0f87
docs: update window implementation plan with completed features
fcoury Jun 17, 2025
b89f615
fix: window resizing commands now work correctly
fcoury Jun 17, 2025
9b2cfb0
fix: add defensive checks and logging for emoji handling
fcoury Jun 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: improve character selection logic for window separators
- Handle all possible connection patterns explicitly
- Add exhaustive match patterns for Unicode mode
- Improve ASCII mode logic to use correct characters
- Add debug logging for junction detection
- Remove fallback to '+' character in Unicode mode

This should fix the issue where all separators were rendering as '+'
characters instead of proper box-drawing characters.

πŸ€– Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
  • Loading branch information
fcoury and claude committed Jun 17, 2025
commit c5b7eefe92fddf421adddb5c3fa0e1f19cd418ea
62 changes: 45 additions & 17 deletions src/editor/rendering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ impl Editor {
}
}

log!("Temp grid has {} positions", temp_grid.len());

// Helper functions to check if a character has vertical/horizontal components
let has_vertical_component = |c: char| -> bool {
matches!(
Expand All @@ -282,7 +284,7 @@ impl Editor {
// Pass 2: Refine intersections based on adjacent cells
let mut final_grid: HashMap<(usize, usize), char> = HashMap::new();

for ((x, y), _) in &temp_grid {
for ((x, y), current_char) in &temp_grid {
// Check adjacent cells
let connects_up = if *y > 0 {
temp_grid
Expand Down Expand Up @@ -320,33 +322,59 @@ impl Editor {
false
};

log!(
" Position ({}, {}): up={}, down={}, left={}, right={}",
x,
y,
connects_up,
connects_down,
connects_left,
connects_right
);
// Only log for positions that are at intersections or have multiple connections
if (connects_up || connects_down) && (connects_left || connects_right) {
log!(
" Junction at ({}, {}): current='{}', up={}, down={}, left={}, right={}",
x,
y,
current_char,
connects_up,
connects_down,
connects_left,
connects_right
);
}

// Select the appropriate character based on connections
let junction_char = if use_ascii {
'+' // ASCII mode: always use + for any junction
// ASCII mode
if connects_up || connects_down || connects_left || connects_right {
if (connects_up || connects_down) && (connects_left || connects_right) {
'+' // Any junction or cross
} else if connects_up || connects_down {
'|' // Vertical line
} else {
'-' // Horizontal line
}
} else {
'+' // Isolated point (shouldn't happen)
}
} else {
// Unicode mode
match (connects_up, connects_down, connects_left, connects_right) {
(true, true, true, true) => 'β”Ό', // Four-way cross
(true, true, true, false) => '─', // T-junction right
(true, true, false, true) => 'β”œ', // T-junction left
(true, false, true, true) => 'β”΄', // T-junction bottom
(false, true, true, true) => '┬', // T-junction top
// Four-way cross
(true, true, true, true) => 'β”Ό',
// T-junctions
(true, true, true, false) => '─', // T-junction right
(true, true, false, true) => 'β”œ', // T-junction left
(true, false, true, true) => 'β”΄', // T-junction bottom
(false, true, true, true) => '┬', // T-junction top
// Corners
(true, false, false, true) => 'β””', // Corner bottom-left
(true, false, true, false) => 'β”˜', // Corner bottom-right
(false, true, false, true) => 'β”Œ', // Corner top-left
(false, true, true, false) => '┐', // Corner top-right
// Straight lines
(true, true, false, false) => 'β”‚', // Vertical only
(false, false, true, true) => '─', // Horizontal only
_ => '+', // Fallback for any other case
// Single connections (line ends)
(true, false, false, false) => 'β”‚', // Vertical from top
(false, true, false, false) => 'β”‚', // Vertical to bottom
(false, false, true, false) => '─', // Horizontal from left
(false, false, false, true) => '─', // Horizontal to right
// No connections (shouldn't happen in practice)
(false, false, false, false) => 'Β·', // Isolated point
}
};

Expand Down