1
0
mirror of https://github.com/Cloudef/bemenu synced 2024-11-23 09:21:59 +01:00

Remove debug logs

This commit is contained in:
Luca Nimmrichter 2022-10-20 16:56:50 +02:00 committed by Jari Vetoniemi
parent 4d00e04eaa
commit 75afebeb4b

@ -8,9 +8,6 @@
#include "vim.h" #include "vim.h"
#define LOG(x)
//#define LOG(x) printf(x)
static enum bm_vim_code vim_on_first_key(struct bm_menu *menu, uint32_t unicode, uint32_t item_count, uint32_t items_displayed); static enum bm_vim_code vim_on_first_key(struct bm_menu *menu, uint32_t unicode, uint32_t item_count, uint32_t items_displayed);
static enum bm_vim_code vim_on_second_key(struct bm_menu *menu, uint32_t unicode, uint32_t item_count, uint32_t items_displayed); static enum bm_vim_code vim_on_second_key(struct bm_menu *menu, uint32_t unicode, uint32_t item_count, uint32_t items_displayed);
@ -227,97 +224,74 @@ static enum bm_vim_code vim_on_first_key(struct bm_menu *menu, uint32_t unicode,
switch(unicode){ switch(unicode){
case 'q': case 'q':
LOG("quit\n");
return BM_VIM_EXIT; return BM_VIM_EXIT;
case 'v': case 'v':
LOG("toggle item selection\n");
toggle_item_selection(menu); toggle_item_selection(menu);
goto action_executed; goto action_executed;
case 'i': case 'i':
LOG("insert mode\n");
goto insert_action_executed; goto insert_action_executed;
case 'I': case 'I':
LOG("insert line beginning\n");
move_line_start(menu); move_line_start(menu);
goto insert_action_executed; goto insert_action_executed;
case 'a': case 'a':
LOG("append\n");
filter_length = strlen(menu->filter); filter_length = strlen(menu->filter);
move_right(menu, filter_length); move_right(menu, filter_length);
goto insert_action_executed; goto insert_action_executed;
case 'A': case 'A':
LOG("append line end\n");
move_line_end(menu); move_line_end(menu);
goto insert_action_executed; goto insert_action_executed;
case 'h': case 'h':
LOG("left\n");
move_left(menu); move_left(menu);
goto action_executed; goto action_executed;
case 'n': case 'n':
case 'j': case 'j':
LOG("down\n");
menu_next(menu, item_count, menu->wrap); menu_next(menu, item_count, menu->wrap);
goto action_executed; goto action_executed;
case 'p': case 'p':
case 'k': case 'k':
LOG("up\n");
menu_prev(menu, item_count, menu->wrap); menu_prev(menu, item_count, menu->wrap);
goto action_executed; goto action_executed;
case 'l': case 'l':
LOG("right\n");
filter_length = strlen(menu->filter); filter_length = strlen(menu->filter);
move_right(menu, filter_length); move_right(menu, filter_length);
goto action_executed; goto action_executed;
case 'w': case 'w':
LOG("move word\n");
move_word(menu); move_word(menu);
goto action_executed; goto action_executed;
case 'b': case 'b':
LOG("move word back\n");
move_word_back(menu); move_word_back(menu);
goto action_executed; goto action_executed;
case 'e': case 'e':
LOG("move word end\n");
move_word_end(menu); move_word_end(menu);
goto action_executed; goto action_executed;
case 'x': case 'x':
LOG("delete char\n");
delete_char(menu); delete_char(menu);
goto action_executed; goto action_executed;
case 'X': case 'X':
LOG("delete char back\n");
delete_char_back(menu); delete_char_back(menu);
goto action_executed; goto action_executed;
case '0': case '0':
LOG("move line start\n");
move_line_start(menu); move_line_start(menu);
goto action_executed; goto action_executed;
case '$': case '$':
LOG("move line end\n");
move_line_end(menu); move_line_end(menu);
goto action_executed; goto action_executed;
case 'G': case 'G':
LOG("menu last\n");
menu_last(menu, item_count); menu_last(menu, item_count);
goto action_executed; goto action_executed;
case 'H': case 'H':
LOG("menu view high\n");
menu_view_high(menu, item_count); menu_view_high(menu, item_count);
goto action_executed; goto action_executed;
case 'M': case 'M':
LOG("menu view mid\n");
menu_view_mid(menu, item_count, items_displayed); menu_view_mid(menu, item_count, items_displayed);
goto action_executed; goto action_executed;
case 'L': case 'L':
LOG("menu view low\n");
menu_view_low(menu, item_count, items_displayed); menu_view_low(menu, item_count, items_displayed);
goto action_executed; goto action_executed;
case 'F': case 'F':
LOG("menu page down\n");
menu_page_down(menu, item_count, items_displayed); menu_page_down(menu, item_count, items_displayed);
goto action_executed; goto action_executed;
case 'B': case 'B':
LOG("menu page up\n");
menu_page_up(menu, items_displayed); menu_page_up(menu, items_displayed);
goto action_executed; goto action_executed;
case 'c': case 'c':
@ -341,53 +315,42 @@ static enum bm_vim_code vim_on_second_key(struct bm_menu *menu, uint32_t unicode
if(menu->vim_last_key == 'd'){ if(menu->vim_last_key == 'd'){
switch(unicode){ switch(unicode){
case 'd': case 'd':
LOG("Delete line\n");
delete_line(menu); delete_line(menu);
goto action_executed; goto action_executed;
case 'w': case 'w':
LOG("Delete word\n");
delete_word(menu); delete_word(menu);
goto action_executed; goto action_executed;
case 'b': case 'b':
LOG("Delete word back\n");
delete_word_back(menu); delete_word_back(menu);
goto action_executed; goto action_executed;
case '$': case '$':
LOG("Delete to line end\n");
delete_to_line_end(menu); delete_to_line_end(menu);
goto action_executed; goto action_executed;
case '0': case '0':
LOG("Delete to line start\n");
delete_to_line_start(menu); delete_to_line_start(menu);
goto action_executed; goto action_executed;
} }
} else if(menu->vim_last_key == 'c'){ } else if(menu->vim_last_key == 'c'){
switch(unicode){ switch(unicode){
case 'c': case 'c':
LOG("Change line\n");
delete_line(menu); delete_line(menu);
goto insert_action_executed; goto insert_action_executed;
case 'w': case 'w':
LOG("Change word\n");
delete_word(menu); delete_word(menu);
goto insert_action_executed; goto insert_action_executed;
case 'b': case 'b':
LOG("Change word back\n");
delete_word_back(menu); delete_word_back(menu);
goto insert_action_executed; goto insert_action_executed;
case '$': case '$':
LOG("Change to line end\n");
delete_to_line_end(menu); delete_to_line_end(menu);
goto insert_action_executed; goto insert_action_executed;
case '0': case '0':
LOG("Change to line start\n");
delete_to_line_start(menu); delete_to_line_start(menu);
goto insert_action_executed; goto insert_action_executed;
} }
} else if(menu->vim_last_key == 'g'){ } else if(menu->vim_last_key == 'g'){
switch(unicode){ switch(unicode){
case 'g': case 'g':
LOG("menu first\n");
menu_first(menu, item_count); menu_first(menu, item_count);
goto action_executed; goto action_executed;
} }