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
33f2b7b2
Kaydet (Commit)
33f2b7b2
authored
Ock 03, 1999
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added something like Tim Peters' backspace patch.
üst
0c65e250
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
2 deletions
+28
-2
AutoIndent.py
Tools/idle/AutoIndent.py
+28
-2
No files found.
Tools/idle/AutoIndent.py
Dosyayı görüntüle @
33f2b7b2
...
@@ -47,8 +47,12 @@ class AutoIndent:
...
@@ -47,8 +47,12 @@ class AutoIndent:
]),
]),
]
]
windows_keydefs
=
{
keydefs
=
{
'<<smart-backspace>>'
:
[
'<Key-BackSpace>'
],
'<<newline-and-indent>>'
:
[
'<Key-Return>'
,
'<KP_Enter>'
],
'<<newline-and-indent>>'
:
[
'<Key-Return>'
,
'<KP_Enter>'
],
}
windows_keydefs
=
{
'<<indent-region>>'
:
[
'<Control-bracketright>'
],
'<<indent-region>>'
:
[
'<Control-bracketright>'
],
'<<dedent-region>>'
:
[
'<Control-bracketleft>'
],
'<<dedent-region>>'
:
[
'<Control-bracketleft>'
],
'<<comment-region>>'
:
[
'<Alt-Key-3>'
],
'<<comment-region>>'
:
[
'<Alt-Key-3>'
],
...
@@ -58,7 +62,6 @@ class AutoIndent:
...
@@ -58,7 +62,6 @@ class AutoIndent:
}
}
unix_keydefs
=
{
unix_keydefs
=
{
'<<newline-and-indent>>'
:
[
'<Key-Return>'
,
'<KP_Enter>'
],
'<<indent-region>>'
:
[
'<Alt-bracketright>'
,
'<<indent-region>>'
:
[
'<Alt-bracketright>'
,
'<Meta-bracketright>'
,
'<Meta-bracketright>'
,
'<Control-bracketright>'
],
'<Control-bracketright>'
],
...
@@ -86,6 +89,29 @@ class AutoIndent:
...
@@ -86,6 +89,29 @@ class AutoIndent:
else
:
else
:
raise
KeyError
,
"bad option name:
%
s"
%
`key`
raise
KeyError
,
"bad option name:
%
s"
%
`key`
def
smart_backspace_event
(
self
,
event
):
text
=
self
.
text
try
:
first
=
text
.
index
(
"sel.first"
)
last
=
text
.
index
(
"sel.last"
)
except
TclError
:
first
=
last
=
None
if
first
and
last
:
text
.
delete
(
first
,
last
)
text
.
mark_set
(
"insert"
,
first
)
return
"break"
# After Tim Peters
ndelete
=
1
chars
=
text
.
get
(
"insert linestart"
,
"insert"
)
i
=
0
n
=
len
(
chars
)
while
i
<
n
and
chars
[
i
]
in
"
\t
"
:
i
=
i
+
1
if
i
==
n
and
chars
[
-
4
:]
==
" "
:
ndelete
=
4
text
.
delete
(
"insert -
%
d chars"
%
ndelete
,
"insert"
)
return
"break"
def
newline_and_indent_event
(
self
,
event
):
def
newline_and_indent_event
(
self
,
event
):
text
=
self
.
text
text
=
self
.
text
try
:
try
:
...
...
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