double bracket tests now do regex on '==' between two strings

fixed line wrapping causing weird cursor issues
This commit is contained in:
2026-02-27 21:25:01 -05:00
parent 0c40f17b60
commit f0a000343b
3 changed files with 11 additions and 5 deletions

View File

@@ -147,7 +147,7 @@ impl MapNode {
match self { match self {
MapNode::Branch(map) => map.keys().map(|k| k.to_string()).collect(), MapNode::Branch(map) => map.keys().map(|k| k.to_string()).collect(),
MapNode::Array(nodes) => nodes.iter().filter_map(|n| n.display(false, false).ok()).collect(), MapNode::Array(nodes) => nodes.iter().filter_map(|n| n.display(false, false).ok()).collect(),
MapNode::Leaf(s) => vec![s.clone()], MapNode::Leaf(s) => vec![],
} }
} }

View File

@@ -255,8 +255,14 @@ pub fn double_bracket_test(node: Node) -> ShResult<bool> {
span: err_span, span: err_span,
}); });
} }
TestOp::StringEq => rhs.trim() == lhs.trim(), TestOp::StringEq => {
TestOp::StringNeq => rhs.trim() != lhs.trim(), let pattern = crate::expand::glob_to_regex(rhs.trim(), true);
pattern.is_match(lhs.trim())
}
TestOp::StringNeq => {
let pattern = crate::expand::glob_to_regex(rhs.trim(), true);
!pattern.is_match(lhs.trim())
}
TestOp::IntNeq TestOp::IntNeq
| TestOp::IntGt | TestOp::IntGt
| TestOp::IntLt | TestOp::IntLt

View File

@@ -835,12 +835,12 @@ impl Layout {
pos.col += c_width; pos.col += c_width;
if pos.col > term_width { if pos.col > term_width {
pos.row += 1; pos.row += 1;
pos.col = left_margin + c_width; pos.col = c_width;
} }
} }
if pos.col >= term_width { if pos.col >= term_width {
pos.row += 1; pos.row += 1;
pos.col = left_margin; pos.col = 0;
} }
pos pos