be

based editor
git clone git://git.kocotian.pl/be.git
Log | Files | Refs | README | LICENSE

commit fd44c3fbdad05a5f10f386072ea223ea51ea3356
parent b1b1dcb1ec7935433ea374551d4bceda2ef34d3b
Author: kocotian <kocotian@kocotian.pl>
Date:   Mon, 19 Apr 2021 13:27:41 +0200

Buffer submode -> Buffer mode

Diffstat:
Mbe.c | 8++++----
Mconfig/bindings.h | 22+++++++++++-----------
Mlang/en_US.h | 2+-
Mlang/pl_PL.h | 2+-
4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/be.c b/be.c @@ -56,9 +56,9 @@ typedef enum Mod { typedef enum Mode { ModeNormal, ModeEdit, + ModeBuffer, SubModeGlobal, SubModeMovement, - SubModeBuffer, } Mode; typedef union Arg { @@ -129,7 +129,7 @@ static void normalmode(const Arg *arg); static void insertmode(const Arg *arg); static void appendmode(const Arg *arg); static void globalsubmode(const Arg *arg); -static void buffersubmode(const Arg *arg); +static void buffermode(const Arg *arg); static void cursormove(const Arg *arg); static void beginning(const Arg *arg); static void ending(const Arg *arg); @@ -589,10 +589,10 @@ globalsubmode(const Arg *arg) } static void -buffersubmode(const Arg *arg) +buffermode(const Arg *arg) { (void)arg; - switchmode(SubModeBuffer); + switchmode(ModeBuffer); editorParseKey(editorGetKey()); switchmode(ModeNormal); } diff --git a/config/bindings.h b/config/bindings.h @@ -26,9 +26,9 @@ normalbindings[] = { /* Submodes */ { ModNone, 'g', globalsubmode, {0} }, - { ModShift, 'z', buffersubmode, {0} }, /* other */ + { ModShift, 'z', buffermode, {0} }, { ModNone, 0, echoe, {.v = "Key is not bound"} }, }, @@ -40,22 +40,22 @@ editbindings[] = { { ModNone, 0, insertchar, {.v = REPLACE} }, }, -/* submodes */ -s_globalbindings[] = { +bufferbindings[] = { /* modifier key function argument */ + { ModShift, 'z', bufwriteclose, {0} }, + { ModShift, 'w', bufwrite, {0} }, + { ModShift, 'c', bufclose, {0} }, + { ModShift, 'q', bufkill, {0} }, { ModNone, 0, echoe, {.v = "Key is not bound"} }, }, -s_movementbindings[] = { +/* submodes */ +s_globalbindings[] = { + /* modifier key function argument */ { ModNone, 0, echoe, {.v = "Key is not bound"} }, }, -s_bufferbindings[] = { - /* modifier key function argument */ - { ModShift, 'z', bufwriteclose, {0} }, - { ModShift, 'w', bufwrite, {0} }, - { ModShift, 'c', bufclose, {0} }, - { ModShift, 'q', bufkill, {0} }, +s_movementbindings[] = { { ModNone, 0, echoe, {.v = "Key is not bound"} }, }; @@ -65,7 +65,7 @@ static Binding bindings[] = { /* mode keys */ [ModeEdit] = BIND(editbindings), [ModeNormal] = BIND(normalbindings), + [ModeBuffer] = BIND(bufferbindings), [SubModeGlobal] = BIND(s_globalbindings), [SubModeMovement] = BIND(s_movementbindings), - [SubModeBuffer] = BIND(s_bufferbindings), }; diff --git a/lang/en_US.h b/lang/en_US.h @@ -7,9 +7,9 @@ static char *lang_modes[] = { [ModeNormal] = "Normal", [ModeEdit] = "Edit", + [ModeBuffer] = "Buffer", [SubModeGlobal] = "Global", [SubModeMovement] = "Movement", - [SubModeBuffer] = "Buffer", }, *lang_err[] = { [0] = "usage", diff --git a/lang/pl_PL.h b/lang/pl_PL.h @@ -7,9 +7,9 @@ static char *lang_modes[] = { [ModeNormal] = "Normalny", [ModeEdit] = "Edycja", + [ModeBuffer] = "Bufor", [SubModeGlobal] = "Globalny", [SubModeMovement] = "Ruch", - [SubModeBuffer] = "Bufor", }, *lang_err[] = { [0] = "u┼╝ycie",