File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
crates/emmylua_code_analysis/src/compilation/analyzer/doc Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,6 @@ pub fn preprocess_description(mut description: &str, owner: Option<&LuaSemanticD
112112 let mut start_with_one_space = None ;
113113 for mut line in lines {
114114 let indent_count = line. chars ( ) . take_while ( |c| c. is_whitespace ( ) ) . count ( ) ;
115-
116115 if indent_count == line. len ( ) {
117116 // empty line
118117 result. push ( '\n' ) ;
@@ -124,8 +123,12 @@ pub fn preprocess_description(mut description: &str, owner: Option<&LuaSemanticD
124123 }
125124
126125 if let Some ( true ) = start_with_one_space {
127- if indent_count > 0 {
128- line = & line[ 1 ..] ;
126+ let mut chars = line. chars ( ) ;
127+ let first_char = chars. next ( ) ;
128+ if let Some ( c) = first_char
129+ && c. is_whitespace ( )
130+ {
131+ line = chars. as_str ( ) ;
129132 }
130133 }
131134
You can’t perform that action at this time.
0 commit comments