mo money mo bugz

--HG--
branch : pmacs2
This commit is contained in:
moculus 2009-02-14 14:40:23 +00:00
parent 90a955e2bf
commit a096703778
2 changed files with 15 additions and 8 deletions

View File

@ -69,11 +69,14 @@ class SqlGrammar(Grammar):
NocasePatternRule(r'pseudokeyword', r'(?:returns|language|right join|left join|inner join|outer join|join|where|unknown|null|true|false|into|values|as|from|order by|asc|desc|limit|distinct|cascade|using|on)(?![A-Za-z0-9_])'),
NocasePatternRule(r'sql_type', r'(?:void|row|serial|varchar|float|integer|int|text|timestamptz|timestamp|datetz|date|timetz|time|boolean|bool)(?![A-Za-z0-9_])'),
PatternRule(r'sql_builtin', r'(?:nextval|current_timestamp|current_time|current_date)(?![A-Za-z0-9_])'),
PatternRule(r'number', r'[0-9]+(?:e[+-]?[0-9]+)?'),
PatternRule(r'number', r'[0-9]+\.(?:[0-9]+)?(?:e[+-]?[0-9]+)?'),
PatternRule(r'number', r'\.[0-9]+(?:e[+-]?[0-9]+)'),
RegionRule(r'string', "B'", BitStringGrammar, "'"),
RegionRule(r'string', "X'", HexStringGrammar, "'"),
RegionRule(r'string', "'", StringGrammar1, "'"),
RegionRule(r'sql_quoted', '"', StringGrammar2, '"'),
PatternRule(r'sql_bareword', r'[A-Za-z0-9_]+'),
NocasePatternRule(r'sql_bareword', r'[a-z_][a-z0-9_]*'),
PatternRule(r'empty', r'^ *\n$'),
PatternRule(r'eol', r'\n'),
]

View File

@ -472,15 +472,19 @@ class Window(object):
def last_visible_coords(self):
(x, y) = self.buffer.get_buffer_end().xy()
if x == 0:
y -= 1
x = len(self.buffer.lines[y])
else:
x -= 1
#if x == 0:
# y -= 1
# x = len(self.buffer.lines[y])
#else:
# x -= 1
counter = 0
# 3 means last line we see + one blank line of context
# 3 means last line we see + 2 blank line of context
while counter < self.height - 3:
if x > self.width:
d = x % self.width
if d:
x -= d
else:
x -= self.width
elif y > 0:
y -= 1