diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-04-11 13:45:28 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-04-11 13:45:28 +0200 |
| commit | 8b829d1cdfa0be593eb72145c0dae07eaadc3568 (patch) | |
| tree | ec1a82adb52a633ba5a38e6e270fb56870001fbb /src | |
| parent | 1398641d22da7b313129dde7bad7134ac19589d4 (diff) | |
display character column instead of byte column in status line
Diffstat (limited to 'src')
| -rw-r--r-- | src/client_manager.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/client_manager.cc b/src/client_manager.cc index d651a057..006f4bed 100644 --- a/src/client_manager.cc +++ b/src/client_manager.cc @@ -200,11 +200,12 @@ Context& ClientManager::get_client_context(const String& name) static DisplayLine generate_status_line(const Context& context) { - BufferCoord cursor = context.editor().main_selection().last().coord(); - std::ostringstream oss; + auto pos = context.editor().main_selection().last(); + auto col = utf8::distance(context.buffer().iterator_at_line_begin(pos), pos); + std::ostringstream oss; oss << context.buffer().display_name() - << " " << (int)cursor.line+1 << "," << (int)cursor.column+1; + << " " << (int)pos.line()+1 << "," << (int)col+1; if (context.buffer().is_modified()) oss << " [+]"; if (context.input_handler().is_recording()) |
