annotate runtime/spell/fixdup.vim @ 17580:d5e5d0fc3fa8 v8.1.1787

patch 8.1.1787: cannot resize a popup window commit https://github.com/vim/vim/commit/9bcb70c18a740bf9d97a1420df5964618f218a89 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Aug 1 21:11:05 2019 +0200 patch 8.1.1787: cannot resize a popup window Problem: Cannot resize a popup window. Solution: Allow for resizing by dragging the lower right corncer.
author Bram Moolenaar <Bram@vim.org>
date Thu, 01 Aug 2019 21:15:07 +0200
parents 7cfe57329284
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
1 " Vim script to fix duplicate words in a .dic file vim: set ft=vim:
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
2 "
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
3 " Usage: Edit the .dic file and source this script.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
4
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
5 let deleted = 0
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
6
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
7 " Start below the word count.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
8 let lnum = 2
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
9 while lnum <= line('$')
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
10 let word = getline(lnum)
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
11 if word !~ '/'
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
12 if search('^' . word . '/', 'w') != 0
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
13 let deleted += 1
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
14 exe lnum . "d"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
15 continue " don't increment lnum, it's already at the next word
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
16 endif
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
17 endif
15640
7cfe57329284 Updated runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 2034
diff changeset
18 if lnum%1000 == 0
7cfe57329284 Updated runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 2034
diff changeset
19 echon "\r Processing line ".lnum. printf(" [ %02d%%]", lnum*100/line('$'))
7cfe57329284 Updated runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 2034
diff changeset
20 endif
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
21 let lnum += 1
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
22 endwhile
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
23
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
24 if deleted == 0
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
25 echomsg "No duplicate words found"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
26 elseif deleted == 1
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
27 echomsg "Deleted 1 duplicate word"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
28 else
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
29 echomsg printf("Deleted %d duplicate words", deleted)
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
30 endif