From 2e37f0e0dd7c10d71d27cc46be4ce32d5ed62c13 Mon Sep 17 00:00:00 2001 From: moculus Date: Sat, 14 Feb 2009 14:50:25 +0000 Subject: [PATCH] --HG-- branch : pmacs2 --- BUGS | 3 +++ mode/sql.py | 17 +++++++++++------ window.py | 2 ++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/BUGS b/BUGS index 12707ef..636a38b 100644 --- a/BUGS +++ b/BUGS @@ -1,5 +1,8 @@ === OUSTANDING BUGS === +2009/02/14: + slot/window width sync issues (try editing mode files for awhile) + 2009/01/28: completion-buffer needs to save window, instead of just saving the buffer. otherwise you lose window-customization (e.g. margins, headers, diff --git a/mode/sql.py b/mode/sql.py index 5450384..f8d344b 100644 --- a/mode/sql.py +++ b/mode/sql.py @@ -3,6 +3,12 @@ from lex import Grammar, PatternRule, NocasePatternRule, RegionRule, NocaseRegio from mode.python import StringGrammar1, StringGrammar2 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): rules = [ 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'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'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', "B'", BitStringGrammar, "'"), + RegionRule(r'string', "X'", HexStringGrammar, "'"), RegionRule(r'sql_quoted', '"', StringGrammar2, '"'), PatternRule(r'sql_variable', r'\$[1-9][0-9]*'), PatternRule(r'sql_bareword', r'[A-Za-z0-9_]+'), @@ -46,12 +57,6 @@ class FunctionGrammar(Grammar): 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): rules = [ PatternRule(r'spaces', r' +'), diff --git a/window.py b/window.py index 1dac58f..a57668b 100644 --- a/window.py +++ b/window.py @@ -223,6 +223,7 @@ class Window(object): counter = 0 while counter < self.height / 2: if x > self.width: + d = x % self.width x -= self.width elif y > 0: y -= 1 @@ -231,6 +232,7 @@ class Window(object): (x, y) = (0, 0) break counter += 1 + x -= (x % self.width) # 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