Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bcheronn opened this issue Dec 10, 2023 · 0 comments

Comments

@bcheronn
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant