Skip to content

Commit

Permalink
Merge pull request #1798 from paparodeo/vim-plugin-fix
Browse files Browse the repository at this point in the history
merlin.py: fix python-3.12 Syntax warnings
  • Loading branch information
voodoos authored Jul 12, 2024
2 parents ea30d3f + ce1f62f commit ce92495
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ unreleased
- A new `WRAPPING_PREFIX` configuration directive that can be used to tell Merlin
what to append to the current unit name in the presence of wrapping (#1788)
- Add `-unboxed-types` and `-no-unboxed-types` as ocaml ignored flags (#1795, fixes #1794)
+ editor modes
- vim: fix python-3.12 syntax warnings in merlin.py (#1798)

merlin 5.1
==========
Expand Down
14 changes: 7 additions & 7 deletions vim/merlin/autoload/merlin.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,19 +823,19 @@ def easy_matcher_wide(start, stop):
startl = ""
startc = ""
if start['line'] > 0:
startl = "\%{0}l".format(start['line'])
startl = "\\%{0}l".format(start['line'])
if start['col'] > 0:
startc = "\%{0}c".format(start['col'] + 1)
return '{0}{1}.*\%{2}l\%{3}c'.format(startl, startc, stop['line'], stop['col'] + 1)
startc = "\\%{0}c".format(start['col'] + 1)
return '{0}{1}.*\\%{2}l\\%{3}c'.format(startl, startc, stop['line'], stop['col'] + 1)

def easy_matcher(start, stop):
startl = ""
startc = ""
if start['line'] > 0:
startl = "\%>{0}l".format(start['line'] - 1)
startl = "\\%>{0}l".format(start['line'] - 1)
if start['col'] > 0:
startc = "\%>{0}c".format(start['col'])
return '{0}{1}\%<{2}l\%<{3}c'.format(startl, startc, stop['line'] + 1, stop['col'] + 1)
startc = "\\%>{0}c".format(start['col'])
return '{0}{1}\\%<{2}l\\%<{3}c'.format(startl, startc, stop['line'] + 1, stop['col'] + 1)

def hard_matcher(start, stop):
first_start = {'line' : start['line'], 'col' : start['col']}
Expand All @@ -847,7 +847,7 @@ def hard_matcher(start, stop):
last_start = {'line' : stop['line'], 'col' : 0}
last_stop = {'line' : stop['line'], 'col' : stop['col']}
last_line = easy_matcher(last_start, last_stop)
return "{0}\|{1}\|{2}".format(first_line, middle, last_line)
return "{0}\\|{1}\\|{2}".format(first_line, middle, last_line)

def make_matcher(start, stop):
if start['line'] == stop['line']:
Expand Down

0 comments on commit ce92495

Please sign in to comment.