You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

17 lines
439 B

use crate::lexer::Position;
pub fn highlight_position_in_file(input: String, position: Position) -> String {
// TODO: Chain without collecting in between
input
.chars()
.skip(position.raw)
.take_while(|c| c != &'\n')
.collect::<String>()
.chars()
.rev()
.take_while(|c| c != &'\n')
.collect::<String>()
.chars()
.rev()
.collect::<String>()
}