OSDN Git Service

Tertiary Ideographic Plane
[luatex-ja/luatexja.git] / src / ltj-direction.lua
index 0df63db..e97da05 100644 (file)
@@ -640,7 +640,7 @@ do
       local bh = getlist(b)
       local box_dir, dn =  get_box_dir(b, ltjs.list_dir)
       -- 既に b の中身にあるwhatsit
-      if not dn then
+      if (box_dir<dir_node_auto) and (not dn) then
        bh = create_dir_whatsit(bh, 'make_dir_whatsit', dir_yoko)
        dn = bh; setfield(b, 'head', bh)
       end
@@ -1013,7 +1013,7 @@ do
         split_dir_whatsit = hd
       elseif gc=='split_off'  then
         if split_dir_head then
-           list_dir = has_attr(split_dir_head, attr_dir)
+           ltjs.list_dir = has_attr(split_dir_head, attr_dir)
            hd = insert_before(hd, hd, split_dir_head)
            split_dir_head=nil
         end
@@ -1067,6 +1067,11 @@ do
    local finalize_inner
    local function finalize_dir_node(db,new_dir)
       local b = getlist(db)
+      if getid(b)==id_whatsit and getsubtype(b)==sid_user
+         and getfield(b, 'user_id')==DIR then
+         local ob = b; b = node_remove(b,b); setfield(db, 'head', b);
+        node_free(ob)
+      end
       finalize_inner(b)
       local w = getfield(b, 'width')
       local h = getfield(b, 'height')