vim-patch:9.1.1477: no easy way to deduplicate text

Problem:  no easy way to deduplicate text
Solution: add the :uniq ex command
          (Hirohito Higashi)

closes: vim/vim#17538

74f0a77bb9

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
This commit is contained in:
zeertzjq
2025-06-24 08:05:32 +08:00
parent d9465e984b
commit 7138cdaef8
10 changed files with 885 additions and 6 deletions

View File

@@ -344,7 +344,8 @@ static bool do_incsearch_highlighting(int firstc, int *search_delim, incsearch_s
} else if (*cmd == 's' && cmd[1] == 'n') {
magic_overruled = OPTION_MAGIC_OFF;
}
} else if (strncmp(cmd, "sort", (size_t)MAX(p - cmd, 3)) == 0) {
} else if (strncmp(cmd, "sort", (size_t)MAX(p - cmd, 3)) == 0
|| strncmp(cmd, "uniq", (size_t)MAX(p - cmd, 3)) == 0) {
// skip over ! and flags
if (*p == '!') {
p = skipwhite(p + 1);