-
Notifications
You must be signed in to change notification settings - Fork 13
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
Stopped autocapitalisation of backslash preceded keywords #175
Conversation
Codecov Report
@@ Coverage Diff @@
## master #175 +/- ##
==========================================
+ Coverage 81.11% 81.17% +0.06%
==========================================
Files 16 16
Lines 1859 1865 +6
==========================================
+ Hits 1508 1514 +6
Misses 351 351
Continue to review full report at Codecov.
|
1 similar comment
src/crate/crash/repl.py
Outdated
@@ -222,7 +222,7 @@ def is_multiline(): | |||
|
|||
class Capitalizer: | |||
|
|||
KEYWORD_RE = r'(?:"\w+)|(?:\'\w+)|\w+' | |||
KEYWORD_RE = r'(?:"\w+)|(?:\'\w+)|(?:\\\w+)|\w+' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this does not catch the case \format dynamic
You need to disable auto-captialisation when line starts with \
src/crate/crash/test_repl.py
Outdated
@@ -83,6 +83,10 @@ def test_capitalize(self): | |||
self.capitalizer(buffer) | |||
self.assertEqual(u'CREATE TABLE test\n(a BOOLEAN, b STRING, c INTEGER)', buffer.text) | |||
|
|||
text = u'\select' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text = u'\format dynamic'
src/crate/crash/repl.py
Outdated
if self.last_changed and self.is_prefix(current_line[:cursor_position].lower(), self.last_changed.lower()): | ||
diff = len(self.last_changed) - len(current_line) | ||
current_line = self.last_changed + current_line[diff:] | ||
if current_line[0] != '\\': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code style: make as little indentation (nested if blocks) as possible
if current_line.startswith('\\'):
return
then you can leave the indentation of the rest as is
1 similar comment
1 similar comment
f5b8ff3
to
fd4334c
Compare
No description provided.