c_formatter_42 icon indicating copy to clipboard operation
c_formatter_42 copied to clipboard

Does not break lines over 80 characters in assignment or comparison when having pointer casts and arrow notation

Open bcheronn opened this issue 1 year ago • 0 comments

Version

pip list
Package                Version
---------------------- ------------------------------------
...
c-formatter-42         0.2.7

The following code is properly formatted:

void	ft_example(void)
{
	t_list	*element;
	t_list	*next_element;

	((t_node *)element->content)->index
		+= ((t_node *)next_element->content)->index;
	if (((t_node *)element->content)->index
		&& ((t_node *)next_element->content)->index)
		exec_logic(element);
}

whereas this one is not (the only difference being the operators used in the assignment and the comparison:

void	ft_example(void)
{
	t_list	*element;
	t_list	*next_element;

	((t_node *)element->content)->index = ((t_node *)next_element->content)->index;
	if (((t_node *)element->content)->index > ((t_node *)next_element->content)->index)
		exec_logic(element);
}

Tested using the formatter only, without any extension

bcheronn avatar Dec 10 '23 18:12 bcheronn