From 4f86f303f5c3bb4ad5a4c7b3b720194a00e1f3bf Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Wed, 9 Aug 2023 17:13:19 +0200 Subject: [PATCH] Make functions for builtin functions public event filter names, function::set_desc, common::reformat_for_screen This is the first use for each --- fish-rust/src/common.rs | 2 +- fish-rust/src/event.rs | 2 +- fish-rust/src/function.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fish-rust/src/common.rs b/fish-rust/src/common.rs index 80baadfbf..3613f94d3 100644 --- a/fish-rust/src/common.rs +++ b/fish-rust/src/common.rs @@ -1535,7 +1535,7 @@ pub fn read_loop(fd: &Fd, buf: &mut [u8]) -> std::io::Result /// Write the given paragraph of output, redoing linebreaks to fit \p termsize. #[widestrs] -fn reformat_for_screen(msg: &wstr, termsize: &Termsize) -> WString { +pub fn reformat_for_screen(msg: &wstr, termsize: &Termsize) -> WString { let mut buff = WString::new(); let screen_width = termsize.width; diff --git a/fish-rust/src/event.rs b/fish-rust/src/event.rs index 83b4cb3f2..80b1bf1d9 100644 --- a/fish-rust/src/event.rs +++ b/fish-rust/src/event.rs @@ -826,7 +826,7 @@ fn event_fire_ffi(parser: Pin<&mut parser_t>, event: &Event) { } #[widestrs] -const EVENT_FILTER_NAMES: [&wstr; 7] = [ +pub const EVENT_FILTER_NAMES: [&wstr; 7] = [ "signal"L, "variable"L, "exit"L, diff --git a/fish-rust/src/function.rs b/fish-rust/src/function.rs index 908e80d1e..41e5535d6 100644 --- a/fish-rust/src/function.rs +++ b/fish-rust/src/function.rs @@ -291,7 +291,7 @@ fn get_function_body_source(props: &FunctionProperties) -> &wstr { /// Sets the description of the function with the name \c name. /// This triggers autoloading. -fn set_desc(name: &wstr, desc: WString, parser: &mut parser_t) { +pub fn set_desc(name: &wstr, desc: WString, parser: &mut parser_t) { parser.assert_can_execute(); load(name, parser); let mut funcset = FUNCTION_SET.lock().unwrap();