summaryrefslogtreecommitdiffstats
path: root/src/buffer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.rs')
-rw-r--r--src/buffer.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/buffer.rs b/src/buffer.rs
index a9d925b..7ed05ba 100644
--- a/src/buffer.rs
+++ b/src/buffer.rs
@@ -565,7 +565,7 @@ pub fn getline(
Key::Else(c) => {
let mut buffer = buffer.lock().unwrap();
match buffer.last() {
- Some(last) if *last == '/' && c == '/' => {
+ Some(last) if *comp_pos.lock().unwrap() != 0 && *last == '/' && c == '/' => {
buffer.pop();
*pos.lock().unwrap() -= 1;
print!("\u{8} \u{8}")
@@ -577,7 +577,6 @@ pub fn getline(
let trunc_width = UnicodeWidthStr::width(trunc.as_str());
buffer.insert(*pos.lock().unwrap(), c);
*pos.lock().unwrap() += 1;
- // *pos.lock().unwrap() += UnicodeWidthChar::width(c).unwrap_or(1);
if *pos.lock().unwrap() == buffer.len() {
print!("{}", c);
} else {