parent
a096703778
commit
2e37f0e0dd
3
BUGS
3
BUGS
|
@ -1,5 +1,8 @@
|
||||||
=== OUSTANDING BUGS ===
|
=== OUSTANDING BUGS ===
|
||||||
|
|
||||||
|
2009/02/14:
|
||||||
|
slot/window width sync issues (try editing mode files for awhile)
|
||||||
|
|
||||||
2009/01/28:
|
2009/01/28:
|
||||||
completion-buffer needs to save window, instead of just saving
|
completion-buffer needs to save window, instead of just saving
|
||||||
the buffer. otherwise you lose window-customization (e.g. margins, headers,
|
the buffer. otherwise you lose window-customization (e.g. margins, headers,
|
||||||
|
|
17
mode/sql.py
17
mode/sql.py
|
@ -3,6 +3,12 @@ from lex import Grammar, PatternRule, NocasePatternRule, RegionRule, NocaseRegio
|
||||||
from mode.python import StringGrammar1, StringGrammar2
|
from mode.python import StringGrammar1, StringGrammar2
|
||||||
from method import CommentRegion, UncommentRegion
|
from method import CommentRegion, UncommentRegion
|
||||||
|
|
||||||
|
class BitStringGrammar(Grammar):
|
||||||
|
rules = [PatternRule(r'data', r'[01]+')]
|
||||||
|
|
||||||
|
class HexStringGrammar(Grammar):
|
||||||
|
rules = [NocasePatternRule(r'data', r'[0-9a-f]+')]
|
||||||
|
|
||||||
class PlPgSqlGrammar(Grammar):
|
class PlPgSqlGrammar(Grammar):
|
||||||
rules = [
|
rules = [
|
||||||
PatternRule(r'spaces', r' +'),
|
PatternRule(r'spaces', r' +'),
|
||||||
|
@ -18,7 +24,12 @@ class PlPgSqlGrammar(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|next|asc|desc|limit|distinct|cascade|alias for|using|on)(?![A-Za-z0-9_])'),
|
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|next|asc|desc|limit|distinct|cascade|alias for|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|record|row)(?![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|record|row)(?![A-Za-z0-9_])'),
|
||||||
PatternRule(r'sql_builtin', r'(?:nextval|current_timestamp|current_time|current_date)(?![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', "''", StringGrammar1, "''"),
|
RegionRule(r'string', "''", StringGrammar1, "''"),
|
||||||
|
RegionRule(r'string', "B'", BitStringGrammar, "'"),
|
||||||
|
RegionRule(r'string', "X'", HexStringGrammar, "'"),
|
||||||
RegionRule(r'sql_quoted', '"', StringGrammar2, '"'),
|
RegionRule(r'sql_quoted', '"', StringGrammar2, '"'),
|
||||||
PatternRule(r'sql_variable', r'\$[1-9][0-9]*'),
|
PatternRule(r'sql_variable', r'\$[1-9][0-9]*'),
|
||||||
PatternRule(r'sql_bareword', r'[A-Za-z0-9_]+'),
|
PatternRule(r'sql_bareword', r'[A-Za-z0-9_]+'),
|
||||||
|
@ -46,12 +57,6 @@ class FunctionGrammar(Grammar):
|
||||||
PatternRule(r'eol', r'\n'),
|
PatternRule(r'eol', r'\n'),
|
||||||
]
|
]
|
||||||
|
|
||||||
class BitStringGrammar(Grammar):
|
|
||||||
rules = [PatternRule(r'data', r'[01]+')]
|
|
||||||
|
|
||||||
class HexStringGrammar(Grammar):
|
|
||||||
rules = [NocasePatternRule(r'data', r'[0-9a-f]+')]
|
|
||||||
|
|
||||||
class SqlGrammar(Grammar):
|
class SqlGrammar(Grammar):
|
||||||
rules = [
|
rules = [
|
||||||
PatternRule(r'spaces', r' +'),
|
PatternRule(r'spaces', r' +'),
|
||||||
|
|
|
@ -223,6 +223,7 @@ class Window(object):
|
||||||
counter = 0
|
counter = 0
|
||||||
while counter < self.height / 2:
|
while counter < self.height / 2:
|
||||||
if x > self.width:
|
if x > self.width:
|
||||||
|
d = x % self.width
|
||||||
x -= self.width
|
x -= self.width
|
||||||
elif y > 0:
|
elif y > 0:
|
||||||
y -= 1
|
y -= 1
|
||||||
|
@ -231,6 +232,7 @@ class Window(object):
|
||||||
(x, y) = (0, 0)
|
(x, y) = (0, 0)
|
||||||
break
|
break
|
||||||
counter += 1
|
counter += 1
|
||||||
|
x -= (x % self.width)
|
||||||
|
|
||||||
# make sure we aren't "centering" on the end of the file (where half the
|
# make sure we aren't "centering" on the end of the file (where half the
|
||||||
# screen is empty). that is, unless that's what the user wants
|
# screen is empty). that is, unless that's what the user wants
|
||||||
|
|
Loading…
Reference in New Issue