Commits

Rafael García committed 912d18d

Separate m_adjective, since some functions actually take arg.i == 0, make n/N work

Comments (0)

Files changed (2)

 { .keyv.c = { 'a' },      { 0,     0,    0,   0 },  f_toggle,    { .i = S_Command      } },
 { .keyv.c = { 'b' },      { t_sent,0,    0,   0 },  f_adjective, { .m = m_prevword     } },
 { .keyv.c = { 'b' },      { 0,     0,    0,   0 },  f_move,      { .m = m_prevword     } },
-{ .keyv.c = { 'c' },      { t_rw,  0,    0,   0 },  f_delete,    { .i = 0              } },
-{ .keyv.c = { 'd' },      { t_rw,  0,    0,   0 },  f_delete,    { .i = 0              } },
+{ .keyv.c = { 'c' },      { t_rw,  0,    0,   0 },  f_delete,    { .m = m_adjective    } }, /* TODO: queue insert mode, similar to 'y' */
+{ .keyv.c = { 'd' },      { t_rw,  0,    0,   0 },  f_delete,    { .m = m_adjective    } },
 { .keyv.c = { 'g' },      { 0,     0,    0,   0 },  f_move,      { .m = m_bof          } },
 { .keyv.c = { 'G' },      { 0,     0,    0,   0 },  f_move,      { .m = m_eof          } },
 { .keyv.c = { 'h' },      { t_sent,0,    0,   0 },  f_adjective, { .m = m_prevchar     } },
 { .keyv.c = { 'x' },      { t_rw,  0,    0,   0 },  f_delete,    { .m = m_nextchar     } },
 { .keyv.c = { 'X' },      { t_sel, t_rw, 0,   0 },  f_delete,    { .m = m_tosel        } },
 { .keyv.c = { 'X' },      { t_rw,  0,    0,   0 },  f_delete,    { .m = m_prevchar     } },
-{ .keyv.c = { 'y' },      { t_rw,  0,    0,   0 },  f_pipero,    { .i = 0, .v = TOCLIP } },
+{ .keyv.c = { 'y' },      { t_rw,  0,    0,   0 },  f_pipero,    { .m = m_adjective, .v = TOCLIP } }, /* TODO: won't work since Arg is a union */
 { .keyv.c = { ';' },      { 0,     0,    0,   0 },  f_spawn,     CMD_P                   },
 { .keyv.c = { ':' },      { 0,     0,    0,   0 },  f_spawn,     CMD_P                   },
 { .keyv.c = { '\'' },     { 0,     0,    0,   0 },  f_move,      { .m = m_tomark       } },
 static bool t_warn(void);
 
 /* m_ functions represent a cursor movement and can be passed in an Arg */
+static Filepos m_adjective(Filepos);
 static Filepos m_bof(Filepos);
 static Filepos m_bol(Filepos);
 static Filepos m_smartbol(Filepos);
 							statusflags&=~S_Sentence;
 							break;
 						}
-					} else if(commkeys[i].arg.i == 0) {
+					} else if(commkeys[i].arg.m == m_adjective) {
 						statusflags|=(long)S_Sentence;
 						verb=commkeys[i].func;
 						break;
 						statusflags&=~S_Parameter;
 						i_multiply(verb, (const Arg){ .v = c });
 						break;
-					} else if(commkeys[i].arg.m == 0) {
+					} else if(commkeys[i].arg.m == m_adjective) {
 						statusflags|=(long)S_Parameter;
 						verb=commkeys[i].func;
 						break;
 
 /* M_* FUNCTIONS
 	Represent a cursor motion, always take a Filepos and return an update Filepos */
+Filepos /* Go to where the adjective says */
+m_adjective(Filepos pos) {
+  /* WARNING: this code is actually not used */
+  return pos;
+}
 
 Filepos /* Go to beginning of file */
 m_bof(Filepos pos) {