add function for clear that also puts you in insert mode
This commit is contained in:
parent
04b46313ef
commit
fa82afad48
|
@ -83,6 +83,7 @@ static Key keys[] = {
|
||||||
{ 0, CONTROL, XK_k, restoresel, {0} },
|
{ 0, CONTROL, XK_k, restoresel, {0} },
|
||||||
{ 0, CONTROL|SHIFT, XK_h, viewhist, {0} },
|
{ 0, CONTROL|SHIFT, XK_h, viewhist, {0} },
|
||||||
{ 0, 0, XK_d, clear, {0} },
|
{ 0, 0, XK_d, clear, {0} },
|
||||||
|
{ 0, 0, XK_c, clearins, {0} },
|
||||||
{ 0, 0, XK_Escape, quit, {0} },
|
{ 0, 0, XK_Escape, quit, {0} },
|
||||||
{ 0, 0, XK_Home, movestart, {0} },
|
{ 0, 0, XK_Home, movestart, {0} },
|
||||||
{ 0, 0, XK_End, moveend, {0} },
|
{ 0, 0, XK_End, moveend, {0} },
|
||||||
|
|
19
libs/arg.c
19
libs/arg.c
|
@ -322,6 +322,25 @@ clear(const Arg *arg)
|
||||||
drawmenu();
|
drawmenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
clearins(const Arg *arg)
|
||||||
|
{
|
||||||
|
insert(NULL, 0 - cursor);
|
||||||
|
|
||||||
|
curMode = 1;
|
||||||
|
allowkeys = 0;
|
||||||
|
|
||||||
|
if (!curMode) {
|
||||||
|
strcpy(modetext, normtext);
|
||||||
|
} else {
|
||||||
|
strcpy(modetext, instext);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hidemode) strcpy(modetext, "");
|
||||||
|
|
||||||
|
drawmenu();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
quit(const Arg *arg)
|
quit(const Arg *arg)
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,6 +17,7 @@ static void moveprev(const Arg *arg);
|
||||||
static void paste(const Arg *arg);
|
static void paste(const Arg *arg);
|
||||||
static void restoresel(const Arg *arg);
|
static void restoresel(const Arg *arg);
|
||||||
static void clear(const Arg *arg);
|
static void clear(const Arg *arg);
|
||||||
|
static void clearins(const Arg *arg);
|
||||||
static void viewhist(const Arg *arg);
|
static void viewhist(const Arg *arg);
|
||||||
static void moveword(const Arg *arg);
|
static void moveword(const Arg *arg);
|
||||||
static void deleteword(const Arg *arg);
|
static void deleteword(const Arg *arg);
|
||||||
|
|
Loading…
Reference in a new issue