mirror of
https://github.com/zaphar/sheetsui.git
synced 2025-07-22 13:00:22 -04:00
chore: renames and other housekeeping
This commit is contained in:
parent
fa5c2c2d58
commit
76b4d46222
@ -5,7 +5,7 @@ use slice_utils::{Measured, Peekable, Seekable, Span, StrCursor};
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub enum Cmd<'a> {
|
||||
Write(Option<&'a str>),
|
||||
InsertRow(usize),
|
||||
InsertRows(usize),
|
||||
InsertColumns(usize),
|
||||
RenameSheet(Option<usize>, &'a str),
|
||||
NewSheet(Option<&'a str>),
|
||||
@ -155,7 +155,7 @@ fn try_consume_insert_row<'cmd, 'i: 'cmd>(
|
||||
return Err("Invalid command: Did you mean to type `insert-rows <arg>`?");
|
||||
}
|
||||
let arg = input.span(0..).trim();
|
||||
return Ok(Some(Cmd::InsertRow(if arg.is_empty() {
|
||||
return Ok(Some(Cmd::InsertRows(if arg.is_empty() {
|
||||
1
|
||||
} else {
|
||||
if let Ok(count) = arg.parse() {
|
||||
|
@ -425,7 +425,7 @@ impl<'ws> Workspace<'ws> {
|
||||
self.book.evaluate();
|
||||
Ok(None)
|
||||
}
|
||||
Ok(Some(Cmd::InsertRow(count))) => {
|
||||
Ok(Some(Cmd::InsertRows(count))) => {
|
||||
self.book.insert_rows(self.book.location.row, count)?;
|
||||
self.book.evaluate();
|
||||
Ok(None)
|
||||
|
@ -35,7 +35,7 @@ fn test_insert_rows_cmd() {
|
||||
let output = result.unwrap();
|
||||
assert!(output.is_some());
|
||||
let cmd = output.unwrap();
|
||||
assert_eq!(cmd, Cmd::InsertRow(1));
|
||||
assert_eq!(cmd, Cmd::InsertRows(1));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -46,7 +46,7 @@ fn test_insert_rows_cmd_short() {
|
||||
let output = result.unwrap();
|
||||
assert!(output.is_some());
|
||||
let cmd = output.unwrap();
|
||||
assert_eq!(cmd, Cmd::InsertRow(1));
|
||||
assert_eq!(cmd, Cmd::InsertRows(1));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Loading…
x
Reference in New Issue
Block a user