Apply the TODO keyword settings.

This commit is contained in:
Tom Alexander
2023-09-06 11:00:19 -04:00
parent bdba495f69
commit 70fafd801e
4 changed files with 49 additions and 5 deletions

View File

@@ -18,6 +18,7 @@ use nom::multi::many_till;
use nom::multi::separated_list1;
use nom::sequence::tuple;
use super::in_buffer_settings::apply_in_buffer_settings;
use super::in_buffer_settings::scan_for_in_buffer_settings;
use super::org_source::OrgSource;
use super::token::AllTokensIterator;
@@ -124,6 +125,15 @@ fn document_org_source<'b, 'g, 'r, 's>(
final_settings.extend(setup_file_settings);
}
final_settings.extend(document_settings);
let new_settings = apply_in_buffer_settings(final_settings, context.get_global_settings()).map_err(|_err| {
nom::Err::Error(CustomError::MyError(MyError(
"TODO: make this take an owned string so I can dump err.to_string() into it."
.into(),
)))
})?;
let new_context = context.with_global_settings(&new_settings);
let context = &new_context;
// TODO: read the keywords into settings and apply them to the GlobalSettings.
let (remaining, document) =