Re: mg: have Insert key toggle overwrite mode by default

2017-12-17 Thread Brian Callahan

Committed, thanks.

On 12/17/17 05:11, Florian Obser wrote:

OK

On Sat, Dec 16, 2017 at 10:06:59PM +, Lari Rasku wrote:

There's a fairly strong convention among text editors that the Insert
key should toggle overwrite mode.  This is admittedly far more common
among GUI editors, but could mg adopt it as a default anyway?

diff --git usr.bin/mg/ttykbd.c usr.bin/mg/ttykbd.c
index 67bc8e4bd..485291a77 100644
--- usr.bin/mg/ttykbd.c
+++ usr.bin/mg/ttykbd.c
@@ -52,6 +52,8 @@ ttykeymapinit(void)
dobindkey(fundamental_map, "scroll-up", key_npage);
if (key_ppage)
dobindkey(fundamental_map, "scroll-down", key_ppage);
+   if (key_ic)
+   dobindkey(fundamental_map, "overwrite-mode", key_ic);
if (key_dc)
dobindkey(fundamental_map, "delete-char", key_dc);
  





Re: mg: have Insert key toggle overwrite mode by default

2017-12-17 Thread Florian Obser
OK

On Sat, Dec 16, 2017 at 10:06:59PM +, Lari Rasku wrote:
> There's a fairly strong convention among text editors that the Insert
> key should toggle overwrite mode.  This is admittedly far more common
> among GUI editors, but could mg adopt it as a default anyway?
> 
> diff --git usr.bin/mg/ttykbd.c usr.bin/mg/ttykbd.c
> index 67bc8e4bd..485291a77 100644
> --- usr.bin/mg/ttykbd.c
> +++ usr.bin/mg/ttykbd.c
> @@ -52,6 +52,8 @@ ttykeymapinit(void)
>   dobindkey(fundamental_map, "scroll-up", key_npage);
>   if (key_ppage)
>   dobindkey(fundamental_map, "scroll-down", key_ppage);
> + if (key_ic)
> + dobindkey(fundamental_map, "overwrite-mode", key_ic);
>   if (key_dc)
>   dobindkey(fundamental_map, "delete-char", key_dc);
>  
> 

-- 
I'm not entirely sure you are real.



Re: mg: have Insert key toggle overwrite mode by default

2017-12-16 Thread Brian Callahan


On 12/16/17 17:06, Lari Rasku wrote:

There's a fairly strong convention among text editors that the Insert
key should toggle overwrite mode.  This is admittedly far more common
among GUI editors, but could mg adopt it as a default anyway?


I'm inclined to agree with at least the general direction, as GNU Emacs 
even in terminal mode does this.


~Brian


diff --git usr.bin/mg/ttykbd.c usr.bin/mg/ttykbd.c
index 67bc8e4bd..485291a77 100644
--- usr.bin/mg/ttykbd.c
+++ usr.bin/mg/ttykbd.c
@@ -52,6 +52,8 @@ ttykeymapinit(void)
dobindkey(fundamental_map, "scroll-up", key_npage);
if (key_ppage)
dobindkey(fundamental_map, "scroll-down", key_ppage);
+   if (key_ic)
+   dobindkey(fundamental_map, "overwrite-mode", key_ic);
if (key_dc)
dobindkey(fundamental_map, "delete-char", key_dc);
  





mg: have Insert key toggle overwrite mode by default

2017-12-16 Thread Lari Rasku
There's a fairly strong convention among text editors that the Insert
key should toggle overwrite mode.  This is admittedly far more common
among GUI editors, but could mg adopt it as a default anyway?

diff --git usr.bin/mg/ttykbd.c usr.bin/mg/ttykbd.c
index 67bc8e4bd..485291a77 100644
--- usr.bin/mg/ttykbd.c
+++ usr.bin/mg/ttykbd.c
@@ -52,6 +52,8 @@ ttykeymapinit(void)
dobindkey(fundamental_map, "scroll-up", key_npage);
if (key_ppage)
dobindkey(fundamental_map, "scroll-down", key_ppage);
+   if (key_ic)
+   dobindkey(fundamental_map, "overwrite-mode", key_ic);
if (key_dc)
dobindkey(fundamental_map, "delete-char", key_dc);