#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"
key_handle(&ci);
/* New window.. */
- if (gtk) {
+ if (gtk && 0) {
memset(&ci, 0, sizeof(ci));
ci.home = ci.focus = vroot;
ci.key = "display-pygtk";
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(',')
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
c = -1
line = line[c+1:]
- cb("callback", self, "<image:"+line+",width:%d,height:%d>"%(width,height))
+ cb("callback", self, "<image:"+self.pathto(line)+",width:%d,height:%d>"%(width,height))
return 1
line = re.sub("\*([A-Za-z0-9][^*<]*)\*", "<italic>\\1</>", line)
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) {
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);
rl->header_lines = y;
}
y -= rl->skip_lines;
- m = vmark_first(p, rl->typenum);
p->cx = p->cy = -1;
rl->cursor_line = 0;