diff --git a/src/command_manager.cc b/src/command_manager.cc index be2aa79e..e5854b7b 100644 --- a/src/command_manager.cc +++ b/src/command_manager.cc @@ -85,9 +85,9 @@ public: return {}; } - DisplayCoord coord() const + BufferCoord coord() const { - return {line, utf8::column_distance(line_start, pos)}; + return {line, (int)(pos - line_start)}; } StringView str; @@ -432,7 +432,7 @@ CommandManager::find_command(const Context& context, StringView name) const void CommandManager::execute_single_command(CommandParameters params, Context& context, const ShellContext& shell_context, - DisplayCoord pos) + BufferCoord pos) { if (params.empty()) return; @@ -481,7 +481,7 @@ void CommandManager::execute(StringView command_line, // Tokens are going to be read as a stack std::reverse(tokens.begin(), tokens.end()); - DisplayCoord command_coord; + BufferCoord command_coord; Vector params; while (not tokens.empty()) { diff --git a/src/command_manager.hh b/src/command_manager.hh index d3ecab18..87ce3f1c 100644 --- a/src/command_manager.hh +++ b/src/command_manager.hh @@ -57,7 +57,7 @@ struct Token Type type; ByteCount begin; ByteCount end; - DisplayCoord coord; + BufferCoord coord; String content; }; @@ -99,7 +99,7 @@ private: void execute_single_command(CommandParameters params, Context& context, const ShellContext& shell_context, - DisplayCoord pos); + BufferCoord pos); struct Command {