context bugs + 2.4 support

--HG--
branch : pmacs2
This commit is contained in:
moculus 2008-05-12 20:55:20 +00:00
parent 510e98dc92
commit 4fb7ca5c53
3 changed files with 11 additions and 7 deletions

View File

@ -2,7 +2,7 @@
import curses, curses.ascii, getpass, os, re, string, sys, termios, time
import traceback
from subprocess import Popen, PIPE, STDOUT
from collections import defaultdict
#from collections import defaultdict
import buffer, bufferlist, color, completer, keyinput, method, minibuffer, mode
import util, window
@ -43,7 +43,8 @@ class Application(object):
# initialize some basic stuff
# a highlighted_range contains three things: (window, start_p, end_p)
self.state = defaultdict(lambda: {})
#self.state = defaultdict(lambda: {})
self.state = {}
self.config = {}
self.highlighted_ranges = []
self.mini_active = False

View File

@ -6,9 +6,11 @@ class Context(object):
self.namelines = None
def region_added(self, p, newlines):
if self.names:
self.adjust_name_map(p, len(newlines) - 1)
self.rebuild_name_map(p.y, p.y + len(newlines))
def region_removed(self, p1, p2):
if self.names:
self.adjust_name_map(p2, p1.y - p2.y)
self.rebuild_name_map(p1.y, p1.y + 1)

View File

@ -541,7 +541,7 @@ class PerlContext(context.Context):
if t.name in m.opentokens and t.string in m.opentags:
stack.append(t.string)
elif t.name in m.closetokens and t.string in m.closetags:
if stack[-1] == m.closetags[t.string]:
if stack and stack[-1] == m.closetags[t.string]:
stack.pop(-1)
if t.string == '}' and not stack:
curr = None
@ -703,6 +703,7 @@ class Perl(mode.Fundamental):
def get_inc(self):
a = self.window.application
a.state.setdefault('perl', {})
if 'inc' not in a.state['perl']:
perllib = a.config.get('perl.lib')
if perllib: