diff --git a/src/Context.cpp b/src/Context.cpp index a65d9426b..96ad74c3a 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -168,10 +168,6 @@ int Context::initialize (int argc, const char** argv) a3t.entity ("readcmd", cmd->first); else a3t.entity ("writecmd", cmd->first); - - // TODO Entities: Reports. - // TODO Entities: Special commands. - // TODO Need: bool Command::report() - maybe not. } // Instantiate built-in column objects. diff --git a/src/DOM.cpp b/src/DOM.cpp index 2c7296df5..2745d5b7c 100644 --- a/src/DOM.cpp +++ b/src/DOM.cpp @@ -89,8 +89,21 @@ const std::string DOM::get (const std::string& name) if (len > 8 && name.substr (0, 8) == "context.") { - if (name == "context.program") return context.a3[0]._raw; - else if (name == "context.args") return context.a3.combine (); + if (name == "context.program") return context.a3t.tree ()->_branches[0]->attribute ("raw"); + else if (name == "context.args") + { + std::string combined; + std::vector ::iterator i; + for (i = context.a3t.tree ()->_branches.begin (); i != context.a3t.tree ()->_branches.end (); ++i) + { + if (combined != "") + combined += " "; + + combined += (*i)->attribute ("raw"); + } + + return combined; + } else if (name == "context.width") return format (context.terminal_width ? context.terminal_width : context.getWidth ()); else if (name == "context.height") return format (context.terminal_height ? context.terminal_height : context.getHeight ()); else throw format (STRING_DOM_UNREC, name); diff --git a/src/text.cpp b/src/text.cpp index 54138a4cb..b75d2db01 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -249,6 +249,7 @@ int longestLine (const std::string& input) return longest; } +//////////////////////////////////////////////////////////////////////////////// // Walk the input text looking for a break point. A break point is one of: // - EOS // - \n @@ -256,7 +257,7 @@ int longestLine (const std::string& input) // - last punctuation (, ; . :) before 'length' characters, even if not // followed by a space // - first 'length' characters - +// // text "one two three\n four" // bytes 0123456789012 3456789 // characters 1234567890a23 4567890