We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 034d149 commit 16957ecCopy full SHA for 16957ec
crates/repl_cli/src/lib.rs
@@ -52,10 +52,25 @@ pub fn main() -> i32 {
52
loop {
53
match editor.readline(PROMPT) {
54
Ok(line) => {
55
- let line = line.trim();
+ let line = line.trim_end();
56
+ if line.trim().is_empty() {
57
+ // empty lines are ignored
58
+ println!();
59
+ continue;
60
+ }
61
62
editor.add_history_entry(line);
63
64
+ if line
65
+ .lines()
66
+ .map(|ln| ln.trim())
67
+ .all(|ln| ln.is_empty() || ln.starts_with('#'))
68
+ {
69
+ // if there are only whitespaces and comments, don't run it
70
71
72
73
+
74
let repl_state = &mut editor
75
.helper_mut()
76
.expect("Editor helper was not set")
0 commit comments