use crate::defaults;
use derive_builder::Builder;
pub use file_encoding::*;
pub use file_format::*;
pub mod file_encoding;
pub mod file_format;
#[cfg(test)]
mod file_encoding_tests;
#[cfg(test)]
mod file_format_tests;
#[derive(Debug, Copy, Clone, Builder)]
pub struct BufferOptions {
#[builder(default = defaults::buf::TAB_STOP)]
tab_stop: u16,
#[builder(default = defaults::buf::EXPAND_TAB)]
expand_tab: bool,
#[builder(default = defaults::buf::SHIFT_WIDTH)]
shift_width: u16,
#[builder(default = defaults::buf::FILE_ENCODING)]
file_encoding: FileEncodingOption,
#[builder(default = defaults::buf::FILE_FORMAT)]
file_format: FileFormatOption,
}
impl BufferOptions {
pub fn tab_stop(&self) -> u16 {
self.tab_stop
}
pub fn set_tab_stop(&mut self, value: u16) {
self.tab_stop = value;
}
pub fn expand_tab(&self) -> bool {
self.expand_tab
}
pub fn set_expand_tab(&mut self, value: bool) {
self.expand_tab = value;
}
pub fn shift_width(&self) -> u16 {
self.shift_width
}
pub fn set_shift_width(&mut self, value: u16) {
self.shift_width = value;
}
pub fn file_encoding(&self) -> FileEncodingOption {
self.file_encoding
}
pub fn set_file_encoding(&mut self, value: FileEncodingOption) {
self.file_encoding = value;
}
pub fn file_format(&self) -> FileFormatOption {
self.file_format
}
pub fn set_file_format(&mut self, value: FileFormatOption) {
self.file_format = value;
}
pub fn end_of_line(&self) -> EndOfLineOption {
self.file_format.into()
}
}