Skip to content

Allow the \%#= atom only at the start of the pattern#10439

Closed
chrisbra wants to merge 1 commit intovim:masterfrom
chrisbra:two_engines_pattern
Closed

Allow the \%#= atom only at the start of the pattern#10439
chrisbra wants to merge 1 commit intovim:masterfrom
chrisbra:two_engines_pattern

Conversation

@chrisbra
Copy link
Copy Markdown
Member

Currently, the pattern %#= is allowed everywhere, but only if it is at the start of the pattern, it will actually select the correct regexp engine.

However, Vim will happily accept a pattern like 'foo%#=2bar' but will interpret \%# as the current cursor position. So make the regexp a bit more strict and output an error, if the special atom \%#= is found anywhere but at the start of the pattern.

@chrisbra chrisbra changed the title Two engines pattern Allow the \%#= atom only at the start of the pattern May 17, 2022
@chrisbra chrisbra force-pushed the two_engines_pattern branch 2 times, most recently from 774bb4d to c52cb78 Compare May 18, 2022 12:15
@chrisbra chrisbra force-pushed the two_engines_pattern branch from c52cb78 to 6865cbc Compare May 18, 2022 12:33
@codecov
Copy link
Copy Markdown

codecov bot commented May 18, 2022

Codecov Report

Merging #10439 (6865cbc) into master (b1040dc) will increase coverage by 0.00%.
The diff coverage is 64.28%.

@@           Coverage Diff           @@
##           master   #10439   +/-   ##
=======================================
  Coverage   81.63%   81.63%           
=======================================
  Files         158      158           
  Lines      184714   184729   +15     
  Branches    41765    41767    +2     
=======================================
+ Hits       150789   150803   +14     
+ Misses      21436    21431    -5     
- Partials    12489    12495    +6     
Flag Coverage Δ
huge-clang-none 82.55% <57.14%> (-0.01%) ⬇️
linux 82.55% <57.14%> (-0.01%) ⬇️
mingw-x64-HUGE 0.00% <0.00%> (ø)
mingw-x64-HUGE-gui 78.04% <62.50%> (+0.01%) ⬆️
windows 76.82% <50.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/regexp_bt.c 87.40% <28.57%> (-0.18%) ⬇️
src/regexp_nfa.c 89.77% <100.00%> (+0.01%) ⬆️
src/sound.c 64.36% <0.00%> (-1.73%) ⬇️
src/libvterm/src/state.c 38.39% <0.00%> (-0.07%) ⬇️
src/channel.c 83.92% <0.00%> (-0.05%) ⬇️
src/version.c 84.16% <0.00%> (ø)
src/os_win32.c 57.05% <0.00%> (+0.07%) ⬆️
src/misc2.c 88.89% <0.00%> (+0.09%) ⬆️
src/ex_cmds.c 85.28% <0.00%> (+0.10%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b1040dc...6865cbc. Read the comment docs.

@brammool brammool closed this in 360da40 May 18, 2022
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Nov 5, 2022
…tart

Problem:    No error if engine selection atom is not at the start.
Solution:   Give an error. (Christian Brabandt, closes vim/vim#10439)

vim/vim@360da40

Co-authored-by: Christian Brabandt <cb@256bit.org>
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Nov 5, 2022
…tart

Problem:    No error if engine selection atom is not at the start.
Solution:   Give an error. (Christian Brabandt, closes vim/vim#10439)

vim/vim@360da40

Co-authored-by: Christian Brabandt <cb@256bit.org>
yesean pushed a commit to yesean/neovim that referenced this pull request Mar 25, 2023
…tart

Problem:    No error if engine selection atom is not at the start.
Solution:   Give an error. (Christian Brabandt, closes vim/vim#10439)

vim/vim@360da40

Co-authored-by: Christian Brabandt <cb@256bit.org>
@chrisbra chrisbra deleted the two_engines_pattern branch October 10, 2023 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant