diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-09-10 14:47:48 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-09-10 14:47:48 +0200 |
| commit | 0d448b0d2802a044a77f5546ecd98efb5045adca (patch) | |
| tree | 8405c88199a2cd46f26c24043896f89691278fe1 /vis.c | |
| parent | a5e0c7efb08460e577e9ff0997991e5adfe6c473 (diff) | |
| download | vis-0d448b0d2802a044a77f5546ecd98efb5045adca.tar.gz vis-0d448b0d2802a044a77f5546ecd98efb5045adca.tar.xz | |
Add a few comments about the subtleties of mode switching
Diffstat (limited to 'vis.c')
| -rw-r--r-- | vis.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -498,7 +498,8 @@ static void operator(const Arg *arg) { action_do(&action); return; } - + /* switch to operator mode inorder to make operator options and + * text-object available */ switchmode(&(const Arg){ .i = VIS_MODE_OPERATOR }); if (action.op == op) { /* hacky way to handle double operators i.e. things like @@ -587,6 +588,10 @@ static void prompt(const Arg *arg) { static void prompt_enter(const Arg *arg) { char *s = editor_prompt_get(vis); + /* it is important to switch to normal mode, which hides the prompt and + * more importantly resets vis->win to the currently focused editor + * window *before* anything is executed which depends on vis->win. + */ switchmode(&(const Arg){ .i = VIS_MODE_NORMAL }); switch (vis->prompt->title[0]) { case '/': |
