From: NeilBrown Date: Wed, 3 Feb 2016 19:54:33 +0000 (+1100) Subject: devel X-Git-Tag: lca2016~1 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=d4e67fc3af310ab1bd24e9c9c0321a604d9ae36c;p=edlib.git devel --- diff --git a/edlib.c b/edlib.c index f513a865..cac22cfb 100644 --- a/edlib.c +++ b/edlib.c @@ -17,14 +17,10 @@ #include "core.h" static char WelcomeText[] = - ":H1:center,bg:green\n" - "\n" - "# heading\n" - "line\n" "\n" "Welcome to 'edlib' - the beginning of what one day might be an editor\n" "\n" - "# Current functionality includes:\n" + "Current functionality includes:\n" " splitting and closing windows (C-x 0,1,2,3)\n" " Resize current window (C-x },{,^)\n" " Move among windows (C-x o,O or mouse click)\n" @@ -116,7 +112,7 @@ int main(int argc, char *argv[]) key_handle(&ci); /* New window.. */ - if (gtk) { + if (gtk && 0) { memset(&ci, 0, sizeof(ci)); ci.home = ci.focus = vroot; ci.key = "display-pygtk"; diff --git a/lang-python.c b/lang-python.c index a7445c55..1d06a873 100644 --- a/lang-python.c +++ b/lang-python.c @@ -649,7 +649,7 @@ static PyObject *Pane_get_item(Pane *self, PyObject *key) return NULL; } k = PyString_AsString(key); - v = attr_get_str(self->pane->attrs, k, -1); + v = pane_attr_get(self->pane, k); if (v) return Py_BuildValue("s", v); Py_INCREF(Py_None); diff --git a/python/display-pygtk.py b/python/display-pygtk.py index 3847a750..c5b4cb40 100644 --- a/python/display-pygtk.py +++ b/python/display-pygtk.py @@ -46,6 +46,8 @@ class EdDisplay(gtk.Window): self.pane['scale'] = "%d"%(int(self.pane['scale']) * 100/105) return 1 if key == "M-Chr-=" or key == "M-Chr-+": + if self.pane['scale'] is None: + self.pane['scale'] = "1000" self.pane['scale'] = "%d"%(int(self.pane['scale']) * 105/100) return 1 diff --git a/python/render-present.py b/python/render-present.py index bd25ee87..5e18585e 100644 --- a/python/render-present.py +++ b/python/render-present.py @@ -421,6 +421,14 @@ class PresenterPane(edlib.Pane): v = "" return v + def pathto(self, f): + if f[0] == '/': + return f + path = self['filename'] + if not path: + return f + return os.path.dirname(path)+'/'+f + def handle(self, key, **a): if key == "Present-BG": cmds = a['str'].split(',') @@ -429,14 +437,18 @@ class PresenterPane(edlib.Pane): if c[:6] == 'color:': f.call('pane-clear', c[6:]) if c[:14] == "image-stretch:": - f.call('image-stretch-display', self.w, self.h, c[14:], (0,0)) + f.call('image-stretch-display', self.w, self.h, self.pathto(c[14:]), (0,0)) if c[:6] == "image:": - f.call('image-display', self.w, self.h, c[6:], (0,0)) + f.call('image-display', self.w, self.h, self.pathto(c[6:]), (0,0)) if c[:8] == "overlay:": - f.call('image-display', self.w/6, self.h*3/4, c[8:], (self.w*5/6, self.h/4)) + f.call('image-display', self.w/6, self.h*3/4, self.pathto(c[8:]), (self.w*5/6, self.h/4)) + if c[:9] == "overlayC:": + f.call('image-display', self.w/6, self.h*3/4, self.pathto(c[9:]), (self.w*5/12, self.h/8)) if c == "page-local": page = self.find_pages(a['mark']) - cm = self.get_local_attr(a['mark'], "background", page) + self.clean_lines(page) + self.mark_lines(page) + cm = self.get_local_attr(a['mark'], "background", a['mark']) if cm: cmds.extend(cm.split(',')) return 1 @@ -531,7 +543,7 @@ class PresenterPane(edlib.Pane): c = -1 line = line[c+1:] - cb("callback", self, ""%(width,height)) + cb("callback", self, ""%(width,height)) return 1 line = re.sub("\*([A-Za-z0-9][^*<]*)\*", "\\1", line) diff --git a/render-lines.c b/render-lines.c index 28a892fd..ea943a1c 100644 --- a/render-lines.c +++ b/render-lines.c @@ -863,6 +863,7 @@ static void render(struct mark *pm, struct pane *p) hide_cursor = 1; restart: + m = vmark_first(p, rl->typenum); y = 0; bg = pane_attr_get(p, "background"); if (bg && strncmp(bg, "color:", 6) == 0) { @@ -882,7 +883,7 @@ restart: a = strchr(f, ':'); if (a) *a++ = 0; - call5(f, p, 0, pm, a, 0); + call5(f, p, 0, m, a, 0); free(f); } else pane_clear(p, NULL); @@ -892,7 +893,6 @@ restart: rl->header_lines = y; } y -= rl->skip_lines; - m = vmark_first(p, rl->typenum); p->cx = p->cy = -1; rl->cursor_line = 0;