From 196eeb8e79c6354003585de1b558cd52a92f8f07 Mon Sep 17 00:00:00 2001 From: Bob Farrell Date: Mon, 15 Dec 2008 19:12:32 +0000 Subject: [PATCH] self now highlighted differently in arg list --- CHANGELOG | 2 ++ bpython/cli.py | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 87d4392..07349e8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,8 @@ Menno sent me some patches to fix some stuff: * Socket error handled when submitting to a pastebin. * Resizing could crash if you resize small enough. +'self' in arg list is now highlighted a different colour. + v0.7.1 ====== Added support for a history file, defaults to ~/.pythonhist and 100 lines but diff --git a/bpython/cli.py b/bpython/cli.py index e345e2d..d55295f 100644 --- a/bpython/cli.py +++ b/bpython/cli.py @@ -654,8 +654,13 @@ class Repl(object): r += 1 self.list_win.addstr('\n\t') + if str(i) == 'self' and k == 0: + color = self._C["r"] + else: + color = self._C["g"] + self.list_win.addstr(str(i), - curses.color_pair(self._C["g"]+1) | curses.A_BOLD) + curses.color_pair(color + 1) | curses.A_BOLD) if kw: self.list_win.addstr('=', curses.color_pair(self._C["c"]+1)) self.list_win.addstr(kw, curses.color_pair(self._C["g"]+1))