@@ -982,6 +982,19 @@ mod cmd {
982982 fn set_indent_style(editor: &mut Editor, args: &[&str], event: PromptEvent) {
983983 use IndentStyle::*;
984984
985+ // If no argument, report current indent style.
986+ if args.is_empty() {
987+ let style = editor.current().1.indent_style;
988+ editor.set_status(match style {
989+ Tabs => "tabs".into(),
990+ Spaces(1) => "1 space".into(),
991+ Spaces(n) if (2..=8).contains(&n) => format!("{} spaces", n),
992+ _ => "error".into(), // Shouldn't happen.
993+ });
994+ return;
995+ }
996+
997+ // Attempt to parse argument as an indent style.
985998 let style = match args.get(0) {
986999 Some(arg) if "tabs".starts_with(&arg.to_lowercase()) => Some(Tabs),
9871000 Some(&"0") => Some(Tabs),
@@ -996,6 +1009,9 @@ mod cmd {
9961009 if let Some(s) = style {
9971010 let (_, doc) = editor.current();
9981011 doc.indent_style = s;
1012+ } else {
1013+ // Invalid argument.
1014+ editor.set_error(format!("invalid indent style '{}'", args[0],));
9991015 }
10001016 }
10011017