Parcourir la source

Adding keybind to list buffer

Vinicius Teshima il y a 1 an
Parent
commit
665e802226
2 fichiers modifiés avec 10 ajouts et 0 suppressions
  1. 2 0
      src/config.h
  2. 8 0
      src/keybind.h

+ 2 - 0
src/config.h

@@ -37,6 +37,8 @@ void config(struct app *app) {
 
 	AAGK(app, "C-s", keybind_save_buffer, DIR_NO);
 
+	AAGK(app, "C-x b", keybind_list_buffers, DIR_NO);
+
 	char *k = calloc(sizeof(char), 2);
 	for ( char c = 32; c < 127; ++c) {
 		k[0] = c;

+ 8 - 0
src/keybind.h

@@ -26,6 +26,8 @@ void keybind_toggle_fps(struct app *app, enum keybind_dir dir);
 void keybind_mv_cur_edg_buffer(struct app *app, enum keybind_dir dir);
 void keybind_insert_last_pressed_key(struct app *app, enum keybind_dir dir);
 
+void keybind_list_buffers(struct app *app, enum keybind_dir dir);
+
 #if defined(KEYBIND_IMP) || defined(IMP)
 
 void
@@ -267,6 +269,12 @@ keybind_insert_last_pressed_key(struct app *app, enum keybind_dir dir)
 	app->cbuf->high_col = buffer_calc_cur_col(app->cbuf);
 }
 
+void
+keybind_list_buffers(struct app *app, enum keybind_dir dir)
+{
+	(void) dir;
+	app->cbuf = app_create_buffer_list(app);
+}
 
 #endif /* defined(KEYBIND_IMP) || defined(IMP) */