aboutsummaryrefslogtreecommitdiff
path: root/src/line/getter.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/line/getter.cc')
-rw-r--r--src/line/getter.cc62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/line/getter.cc b/src/line/getter.cc
index 432ddca..aa05d6b 100644
--- a/src/line/getter.cc
+++ b/src/line/getter.cc
@@ -38,36 +38,36 @@ int T_line_editor::get_terminal_pos_line_end()
}
-T_position T_line_editor::get_cursor_position()
-{
- char c;
- string buffer;
- T_position pos;
- int row, col;
- tcflush(STDIN_FILENO, TCIFLUSH);
- cout << "\x1b[6n" << flush;
- while (read(STDIN_FILENO, &c, 1) == 1)
- {
- if (c == 'R') break;
- buffer += c;
- }
- if (buffer.size() <= 2 || buffer[0] != '\x1b' || buffer[1] != '[')
- {
- pos.row = -1;
- pos.col = -1;
- return pos;
- }
- if ((sscanf(buffer.c_str(), "\x1b[%d;%d", &row, &col)) != 2)
- {
- pos.row = -1;
- pos.col = -1;
- return pos;
- }
- pos.row = row;
- pos.col = col;
- // print("row {}, col {}\r\n", row, col);
- // fflush(stdout);
- return pos;
-}
+// T_position T_line_editor::get_cursor_position()
+// {
+// char c;
+// string buffer;
+// T_position pos;
+// int row, col;
+// tcflush(STDIN_FILENO, TCIFLUSH);
+// cout << "\x1b[6n" << flush;
+// while (read(STDIN_FILENO, &c, 1) == 1)
+// {
+// if (c == 'R') break;
+// buffer += c;
+// }
+// if (buffer.size() <= 2 || buffer[0] != '\x1b' || buffer[1] != '[')
+// {
+// pos.row = -1;
+// pos.col = -1;
+// return pos;
+// }
+// if ((sscanf(buffer.c_str(), "\x1b[%d;%d", &row, &col)) != 2)
+// {
+// pos.row = -1;
+// pos.col = -1;
+// return pos;
+// }
+// pos.row = row;
+// pos.col = col;
+// // print("row {}, col {}\r\n", row, col);
+// // fflush(stdout);
+// return pos;
+// }
} \ No newline at end of file