Fix cursor merging on boundary

This commit is contained in:
Krzosa Karol
2024-06-24 07:00:15 +02:00
parent e82edb89ae
commit 66b9a5d15f
2 changed files with 7 additions and 2 deletions

View File

@@ -168,7 +168,7 @@ int main() {
}
window.cursors.add({});
for (int i = 1; i < 10; i += 1) {
for (int i = 1; i < 2; i += 1) {
Line line = GetLine(window.buffer, i);
window.cursors.add({line.range.min, line.range.min});
}
@@ -183,6 +183,9 @@ int main() {
if (IsKeyDown(KEY_F1)) {
camera_offset_world_to_render_units = Vector2Subtract(camera_offset_world_to_render_units, GetMouseDelta());
}
if (IsKeyDown(KEY_F2)) {
SetTraceLogLevel(LOG_DEBUG);
}
float mouse_wheel = GetMouseWheelMove() * 48;
focused_window->scroll.y -= mouse_wheel;
@@ -245,7 +248,7 @@ int main() {
IterRemovePrepare(focused_window->cursors);
if (&cursor == &it) continue;
if (cursor.range.max > it.range.min && cursor.range.max <= it.range.max) {
if (cursor.range.max >= it.range.min && cursor.range.max <= it.range.max) {
remove_item = true;
cursor.range.max = it.range.max;
break;