mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
cvs-py-rel2_1 (Rev 1.5) merge - whitespace normalization
This commit is contained in:
parent
6e735c98dc
commit
4d4d212325
1 changed files with 6 additions and 7 deletions
|
@ -158,7 +158,7 @@ class LastOpenBracketFinder:
|
||||||
startatindex = `startat` + ".0"
|
startatindex = `startat` + ".0"
|
||||||
# rawtext needs to contain everything up to the last
|
# rawtext needs to contain everything up to the last
|
||||||
# character, which was the close paren. the parser also
|
# character, which was the close paren. the parser also
|
||||||
# requires that the last line ends with "\n"
|
# requires that the last line ends with "\n"
|
||||||
rawtext = self.text.get(startatindex, "insert")[:-1] + "\n"
|
rawtext = self.text.get(startatindex, "insert")[:-1] + "\n"
|
||||||
y.set_str(rawtext)
|
y.set_str(rawtext)
|
||||||
bod = y.find_good_parse_start(
|
bod = y.find_good_parse_start(
|
||||||
|
@ -175,7 +175,7 @@ class LastOpenBracketFinder:
|
||||||
lno = index2line(self.text.index("insert"))
|
lno = index2line(self.text.index("insert"))
|
||||||
i, buf = self._find_offset_in_buf(lno)
|
i, buf = self._find_offset_in_buf(lno)
|
||||||
if i is None \
|
if i is None \
|
||||||
or keysym_type(buf[i]) != right_keysym_type:
|
or keysym_type(buf[i]) != right_keysym_type:
|
||||||
return None
|
return None
|
||||||
lines_back = string.count(buf[i:], "\n") - 1
|
lines_back = string.count(buf[i:], "\n") - 1
|
||||||
# subtract one for the "\n" added to please the parser
|
# subtract one for the "\n" added to please the parser
|
||||||
|
@ -189,4 +189,3 @@ class LastOpenBracketFinder:
|
||||||
icis=self.editwin.is_char_in_string):
|
icis=self.editwin.is_char_in_string):
|
||||||
return icis(startindex + "%dc" % offset)
|
return icis(startindex + "%dc" % offset)
|
||||||
return inner
|
return inner
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue