about summary refs log tree commit diff
path: root/src/string.rs
diff options
context:
space:
mode:
authorPavel Sountsov <siege@google.com>2015-09-05 22:39:28 -0700
committerSiegeLord <slabode@aim.com>2015-09-19 10:36:45 -0700
commitd4108a3029cecf7855514f568f8b3b88edcbfdb7 (patch)
tree7f7fd3736a20190e8008aa63d9f557716de45621 /src/string.rs
parent4e1fff8710d9ad67cdfac08dbd6ffcb0c6fc4bc4 (diff)
Initial implementation of hard tab indentation.
Diffstat (limited to 'src/string.rs')
-rw-r--r--src/string.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/string.rs b/src/string.rs
index 5e5af61faf5..3da0a5f4a25 100644
--- a/src/string.rs
+++ b/src/string.rs
@@ -13,6 +13,8 @@
 use unicode_segmentation::UnicodeSegmentation;
 use regex::Regex;
 
+use Indent;
+use config::Config;
 use utils::{make_indent, round_up_to_power_of_two};
 
 use MIN_STRING;
@@ -23,8 +25,9 @@ pub struct StringFormat<'a> {
     pub line_start: &'a str,
     pub line_end: &'a str,
     pub width: usize,
-    pub offset: usize,
+    pub offset: Indent,
     pub trim_end: bool,
+    pub config: &'a Config,
 }
 
 // TODO: simplify this!
@@ -36,7 +39,7 @@ pub fn rewrite_string<'a>(s: &str, fmt: &StringFormat<'a>) -> String {
 
     let graphemes = UnicodeSegmentation::graphemes(&*stripped_str, false).collect::<Vec<&str>>();
 
-    let indent = make_indent(fmt.offset);
+    let indent = make_indent(fmt.offset, fmt.config);
     let indent = &indent;
 
     let mut cur_start = 0;