Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
4650df96
Kaydet (Commit)
4650df96
authored
Eki 13, 1998
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make the return key do what I mean more often.
üst
b39b90dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
PyShell.py
Tools/idle/PyShell.py
+11
-9
No files found.
Tools/idle/PyShell.py
Dosyayı görüntüle @
4650df96
...
@@ -368,18 +368,20 @@ class PyShell(PyShellEditorWindow):
...
@@ -368,18 +368,20 @@ class PyShell(PyShellEditorWindow):
if
self
.
executing
and
not
self
.
reading
:
if
self
.
executing
and
not
self
.
reading
:
return
# Let the default binding (insert '\n') take over
return
# Let the default binding (insert '\n') take over
# If some text is selected, recall the selection
# If some text is selected, recall the selection
# (but only if this before the I/O mark)
try
:
try
:
sel
=
self
.
text
.
get
(
"sel.first"
,
"sel.last"
)
sel
=
self
.
text
.
get
(
"sel.first"
,
"sel.last"
)
if
sel
:
if
sel
:
self
.
recall
(
sel
)
if
self
.
text
.
compare
(
"self.last"
,
"<="
,
"iomark"
):
return
"break"
self
.
recall
(
sel
)
return
"break"
except
:
except
:
pass
pass
# If we're strictly before the line containing iomark, recall
# If we're strictly before the line containing iomark, recall
# the current line, less a leading prompt, less leading or
# the current line, less a leading prompt, less leading or
# trailing whitespace
# trailing whitespace
if
self
.
text
.
compare
(
"insert"
,
"<"
,
"iomark linestart"
):
if
self
.
text
.
compare
(
"insert"
,
"<"
,
"iomark linestart"
):
# Check if there's a relevant stdin
mark
-- if so, use it
# Check if there's a relevant stdin
range
-- if so, use it
prev
=
self
.
text
.
tag_prevrange
(
"stdin"
,
"insert"
)
prev
=
self
.
text
.
tag_prevrange
(
"stdin"
,
"insert"
)
if
prev
and
self
.
text
.
compare
(
"insert"
,
"<"
,
prev
[
1
]):
if
prev
and
self
.
text
.
compare
(
"insert"
,
"<"
,
prev
[
1
]):
self
.
recall
(
self
.
text
.
get
(
prev
[
0
],
prev
[
1
]))
self
.
recall
(
self
.
text
.
get
(
prev
[
0
],
prev
[
1
]))
...
@@ -391,13 +393,13 @@ class PyShell(PyShellEditorWindow):
...
@@ -391,13 +393,13 @@ class PyShell(PyShellEditorWindow):
# No stdin mark -- just get the current line
# No stdin mark -- just get the current line
self
.
recall
(
self
.
text
.
get
(
"insert linestart"
,
"insert lineend"
))
self
.
recall
(
self
.
text
.
get
(
"insert linestart"
,
"insert lineend"
))
return
"break"
return
"break"
# If we're anywhere in the current input (including in the
# If we're in the current input before its last line,
# prompt) but not at the very end, move the cursor to the end.
# insert a newline right at the insert point
if
self
.
text
.
compare
(
"insert"
,
"<"
,
"end-1c"
):
if
self
.
text
.
compare
(
"insert"
,
"<"
,
"end-1c linestart"
):
self
.
text
.
mark_set
(
"insert"
,
"end-1c"
)
self
.
auto
.
autoindent
(
event
)
self
.
text
.
see
(
"insert"
)
return
"break"
return
"break"
# OK, we're already at the end -- insert a newline and run it.
# We're in the last line; append a newline and submit it
self
.
text
.
mark_set
(
"insert"
,
"end-1c"
)
if
self
.
reading
:
if
self
.
reading
:
self
.
text
.
insert
(
"insert"
,
"
\n
"
)
self
.
text
.
insert
(
"insert"
,
"
\n
"
)
self
.
text
.
see
(
"insert"
)
self
.
text
.
see
(
"insert"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment