Fix canvas.split on non-fore situation.
authorRui Guo <firemeteor.guo@gmail.com>
Thu, 13 Aug 2009 15:00:25 +0000 (13 23:00 +0800)
committerRui Guo <firemeteor.guo@gmail.com>
Thu, 13 Aug 2009 15:00:25 +0000 (13 23:00 +0800)
src/lua.c

index 8547e55..08048ea 100644 (file)
--- a/src/lua.c
+++ b/src/lua.c
@@ -686,12 +686,15 @@ static int
 canvas_split(lua_State *L)
 {
   struct canvas *c = check_canvas(L, 1);
+  struct canvas *oldfore = D_forecv;
+  D_forecv = c;
   int hori = lua_toboolean(L, 2);
   if (hori)
     AddCanvas(SLICE_HORI);
   else
     AddCanvas(SLICE_VERT);
   Activate(-1);
+  D_forecv = oldfore;
   return 0;
 }