Skip to content

Commit

Permalink
split multi
Browse files Browse the repository at this point in the history
  • Loading branch information
juliekoubova committed Jun 29, 2024
1 parent b0c7b91 commit 429ccc2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions users/juliekoubova/vim/perform_action.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "statemachine.h"
#include "vim_mode.h"
#include "vim_send.h"
#include <stddef.h>
#include <stdbool.h>

static uint16_t command_mods = QK_LCTL;
Expand Down Expand Up @@ -65,11 +66,15 @@ void vim_set_apple(bool apple) {
line_end = apple ? LGUI(KC_RIGHT) : KC_END;
}

static void vim_send_multi(const uint16_t* code16s, size_t count) {
for (size_t i = 0; i < count; i++) {
vim_send(code16s[i], VIM_SEND_TAP);
}
}

static void vim_send_repeated_multi(int8_t repeat, const uint16_t* code16s, uint8_t code16_count) {
while (repeat > 0) {
for (int i = 0; i < code16_count; i++) {
vim_send(code16s[i], VIM_SEND_TAP);
}
vim_send_multi(code16s, code16_count);
repeat--;
}
}
Expand Down

0 comments on commit 429ccc2

Please sign in to comment.