view runtime/spell/fixdup.vim @ 34550:4d8d41b7a8eb v9.1.0176

patch 9.1.0176: Cursor column wrong with 'virtualedit' and conceal Commit: https://github.com/vim/vim/commit/253ff4dece4e6cc4a9ff3ed935bc78f832b6fb7c Author: zeertzjq <zeertzjq@outlook.com> Date: Wed Mar 13 20:38:26 2024 +0100 patch 9.1.0176: Cursor column wrong with 'virtualedit' and conceal Problem: Cursor column wrong with 'virtualedit' and conceal. Solution: Correct cursor column at end of line if never reached. (zeertzjq) closes: #14190 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Wed, 13 Mar 2024 20:45:02 +0100
parents 7cfe57329284
children
line wrap: on
line source

" Vim script to fix duplicate words in a .dic file  vim: set ft=vim:
"
" Usage: Edit the .dic file and source this script.

let deleted = 0

" Start below the word count.
let lnum = 2
while lnum <= line('$')
  let word = getline(lnum)
  if word !~ '/'
    if search('^' . word . '/', 'w') != 0
      let deleted += 1
      exe lnum . "d"
      continue		" don't increment lnum, it's already at the next word
    endif
  endif
  if lnum%1000 == 0
    echon "\r Processing line ".lnum. printf(" [ %02d%%]", lnum*100/line('$'))
  endif
  let lnum += 1
endwhile

if deleted == 0
  echomsg "No duplicate words found"
elseif deleted == 1
  echomsg "Deleted 1 duplicate word"
else
  echomsg printf("Deleted %d duplicate words", deleted)
endif