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
0c6563f7
Kaydet (Commit)
0c6563f7
authored
Eyl 14, 1995
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
(py-electric-colon): turn off electric behavior inside strings and
comments.
üst
57697af9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
23 deletions
+31
-23
python-mode.el
Misc/python-mode.el
+31
-23
No files found.
Misc/python-mode.el
Dosyayı görüntüle @
0c6563f7
...
...
@@ -471,31 +471,39 @@ py-beep-if-tab-change\tring the bell if tab-width is changed"
(
defun
py-electric-colon
(
arg
)
"Insert a colon.
In certain cases the line is outdented appropriately. If a numeric
argument is provided, that many colons are inserted non-electrically."
argument is provided, that many colons are inserted non-electrically.
Electric behavior is inhibited inside a string or comment."
(
interactive
"P"
)
(
self-insert-command
(
prefix-numeric-value
arg
))
(
save-excursion
(
let
((
here
(
point
))
(
outdent
0
)
(
indent
(
py-compute-indentation
)))
(
if
(
and
(
not
arg
)
(
py-outdent-p
)
(
=
indent
(
save-excursion
(
forward-line
-1
)
(
py-compute-indentation
)))
)
(
setq
outdent
py-indent-offset
))
;; Don't indent, only outdent. This assumes that any lines that
;; are already outdented relative to py-compute-indentation were
;; put there on purpose. Its highly annoying to have `:' indent
;; for you. Use TAB, C-c C-l or C-c C-r to adjust. TBD: Is
;; there a better way to determine this???
(
if
(
<
(
current-indentation
)
indent
)
nil
(
goto-char
here
)
(
beginning-of-line
)
(
delete-horizontal-space
)
(
indent-to
(
-
indent
outdent
))
))))
;; are we in a string or comment?
(
if
(
save-excursion
(
let
((
pps
(
parse-partial-sexp
(
save-excursion
(
beginning-of-python-def-or-class
)
(
point
))
(
point
))))
(
not
(
or
(
nth
3
pps
)
(
nth
4
pps
)))))
(
save-excursion
(
let
((
here
(
point
))
(
outdent
0
)
(
indent
(
py-compute-indentation
)))
(
if
(
and
(
not
arg
)
(
py-outdent-p
)
(
=
indent
(
save-excursion
(
forward-line
-1
)
(
py-compute-indentation
)))
)
(
setq
outdent
py-indent-offset
))
;; Don't indent, only outdent. This assumes that any lines that
;; are already outdented relative to py-compute-indentation were
;; put there on purpose. Its highly annoying to have `:' indent
;; for you. Use TAB, C-c C-l or C-c C-r to adjust. TBD: Is
;; there a better way to determine this???
(
if
(
<
(
current-indentation
)
indent
)
nil
(
goto-char
here
)
(
beginning-of-line
)
(
delete-horizontal-space
)
(
indent-to
(
-
indent
outdent
))
)))))
(
defun
py-indent-right
(
arg
)
"Indent the line by one `py-indent-offset' level.
...
...
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