@@ -982,6 +982,19 @@ mod cmd {
982 fn set_indent_style(editor: &mut Editor, args: &[&str], event: PromptEvent) {
982 fn set_indent_style(editor: &mut Editor, args: &[&str], event: PromptEvent) {
983 use IndentStyle::*;
983 use IndentStyle::*;
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.
997+ // Attempt to parse argument as an indent style.
985 let style = match args.get(0) {
998 let style = match args.get(0) {
986 Some(arg) if "tabs".starts_with(&arg.to_lowercase()) => Some(Tabs),
999 Some(arg) if "tabs".starts_with(&arg.to_lowercase()) => Some(Tabs),
987 Some(&"0") => Some(Tabs),
1000 Some(&"0") => Some(Tabs),
@@ -996,6 +1009,9 @@ mod cmd {
996 if let Some(s) = style {
1009 if let Some(s) = style {
997 let (_, doc) = editor.current();
1010 let (_, doc) = editor.current();
998 doc.indent_style = s;
1011 doc.indent_style = s;
1013+ // Invalid argument.
1014+ editor.set_error(format!("invalid indent style '{}'", args[0],));