Branch: refs/heads/master
Author: Jiří Techet <techet(a)gmail.com>
Committer: Jiří Techet <techet(a)gmail.com>
Date: Tue, 07 Sep 2021 11:08:05 UTC
Commit: 25291ea004e3430d1ad8947d90f552e5d40456fa
https://github.com/geany/geany-plugins/commit/25291ea004e3430d1ad8947d90f55…
Log Message:
-----------
vimode: increase the size of the buffer for recording insert mode text
This should be more than enough for manually inserted text and a reasonable
amount for pasted text.
Modified Paths:
--------------
vimode/src/context.h
Modified: vimode/src/context.h
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -22,7 +22,7 @@
#include "vi.h"
#include "sci.h"
-#define INSERT_BUF_LEN 4096
+#define INSERT_BUF_LEN 131072
typedef struct
{
@@ -54,7 +54,7 @@ typedef struct
gint num;
/* buffer used in insert/replace mode to record entered text so it can be
- * copied N times when e.g. 'i' is preceded by a number */
+ * copied N times when e.g. 'i' is preceded by a number or when using '.' */
gchar insert_buf[INSERT_BUF_LEN];
gint insert_buf_len;
} CmdContext;
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Jiří Techet <techet(a)gmail.com>
Committer: Jiří Techet <techet(a)gmail.com>
Date: Wed, 01 Sep 2021 19:50:05 UTC
Commit: 153c3aaab23ec97436c53f6a35d9e82862bd44d5
https://github.com/geany/geany-plugins/commit/153c3aaab23ec97436c53f6a35d9e…
Log Message:
-----------
vimode: Add special handling to include destination char for some commands
For
abcde;
simple 't;' does the right thing and places the cursor on top of character
'e' just before ';'. However, for composed commands such as 'dt;', vim
also deletes the character 'e' which vimode currently doesn't.
Vim behaves in a bit inconsistent way regarding this behavior - while
for 'dw' (delete all until next word) it doesn't delete the first character
of the next word onto which the cursor is placed, for 'de' (delete until
next word end) it includes the final character of the deleted word. This
behavior makes sense from the use case point of view but makes handling
of such situations inconsistent.
This patch lists functions which behave this way and includes the
destination character to the selection.
Fixes #1052.
Modified Paths:
--------------
vimode/src/cmd-runner.c
Modified: vimode/src/cmd-runner.c
24 lines changed, 23 insertions(+), 1 deletions(-)
===================================================================
@@ -167,6 +167,21 @@ typedef struct {
/* END */
+/* From the above commands, these commands also include the character
+ * where the destionation movement ends for motion commands (e.g. 'de' will
+ * delete the word including the last character) */
+CmdDef include_dest_char_movement_cmds[] = {
+ {cmd_goto_next_char, GDK_KEY_f, 0, 0, 0, TRUE, FALSE},
+ {cmd_goto_next_char_before, GDK_KEY_t, 0, 0, 0, TRUE, FALSE},
+ {cmd_goto_next_word_end, GDK_KEY_e, 0, 0, 0, FALSE, FALSE},
+ {cmd_goto_next_word_end_space, GDK_KEY_E, 0, 0, 0, FALSE, FALSE},
+ {cmd_goto_previous_word, GDK_KEY_b, 0, 0, 0, FALSE, FALSE},
+ {cmd_goto_previous_word_space, GDK_KEY_B, 0, 0, 0, FALSE, FALSE},
+ {cmd_goto_matching_brace, GDK_KEY_percent, 0, 0, 0, FALSE, FALSE},
+ {NULL, 0, 0, 0, 0, FALSE, FALSE}
+};
+
+
CmdDef movement_cmds[] = {
MOVEMENT_CMDS
{NULL, 0, 0, 0, 0, FALSE, FALSE}
@@ -567,7 +582,8 @@ static void perform_cmd(CmdDef *def, CmdContext *ctx)
if (VI_IS_COMMAND(vi_get_mode()))
{
gboolean is_text_object_cmd = is_in_cmd_group(text_object_cmds, def);
- if (is_text_object_cmd ||is_in_cmd_group(movement_cmds, def))
+ gboolean is_include_dest_char_movement_cmd = is_in_cmd_group(include_dest_char_movement_cmds, def);
+ if (is_text_object_cmd || is_in_cmd_group(movement_cmds, def))
{
def = get_cmd_to_run(top, operator_cmds, TRUE);
if (def)
@@ -585,6 +601,12 @@ static void perform_cmd(CmdDef *def, CmdContext *ctx)
{
sel_start = MIN(new_pos, orig_pos);
sel_len = ABS(new_pos - orig_pos);
+ if (sel_len > 0 && is_include_dest_char_movement_cmd)
+ {
+ sel_len++;
+ if (new_pos < orig_pos)
+ sel_start--;
+ }
}
cmd_params_init(¶m, ctx->sci,
1, FALSE, top, TRUE,
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Jiří Techet <techet(a)gmail.com>
Committer: Jiří Techet <techet(a)gmail.com>
Date: Thu, 02 Sep 2021 19:43:01 UTC
Commit: 21835b79c34e9967598bf7c862976def62698926
https://github.com/geany/geany-plugins/commit/21835b79c34e9967598bf7c862976…
Log Message:
-----------
vimode: document the newly added ex commands
Modified Paths:
--------------
vimode/README
Modified: vimode/README
12 lines changed, 12 insertions(+), 0 deletions(-)
===================================================================
@@ -550,16 +550,28 @@ a new command, please do not forget to update the table below.::
tag command action
------------------------------------------------------------------------------
:& :& repeat last ":substitute"
+ :< :< shift lines one 'shiftwidth' left
+ :> :> shift lines one 'shiftwidth' right
+ :copy :co[py] copy lines
:cquit :cq[uit] quit Vim with an error code
+ :delete :d[elete] delete lines
:exit :exi[t] same as ":xit"
+ :join :j[oin] join lines
+ :move :m[ove] move lines
+ :put :pu[t] insert contents of register in the text
:quit :q[uit] quit current window (when one window quit Vim)
:quitall :quita[ll] quit Vim
:qall :qa[ll] quit Vim
+ :redo :red[o] redo one undone change
:substitute :s[ubstitute] find and replace text
+ :t :t same as ":copy"
+ :undo :u[ndo] undo last change(s)
:update :up[date] write buffer if modified
:write :w[rite] write to a file
:wall :wa[ll] write all (changed) buffers
:wq :wq write to a file and quit window or Vim
:wqall :wqa[ll] write all changed buffers and quit Vim
:xit :x[it] write if buffer changed and quit window or Vim
:xall :xa[ll] same as ":wqall"
+ :yank :y[ank] yank lines into a register
+ :~ :~ repeat last ":substitute"
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).