fixes help display on aux text.
authorPeng Wu <alexepico@gmail.com>
Wed, 23 Jun 2010 02:48:29 +0000 (10:48 +0800)
committerPeng Wu <alexepico@gmail.com>
Wed, 23 Jun 2010 02:48:29 +0000 (10:48 +0800)
src/ExtEditor.cc
src/ExtEditor.h

index 91e4994..36e6cea 100644 (file)
@@ -540,7 +540,12 @@ ExtEditor::updateStateFromInput (void)
             }
 
             if ( command->help ){
-                m_auxiliary_text += "\t[";
+                int space_len = std::max ( 0, m_aux_text_len
+                                           - (int) strlen (command->help)
+                                           - 2 /* length of "[...]" */);
+                m_auxiliary_text.append(space_len, ' ');
+
+                m_auxiliary_text += "[";
                 m_auxiliary_text += command->help;
                 m_auxiliary_text += "]";
             }
index 26bedb3..5292c24 100644 (file)
@@ -94,6 +94,8 @@ private:
     int m_result_num;
     const lua_command_candidate_t * m_candidate;
     GArray * m_candidates;
+
+    const static int m_aux_text_len = 50;
 };
 
 };