Infintyyy
Infintyyy

Reputation: 949

How to change Pycharm auto-format?

I am using pycharm as my editor in python. One problem I have with it is that whenever I press autoformat (command+option+l), it causes some of my code lines to be broken into several lines. For example, this code:

        percentage_optimal_arm = self.main_program.compute_percentage_optimal_arm(algorithm_instance.chosen_arm_history,self.k_value_of_arms_list)

breaks to this:

percentage_optimal_arm = self.main_program.compute_percentage_optimal_arm(
                algorithm_instance.chosen_arm_history, self.k_value_of_arms_list)

This is really annoying as my screen is big enough to include the whole line and it makes my whole code looks ugly. Is there a way to increase the limit for breaking lines in pycharm?

Upvotes: 2

Views: 1010

Answers (1)

Morse
Morse

Reputation: 9115

Change Hard Wrap value at Settings > Editor > Code Style > Python

Default is 120 line spaces. Change it your desired value ex: 180

enter image description here

Upvotes: 4

Related Questions