annotate runtime/spell/fixdup.vim @ 34257:8a91d18f1789 v9.1.0069

patch 9.1.0069: ScreenLines may not be correctly initialized, causing hang Commit: https://github.com/vim/vim/commit/fd472655a93fd539c731c8daf3adc4e65ddce341 Author: Olaf Seibert <rhialto@falu.nl> Date: Thu Feb 1 21:11:16 2024 +0100 patch 9.1.0069: ScreenLines may not be correctly initialized, causing hang Problem: ScreenLines may not be correctly initialized, causing hang (Olaf Seibert, after 9.0.0220) Solution: always initialize ScreneLines when allocating a screen (Olaf Seibert) ScreenLines and related structures could be left uninitialized causing a screen update to run into an infinite loop when using latin1 encoding. Partly caused because by patch 9.0.0220, which makes mb_ptr2len return zero for NUL related: #12671 closes: #13946 Signed-off-by: Olaf Seibert <rhialto@falu.nl> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 01 Feb 2024 21:30:02 +0100
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