From f0ffa4f56c482c2a9ba0ff55117d564dac1edfeb Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Tue, 4 Feb 2014 14:26:29 +0400 Subject: [PATCH] Don't wrap before dot (PY-5464). --- .../jetbrains/python/formatter/PyLineWrapPositionStrategy.java | 3 --- python/testData/wrap/DontWrapStartOfString.after.py | 2 +- python/testData/wrap/DontWrapStartOfString.py | 2 +- python/testData/wrap/wrapRightMargin.after.py | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/python/src/com/jetbrains/python/formatter/PyLineWrapPositionStrategy.java b/python/src/com/jetbrains/python/formatter/PyLineWrapPositionStrategy.java index 419d97c9e5d4..47b6b7cd84f3 100644 --- a/python/src/com/jetbrains/python/formatter/PyLineWrapPositionStrategy.java +++ b/python/src/com/jetbrains/python/formatter/PyLineWrapPositionStrategy.java @@ -45,9 +45,6 @@ public class PyLineWrapPositionStrategy extends GenericLineWrapPositionStrategy addRule(new Rule('(', WrapCondition.AFTER)); addRule(new Rule('[', WrapCondition.AFTER)); addRule(new Rule('{', WrapCondition.AFTER)); - - // Symbols to wrap before - addRule(new Rule('.', WrapCondition.BEFORE)); } @Override diff --git a/python/testData/wrap/DontWrapStartOfString.after.py b/python/testData/wrap/DontWrapStartOfString.after.py index 5fb7919f6566..f3fc48a40b13 100644 --- a/python/testData/wrap/DontWrapStartOfString.after.py +++ b/python/testData/wrap/DontWrapStartOfString.after.py @@ -1,2 +1,2 @@ -call_command('.' +call_command(' ' 'regressiontests_some_long_text_here_to_test_right_margin_some_long_text_here_to_test_right_margin_some_long_text_here_to_test_right_margin') \ No newline at end of file diff --git a/python/testData/wrap/DontWrapStartOfString.py b/python/testData/wrap/DontWrapStartOfString.py index 06487362ca6a..06905d20af00 100644 --- a/python/testData/wrap/DontWrapStartOfString.py +++ b/python/testData/wrap/DontWrapStartOfString.py @@ -1 +1 @@ -call_command('.regressiontests') \ No newline at end of file +call_command(' regressiontests') \ No newline at end of file diff --git a/python/testData/wrap/wrapRightMargin.after.py b/python/testData/wrap/wrapRightMargin.after.py index 25659fac3a8b..1d20b403c0ce 100644 --- a/python/testData/wrap/wrapRightMargin.after.py +++ b/python/testData/wrap/wrapRightMargin.after.py @@ -1,4 +1,4 @@ def do_stuff(): another_long_variable = a_really_long_function_name_with_parameters(12, this_is_the_first_param=23, - this_is_the_second=45).do_more_stuff_to_the_result() + this_is_the_second=45).do_more_stuff_to_the_result()