mirror of
https://github.com/neovim/neovim.git
synced 2025-11-27 04:30:41 +00:00
Merge pull request #14291 from janlazo/vim-8.2.2709
vim-patch:8.2.{2709,2711,2714,2717}
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
" Vim support file to detect file types
|
" Vim support file to detect file types
|
||||||
"
|
"
|
||||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||||
" Last Change: 2020 Apr 29
|
" Last Change: 2021 Apr 05
|
||||||
|
|
||||||
" Listen very carefully, I will say this only once
|
" Listen very carefully, I will say this only once
|
||||||
if exists("did_load_filetypes")
|
if exists("did_load_filetypes")
|
||||||
@@ -1559,11 +1559,10 @@ au BufNewFile,BufRead catalog setf catalog
|
|||||||
" Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc.
|
" Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc.
|
||||||
" Gentoo ebuilds and Arch Linux PKGBUILDs are actually bash scripts
|
" Gentoo ebuilds and Arch Linux PKGBUILDs are actually bash scripts
|
||||||
" NOTE: Patterns ending in a star are further down, these have lower priority.
|
" NOTE: Patterns ending in a star are further down, these have lower priority.
|
||||||
au BufNewFile,BufRead .bashrc,bashrc,bash.bashrc,.bash[_-]profile,.bash[_-]logout,.bash[_-]aliases,bash-fc[-.],*.bash,*/{,.}bash[_-]completion{,.d,.sh}{,/*},*.ebuild,*.eclass,PKGBUILD call dist#ft#SetFileTypeSH("bash")
|
au BufNewFile,BufRead .bashrc,bashrc,bash.bashrc,.bash[_-]profile,.bash[_-]logout,.bash[_-]aliases,bash-fc[-.],*.ebuild,*.bash,*.eclass,PKGBUILD,APKBUILD call dist#ft#SetFileTypeSH("bash")
|
||||||
au BufNewFile,BufRead .kshrc,*.ksh call dist#ft#SetFileTypeSH("ksh")
|
au BufNewFile,BufRead .kshrc,*.ksh call dist#ft#SetFileTypeSH("ksh")
|
||||||
au BufNewFile,BufRead */etc/profile,.profile,*.sh,*.env call dist#ft#SetFileTypeSH(getline(1))
|
au BufNewFile,BufRead */etc/profile,.profile,*.sh,*.env call dist#ft#SetFileTypeSH(getline(1))
|
||||||
|
|
||||||
|
|
||||||
" Shell script (Arch Linux) or PHP file (Drupal)
|
" Shell script (Arch Linux) or PHP file (Drupal)
|
||||||
au BufNewFile,BufRead *.install
|
au BufNewFile,BufRead *.install
|
||||||
\ if getline(1) =~ '<?php' |
|
\ if getline(1) =~ '<?php' |
|
||||||
@@ -2237,8 +2236,11 @@ au BufNewFile,BufRead .reminders* call s:StarSetf('remind')
|
|||||||
" SGML catalog file
|
" SGML catalog file
|
||||||
au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog')
|
au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog')
|
||||||
|
|
||||||
|
" avoid doc files being recognized a shell files
|
||||||
|
au BufNewFile,BufRead */doc/{,.}bash[_-]completion{,.d,.sh}{,/*} setf text
|
||||||
|
|
||||||
" Shell scripts ending in a star
|
" Shell scripts ending in a star
|
||||||
au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,,PKGBUILD* call dist#ft#SetFileTypeSH("bash")
|
au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,PKGBUILD*,APKBUILD*,*/{,.}bash[_-]completion{,.d,.sh}{,/*} call dist#ft#SetFileTypeSH("bash")
|
||||||
au BufNewFile,BufRead .kshrc* call dist#ft#SetFileTypeSH("ksh")
|
au BufNewFile,BufRead .kshrc* call dist#ft#SetFileTypeSH("ksh")
|
||||||
au BufNewFile,BufRead .profile* call dist#ft#SetFileTypeSH(getline(1))
|
au BufNewFile,BufRead .profile* call dist#ft#SetFileTypeSH(getline(1))
|
||||||
|
|
||||||
|
|||||||
@@ -3971,7 +3971,8 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist)
|
|||||||
|
|
||||||
while (dist--) {
|
while (dist--) {
|
||||||
if (dir == BACKWARD) {
|
if (dir == BACKWARD) {
|
||||||
if (curwin->w_curswant >= width1) {
|
if (curwin->w_curswant >= width1
|
||||||
|
&& !hasFolding(curwin->w_cursor.lnum, NULL, NULL)) {
|
||||||
// Move back within the line. This can give a negative value
|
// Move back within the line. This can give a negative value
|
||||||
// for w_curswant if width1 < width2 (with cpoptions+=n),
|
// for w_curswant if width1 < width2 (with cpoptions+=n),
|
||||||
// which will get clipped to column 0.
|
// which will get clipped to column 0.
|
||||||
@@ -4003,14 +4004,16 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist)
|
|||||||
n = ((linelen - width1 - 1) / width2 + 1) * width2 + width1;
|
n = ((linelen - width1 - 1) / width2 + 1) * width2 + width1;
|
||||||
else
|
else
|
||||||
n = width1;
|
n = width1;
|
||||||
if (curwin->w_curswant + width2 < (colnr_T)n)
|
if (curwin->w_curswant + width2 < (colnr_T)n
|
||||||
/* move forward within line */
|
&& !hasFolding(curwin->w_cursor.lnum, NULL, NULL)) {
|
||||||
|
// move forward within line
|
||||||
curwin->w_curswant += width2;
|
curwin->w_curswant += width2;
|
||||||
else {
|
} else {
|
||||||
/* to next line */
|
// to next line
|
||||||
/* Move to the end of a closed fold. */
|
|
||||||
|
// Move to the end of a closed fold.
|
||||||
(void)hasFolding(curwin->w_cursor.lnum, NULL,
|
(void)hasFolding(curwin->w_cursor.lnum, NULL,
|
||||||
&curwin->w_cursor.lnum);
|
&curwin->w_cursor.lnum);
|
||||||
if (curwin->w_cursor.lnum == curbuf->b_ml.ml_line_count) {
|
if (curwin->w_cursor.lnum == curbuf->b_ml.ml_line_count) {
|
||||||
retval = false;
|
retval = false;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -417,7 +417,7 @@ let s:filename_checks = {
|
|||||||
\ 'sensors': ['/etc/sensors.conf', '/etc/sensors3.conf'],
|
\ 'sensors': ['/etc/sensors.conf', '/etc/sensors3.conf'],
|
||||||
\ 'services': ['/etc/services'],
|
\ 'services': ['/etc/services'],
|
||||||
\ 'setserial': ['/etc/serial.conf'],
|
\ 'setserial': ['/etc/serial.conf'],
|
||||||
\ 'sh': ['/etc/udev/cdsymlinks.conf'],
|
\ 'sh': ['.bashrc', 'file.bash', '/usr/share/doc/bash-completion/filter.sh','/etc/udev/cdsymlinks.conf', 'any/etc/udev/cdsymlinks.conf'],
|
||||||
\ 'sieve': ['file.siv', 'file.sieve'],
|
\ 'sieve': ['file.siv', 'file.sieve'],
|
||||||
\ 'simula': ['file.sim'],
|
\ 'simula': ['file.sim'],
|
||||||
\ 'sinda': ['file.sin', 'file.s85'],
|
\ 'sinda': ['file.sin', 'file.s85'],
|
||||||
@@ -471,7 +471,7 @@ let s:filename_checks = {
|
|||||||
\ 'tex': ['file.latex', 'file.sty', 'file.dtx', 'file.ltx', 'file.bbl'],
|
\ 'tex': ['file.latex', 'file.sty', 'file.dtx', 'file.ltx', 'file.bbl'],
|
||||||
\ 'texinfo': ['file.texinfo', 'file.texi', 'file.txi'],
|
\ 'texinfo': ['file.texinfo', 'file.texi', 'file.txi'],
|
||||||
\ 'texmf': ['texmf.cnf'],
|
\ 'texmf': ['texmf.cnf'],
|
||||||
\ 'text': ['file.text', 'README'],
|
\ 'text': ['file.text', 'README', '/usr/share/doc/bash-completion/AUTHORS'],
|
||||||
\ 'tf': ['file.tf', '.tfrc', 'tfrc'],
|
\ 'tf': ['file.tf', '.tfrc', 'tfrc'],
|
||||||
\ 'tidy': ['.tidyrc', 'tidyrc', 'tidy.conf'],
|
\ 'tidy': ['.tidyrc', 'tidyrc', 'tidy.conf'],
|
||||||
\ 'tilde': ['file.t.html'],
|
\ 'tilde': ['file.t.html'],
|
||||||
|
|||||||
@@ -823,31 +823,36 @@ func Test_fold_create_delete()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_fold_relative_move()
|
func Test_fold_relative_move()
|
||||||
enew!
|
new
|
||||||
set fdm=indent sw=2 wrap tw=80
|
set fdm=indent sw=2 wrap tw=80
|
||||||
|
|
||||||
let content = [ ' foo', ' bar', ' baz',
|
let longtext = repeat('x', &columns + 1)
|
||||||
\ repeat('x', &columns + 1),
|
let content = [ ' foo', ' ' .. longtext, ' baz',
|
||||||
\ ' foo', ' bar', ' baz'
|
\ longtext,
|
||||||
|
\ ' foo', ' ' .. longtext, ' baz'
|
||||||
\ ]
|
\ ]
|
||||||
call append(0, content)
|
call append(0, content)
|
||||||
|
|
||||||
normal zM
|
normal zM
|
||||||
|
|
||||||
call cursor(3, 1)
|
for lnum in range(1, 3)
|
||||||
call assert_true(foldclosed(line('.')))
|
call cursor(lnum, 1)
|
||||||
normal gj
|
call assert_true(foldclosed(line('.')))
|
||||||
call assert_equal(2, winline())
|
normal gj
|
||||||
|
call assert_equal(2, winline())
|
||||||
|
endfor
|
||||||
|
|
||||||
call cursor(2, 1)
|
call cursor(2, 1)
|
||||||
call assert_true(foldclosed(line('.')))
|
call assert_true(foldclosed(line('.')))
|
||||||
normal 2gj
|
normal 2gj
|
||||||
call assert_equal(3, winline())
|
call assert_equal(3, winline())
|
||||||
|
|
||||||
call cursor(5, 1)
|
for lnum in range(5, 7)
|
||||||
call assert_true(foldclosed(line('.')))
|
call cursor(lnum, 1)
|
||||||
normal gk
|
call assert_true(foldclosed(line('.')))
|
||||||
call assert_equal(3, winline())
|
normal gk
|
||||||
|
call assert_equal(3, winline())
|
||||||
|
endfor
|
||||||
|
|
||||||
call cursor(6, 1)
|
call cursor(6, 1)
|
||||||
call assert_true(foldclosed(line('.')))
|
call assert_true(foldclosed(line('.')))
|
||||||
|
|||||||
Reference in New Issue
Block a user