Patch 9.0.1335
Problem: No test for bad use of spaces in help files.
Solution: Add checks for use of spaces in help files. Ignore intentional
spaces. (Hirohito Higashi, closes #11952)
Files: src/testdir/test_codestyle.vim
*** ../vim-9.0.1334/src/testdir/test_codestyle.vim 2023-01-28
19:18:56.725720605 +0000
--- src/testdir/test_codestyle.vim 2023-02-21 13:29:27.752523745 +0000
***************
*** 78,82 ****
--- 78,145 ----
bwipe!
enddef
+ def Test_help_files()
+ var lnum: number
+ set nowrapscan
+
+ for fpath in glob('../../runtime/doc/*.txt', 0, 1)
+ exe 'edit ' .. fpath
+
+ var fname = fnamemodify(fpath, ":t")
+
+ # todo.txt is for developers, it's not need a strictly check
+ # version*.txt is a history and large size, so it's not checked
+ if fname == 'todo.txt' || fname =~ 'version.*\.txt'
+ continue
+ endif
+
+ # Check for mixed tabs and spaces
+ cursor(1, 1)
+ while 1
+ lnum = search('[^/] \t')
+ if fname == 'visual.txt' && getline(lnum) =~ "STRING \tjkl"
+ || fname == 'usr_27.txt' && getline(lnum) =~ "\[^\? \t\]"
+ continue
+ endif
+ assert_equal(0, lnum, fpath .. ': space before tab')
+ if lnum == 0
+ break
+ endif
+ endwhile
+
+ # Check for unnecessary whitespace at the end of a line
+ cursor(1, 1)
+ while 1
+ lnum = search('[^/~\\]\s$')
+ # skip line that are known to have trailing white space
+ if fname == 'map.txt' && getline(lnum) =~ "unmap @@ $"
+ || fname == 'usr_12.txt' && getline(lnum) =~ "^\t/ \t$"
+ || fname == 'usr_41.txt' && getline(lnum) =~ "map <F4> o#include $"
+ || fname == 'change.txt' && getline(lnum) =~ "foobar bla $"
+ continue
+ endif
+ assert_equal(0, lnum, fpath .. ': trailing white space')
+ if lnum == 0
+ break
+ endif
+ endwhile
+
+ # TODO: Do check and fix help files
+ # # Check over 80 columns
+ # cursor(1, 1)
+ # while 1
+ # lnum = search('\%>80v.*$')
+ # assert_equal(0, lnum, fpath .. ': line over 80 columns')
+ # if lnum == 0
+ # break
+ # endif
+ # endwhile
+
+ endfor
+
+ set wrapscan&vim
+ bwipe!
+ enddef
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-9.0.1334/src/version.c 2023-02-21 12:38:46.827436713 +0000
--- src/version.c 2023-02-21 13:31:52.136479587 +0000
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 1335,
/**/
--
hundred-and-one symptoms of being an internet addict:
163. You go outside for the fresh air (at -30 degrees) but open the
window first to hear new mail arrive.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20230221133616.1AAF51C0045%40moolenaar.net.