\brief Add command to history
| 216 | |
| 217 | /// \brief Add command to history |
| 218 | void CLIWide::add_to_history(const std::string& command) { |
| 219 | if (command.empty()) return; |
| 220 | |
| 221 | // Remove duplicate if it exists |
| 222 | auto it = std::find(command_history.begin(), command_history.end(), command); |
| 223 | if (it != command_history.end()) { |
| 224 | command_history.erase(it); |
| 225 | } |
| 226 | |
| 227 | // Add to end |
| 228 | command_history.push_back(command); |
| 229 | |
| 230 | // Limit history size |
| 231 | while (command_history.size() > max_history_size) { |
| 232 | command_history.pop_front(); |
| 233 | } |
| 234 | |
| 235 | // Reset history navigation index |
| 236 | history_index = -1; |
| 237 | } |
| 238 | |
| 239 | /// \brief Move cursor to specific column |
| 240 | void CLIWide::move_cursor_to_column(int column) { |