diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2011-10-14 14:29:53 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2011-10-14 14:29:53 +0000 |
| commit | 26459abf8aef509ee45831bcfd1a541bbf831355 (patch) | |
| tree | 204518d63b9a2e4e642001de8686c4095dd278d9 /src/main.cc | |
| parent | c5be69a9a996d2f5694709017c23097b2cd9cc1f (diff) | |
WindowCoord: rename to DisplayCoord and move with DisplayBuffer
Diffstat (limited to 'src/main.cc')
| -rw-r--r-- | src/main.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/main.cc b/src/main.cc index a2b4aeb8..7f6902df 100644 --- a/src/main.cc +++ b/src/main.cc @@ -79,10 +79,10 @@ void draw_window(Window& window) getmaxyx(stdscr, max_y, max_x); max_y -= 1; - window.set_dimensions(WindowCoord(max_y, max_x)); + window.set_dimensions(DisplayCoord(max_y, max_x)); window.update_display_buffer(); - WindowCoord position; + DisplayCoord position; for (const DisplayAtom& atom : window.display_buffer()) { const std::string content = atom.replacement_text.empty() ? @@ -142,7 +142,7 @@ void draw_window(Window& window) clrtoeol(); addstr(status_line.c_str()); - const WindowCoord& cursor_position = window.cursor_position(); + const DisplayCoord& cursor_position = window.cursor_position(); move(cursor_position.line, cursor_position.column); } @@ -285,7 +285,7 @@ void do_insert(Window& window, IncrementalInserter::Mode mode) draw_window(window); while(true) { - const WindowCoord& pos = window.cursor_position(); + const DisplayCoord& pos = window.cursor_position(); move(pos.line, pos.column); char c = getch(); @@ -493,15 +493,15 @@ void do_paste(Window& window, int count) std::unordered_map<char, std::function<void (Window& window, int count)>> keymap = { - { 'h', [](Window& window, int count) { window.move_cursor(WindowCoord(0, -std::max(count,1))); } }, - { 'j', [](Window& window, int count) { window.move_cursor(WindowCoord( std::max(count,1), 0)); } }, - { 'k', [](Window& window, int count) { window.move_cursor(WindowCoord(-std::max(count,1), 0)); } }, - { 'l', [](Window& window, int count) { window.move_cursor(WindowCoord(0, std::max(count,1))); } }, - - { 'H', [](Window& window, int count) { window.move_cursor(WindowCoord(0, -std::max(count,1)), true); } }, - { 'J', [](Window& window, int count) { window.move_cursor(WindowCoord( std::max(count,1), 0), true); } }, - { 'K', [](Window& window, int count) { window.move_cursor(WindowCoord(-std::max(count,1), 0), true); } }, - { 'L', [](Window& window, int count) { window.move_cursor(WindowCoord(0, std::max(count,1)), true); } }, + { 'h', [](Window& window, int count) { window.move_cursor(DisplayCoord(0, -std::max(count,1))); } }, + { 'j', [](Window& window, int count) { window.move_cursor(DisplayCoord( std::max(count,1), 0)); } }, + { 'k', [](Window& window, int count) { window.move_cursor(DisplayCoord(-std::max(count,1), 0)); } }, + { 'l', [](Window& window, int count) { window.move_cursor(DisplayCoord(0, std::max(count,1))); } }, + + { 'H', [](Window& window, int count) { window.move_cursor(DisplayCoord(0, -std::max(count,1)), true); } }, + { 'J', [](Window& window, int count) { window.move_cursor(DisplayCoord( std::max(count,1), 0), true); } }, + { 'K', [](Window& window, int count) { window.move_cursor(DisplayCoord(-std::max(count,1), 0), true); } }, + { 'L', [](Window& window, int count) { window.move_cursor(DisplayCoord(0, std::max(count,1)), true); } }, { 't', [](Window& window, int count) { window.select(std::bind(select_to, _1, getch(), count, false)); } }, { 'f', [](Window& window, int count) { window.select(std::bind(select_to, _1, getch(), count, true)); } }, |
