Skip to content

Commit ce92495

Browse files
authored
Merge pull request #1798 from paparodeo/vim-plugin-fix
merlin.py: fix python-3.12 Syntax warnings
2 parents ea30d3f + ce1f62f commit ce92495

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ unreleased
55
- A new `WRAPPING_PREFIX` configuration directive that can be used to tell Merlin
66
what to append to the current unit name in the presence of wrapping (#1788)
77
- Add `-unboxed-types` and `-no-unboxed-types` as ocaml ignored flags (#1795, fixes #1794)
8+
+ editor modes
9+
- vim: fix python-3.12 syntax warnings in merlin.py (#1798)
810

911
merlin 5.1
1012
==========

vim/merlin/autoload/merlin.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -823,19 +823,19 @@ def easy_matcher_wide(start, stop):
823823
startl = ""
824824
startc = ""
825825
if start['line'] > 0:
826-
startl = "\%{0}l".format(start['line'])
826+
startl = "\\%{0}l".format(start['line'])
827827
if start['col'] > 0:
828-
startc = "\%{0}c".format(start['col'] + 1)
829-
return '{0}{1}.*\%{2}l\%{3}c'.format(startl, startc, stop['line'], stop['col'] + 1)
828+
startc = "\\%{0}c".format(start['col'] + 1)
829+
return '{0}{1}.*\\%{2}l\\%{3}c'.format(startl, startc, stop['line'], stop['col'] + 1)
830830

831831
def easy_matcher(start, stop):
832832
startl = ""
833833
startc = ""
834834
if start['line'] > 0:
835-
startl = "\%>{0}l".format(start['line'] - 1)
835+
startl = "\\%>{0}l".format(start['line'] - 1)
836836
if start['col'] > 0:
837-
startc = "\%>{0}c".format(start['col'])
838-
return '{0}{1}\%<{2}l\%<{3}c'.format(startl, startc, stop['line'] + 1, stop['col'] + 1)
837+
startc = "\\%>{0}c".format(start['col'])
838+
return '{0}{1}\\%<{2}l\\%<{3}c'.format(startl, startc, stop['line'] + 1, stop['col'] + 1)
839839

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

852852
def make_matcher(start, stop):
853853
if start['line'] == stop['line']:

0 commit comments

Comments
 (0)