Skip to content

Commit

Permalink
Stopped autocapitalisation of keywords proceeded by backslash
Browse files Browse the repository at this point in the history
  • Loading branch information
autophagy committed Feb 23, 2017
1 parent 37b131c commit 41767f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/crate/crash/repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def is_multiline():

class Capitalizer:

KEYWORD_RE = r'(?:"\w+)|(?:\'\w+)|\w+'
KEYWORD_RE = r'(?:"\w+)|(?:\'\w+)|(?:\\\w+)|\w+'

def __init__(self, cmd):
self.cmd = cmd
Expand Down
4 changes: 4 additions & 0 deletions src/crate/crash/test_repl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
buffer.set_document(Document(text, len(text)))
self.capitalizer(buffer)
self.assertEqual(u'\select', buffer.text)

def test_undo_capitalize(self):
buffer = Buffer()
Expand Down

0 comments on commit 41767f8

Please sign in to comment.