Mercurial > vim
annotate runtime/ftplugin/readline.vim @ 34892:58416c1d1b94 v9.1.0309
patch 9.1.0309: crash when 'textwidth' > MAX_INT
Commit: https://github.com/vim/vim/commit/bba79808cb115d4f54063e8aa40628a927eab44e
Author: Christian Brabandt <cb@256bit.org>
Date: Thu Apr 11 22:54:44 2024 +0200
patch 9.1.0309: crash when 'textwidth' > MAX_INT
Problem: crash when 'textwidth' > MAX_INT (after vv9.1.0055)
(Zoltan Balogh)
Solution: limit textwidth to MAX_INT
fixes: #14482
closes: #14489
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 11 Apr 2024 23:15:03 +0200 |
parents | 8ae680be2a51 |
children | 89b487b08b2a |
rev | line source |
---|---|
375 | 1 " Vim filetype plugin file |
31430 | 2 " Language: readline(3) configuration file |
3 " Maintainer: Doug Kearns <dougkearns@gmail.com> | |
4 " Previous Maintainer: Nikolai Weibull <now@bitwi.se> | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33508
diff
changeset
|
5 " Last Change: 2023 Aug 22 |
375 | 6 |
7 if exists("b:did_ftplugin") | |
8 finish | |
9 endif | |
10 let b:did_ftplugin = 1 | |
11 | |
1698 | 12 let s:cpo_save = &cpo |
13 set cpo&vim | |
14 | |
31430 | 15 setlocal comments=:# |
16 setlocal commentstring=#\ %s | |
17 setlocal formatoptions-=t formatoptions+=croql | |
18 | |
389 | 19 let b:undo_ftplugin = "setl com< cms< fo<" |
375 | 20 |
31430 | 21 if exists("loaded_matchit") && !exists("b:match_words") |
22 let b:match_ignorecase = 0 | |
23 let b:match_words = '$if:$else:$endif' | |
24 let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words" | |
25 endif | |
26 | |
27 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") | |
34134
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33508
diff
changeset
|
28 let b:browsefilter = "Readline Intialization Files (inputrc, .inputrc)\tinputrc;*.inputrc\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33508
diff
changeset
|
29 if has("win32") |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33508
diff
changeset
|
30 let b:browsefilter ..= "All Files (*.*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33508
diff
changeset
|
31 else |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33508
diff
changeset
|
32 let b:browsefilter ..= "All Files (*)\t*\n" |
8ae680be2a51
runtime(ftplugin): Use "*" browsefilter pattern to match "All Files"
Christian Brabandt <cb@256bit.org>
parents:
33508
diff
changeset
|
33 endif |
31430 | 34 let b:undo_ftplugin ..= " | unlet! b:browsefilter" |
35 endif | |
1698 | 36 |
32976
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
32974
diff
changeset
|
37 if has('unix') && executable('less') |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
32974
diff
changeset
|
38 if !has('gui_running') |
33508
c252fbfde41d
runtime: make command name for &iskeywordprg more unique (#13297)
Christian Brabandt <cb@256bit.org>
parents:
33220
diff
changeset
|
39 command -buffer -nargs=1 ReadlineKeywordPrg |
32976
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
32974
diff
changeset
|
40 \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '\b'' --hilite-search" man ' . '3 readline' | |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
32974
diff
changeset
|
41 \ redraw! |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
32974
diff
changeset
|
42 elseif has('terminal') |
33508
c252fbfde41d
runtime: make command name for &iskeywordprg more unique (#13297)
Christian Brabandt <cb@256bit.org>
parents:
33220
diff
changeset
|
43 command -buffer -nargs=1 ReadlineKeywordPrg |
32976
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
32974
diff
changeset
|
44 \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . '3 readline' |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
32974
diff
changeset
|
45 endif |
33508
c252fbfde41d
runtime: make command name for &iskeywordprg more unique (#13297)
Christian Brabandt <cb@256bit.org>
parents:
33220
diff
changeset
|
46 if exists(':ReadlineKeywordPrg') == 2 |
32976
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
32974
diff
changeset
|
47 setlocal iskeyword+=- |
33508
c252fbfde41d
runtime: make command name for &iskeywordprg more unique (#13297)
Christian Brabandt <cb@256bit.org>
parents:
33220
diff
changeset
|
48 setlocal keywordprg=:ReadlineKeywordPrg |
c252fbfde41d
runtime: make command name for &iskeywordprg more unique (#13297)
Christian Brabandt <cb@256bit.org>
parents:
33220
diff
changeset
|
49 let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer ReadlineKeywordPrg' |
32976
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
32974
diff
changeset
|
50 endif |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
32974
diff
changeset
|
51 endif |
d23645a0aca8
runtime: configure keywordpg for some file types (#5566)
Christian Brabandt <cb@256bit.org>
parents:
32974
diff
changeset
|
52 |
1698 | 53 let &cpo = s:cpo_save |
54 unlet s:cpo_save | |
31430 | 55 |
56 " vim: nowrap sw=2 sts=2 ts=8 noet: |