Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
Vim
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Someone-Else
Vim
Commits
ef04586d
Commit
ef04586d
authored
17 years ago
by
Bram Moolenaar
Browse files
Options
Downloads
Patches
Plain Diff
updated for version 7.1-048
parent
150cc270
No related branches found
Branches containing commit
Tags
v7.3.591
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
runtime/plugin/matchparen.vim
+18
-6
18 additions, 6 deletions
runtime/plugin/matchparen.vim
src/version.c
+2
-0
2 additions, 0 deletions
src/version.c
with
20 additions
and
6 deletions
runtime/plugin/matchparen.vim
+
18
−
6
View file @
ef04586d
" Vim plugin for showing matching parens
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 200
6 Oct 12
" Last Change: 200
7 Jul 30
" Exit quickly when:
" - this plugin was already loaded (or disabled)
...
...
@@ -62,25 +62,37 @@ function! s:Highlight_Matching_Pair()
" Figure out the arguments for searchpairpos().
" Restrict the search to visible lines with "stopline".
" And avoid searching very far (e.g., for closed folds and long lines)
" The "viewable" variables give a range in which we can scroll while keeping
" the cursor at the same position
" adjustedScrolloff accounts for very large numbers of scrolloff
let
adjustedScrolloff
=
min
([
&
scrolloff
,
(
line
(
'w$'
)
-
line
(
'w0'
))
/
2
])
let
bottom_viewable
=
min
([
line
(
'$'
),
c_lnum
+
&
lines
-
adjustedScrolloff
-
2
])
let
top_viewable
=
max
([
1
,
c_lnum
-
&
lines
+
adjustedScrolloff
+
2
])
" one of these stoplines will be adjusted below, but the current values are
" minimal boundaries within the current window
let
stoplinebottom
=
line
(
'w$'
)
let
stoplinetop
=
line
(
'w0'
)
if
i
%
2
==
0
let
s_flags
=
'nW'
let
c2
=
plist
[
i
+
1
]
if
has
(
"byte_offset"
)
&&
has
(
"syntax_items"
)
&& &
smc
>
0
let
stopbyte
=
min
([
line2byte
(
"$"
),
line2byte
(
"."
)
+
col
(
"."
)
+
&
smc
*
2
])
let
stopline
=
min
([
line
(
'w$'
)
,
byte2line
(
stopbyte
)])
let
stopline
=
min
([
bottom_viewable
,
byte2line
(
stopbyte
)])
else
let
stopline
=
min
([
line
(
'w$'
)
,
c_lnum
+
100
])
let
stopline
=
min
([
bottom_viewable
,
c_lnum
+
100
])
endif
let
stoplinebottom
=
stopline
else
let
s_flags
=
'nbW'
let
c2
=
c
let
c
=
plist
[
i
-
1
]
if
has
(
"byte_offset"
)
&&
has
(
"syntax_items"
)
&& &
smc
>
0
let
stopbyte
=
max
([
1
,
line2byte
(
"."
)
+
col
(
"."
)
-
&
smc
*
2
])
let
stopline
=
max
([
line
(
'w0'
)
,
byte2line
(
stopbyte
)])
let
stopline
=
max
([
top_viewable
,
byte2line
(
stopbyte
)])
else
let
stopline
=
max
([
line
(
'w0'
)
,
c_lnum
-
100
])
let
stopline
=
max
([
top_viewable
,
c_lnum
-
100
])
endif
let
stoplinetop
=
stopline
endif
if
c
==
'['
let
c
=
'\['
...
...
@@ -106,7 +118,7 @@ function! s:Highlight_Matching_Pair()
endif
" If a match is found setup match highlighting.
if
m_lnum
>
0
&& m_lnum
>=
line
(
'w0'
)
&& m_lnum
<=
line
(
'w$'
)
if
m_lnum
>
0
&& m_lnum
>=
stoplinetop
&& m_lnum
<=
stoplinebottom
exe
'3match MatchParen /\(\%'
.
c_lnum
.
'l\%'
.
(
c_col
-
before
)
.
\
'c\)\|\(\%'
.
m_lnum
.
'l\%'
.
m_col
.
'c\)/'
let
w
:
paren_hl_on
=
1
...
...
This diff is collapsed.
Click to expand it.
src/version.c
+
2
−
0
View file @
ef04586d
...
...
@@ -666,6 +666,8 @@ static char *(features[]) =
static
int
included_patches
[]
=
{
/* Add new patch number below this line */
/**/
48
,
/**/
47
,
/**/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment