[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/kotlin-mode ed5bb641a9 073/162: makes tab-width configurab
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/kotlin-mode ed5bb641a9 073/162: makes tab-width configurable |
Date: |
Sat, 29 Jan 2022 08:25:24 -0500 (EST) |
branch: elpa/kotlin-mode
commit ed5bb641a967df6464b5c43a688d8fc3febe13c1
Author: Gregg Hernandez <gregg@lucidchart.com>
Commit: Gregg Hernandez <gregg@lucidchart.com>
makes tab-width configurable
---
kotlin-mode.el | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/kotlin-mode.el b/kotlin-mode.el
index f2012bcb2a..44784cf845 100644
--- a/kotlin-mode.el
+++ b/kotlin-mode.el
@@ -27,6 +27,16 @@
(require 'rx)
+(defgroup kotlin nil
+ "A Kotlin major mode."
+ :group 'languages)
+
+(defcustom kotlin-tab-width default-tab-width
+ "The tab width to use for indentation."
+ :type 'integer
+ :group 'kotlin-mode
+ :safe 'integerp)
+
(defvar kotlin-mode-map
(let ((map (make-keymap)))
(define-key map (kbd "<tab>") 'c-indent-line-or-region)
@@ -221,14 +231,14 @@
(cond ((looking-at "^[ \t]*}")
(save-excursion
(forward-line -1)
- (setq cur-indent (- (current-indentation) default-tab-width)))
+ (setq cur-indent (- (current-indentation) kotlin-tab-width)))
(if (< cur-indent 0)
(setq cur-indent 0)))
((looking-at "^[ \t]*)")
(save-excursion
(forward-line -1)
- (setq cur-indent (- (current-indentation) (* 2
default-tab-width))))
+ (setq cur-indent (- (current-indentation) (* 2
kotlin-tab-width))))
(if (< cur-indent 0)
(setq cur-indent 0)))
@@ -237,7 +247,7 @@
(while not-indented
(forward-line -1)
(cond ((looking-at ".*{[ \t]*$") ; 4.)
- (setq cur-indent (+ (current-indentation)
default-tab-width))
+ (setq cur-indent (+ (current-indentation)
kotlin-tab-width))
(setq not-indented nil))
((looking-at "^[ \t]*}") ; 3.)
@@ -245,11 +255,11 @@
(setq not-indented nil))
((looking-at ".*{.*->[ \t]*$")
- (setq cur-indent (+ (current-indentation)
default-tab-width))
+ (setq cur-indent (+ (current-indentation)
kotlin-tab-width))
(setq not-indented nil))
((looking-at ".*([ \t]*$")
- (setq cur-indent (+ (current-indentation) (* 2
default-tab-width)))
+ (setq cur-indent (+ (current-indentation) (* 2
kotlin-tab-width)))
(setq not-indented nil))
((looking-at "^[ \t]*).*$")
- [nongnu] elpa/kotlin-mode 5d2d7b4f5a 157/162: Make underscore and at sign as a part of a symbol, (continued)
- [nongnu] elpa/kotlin-mode 5d2d7b4f5a 157/162: Make underscore and at sign as a part of a symbol, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 613539eedc 042/162: Fix trailing parentheses, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode b4b1ace8cc 043/162: In kotlin-mode.el: (c) -> ©, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 9762ca895d 050/162: The characters '?' and '!' are now font-locked properly in types, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 8910b4bf55 054/162: Add "as" to set of statement keywords, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 4aef379a2a 062/162: Removed rx dependency from Caskfile, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 0d89426a75 064/162: Merge branch 'package-improvements' of https://github.com/rexim/kotlin-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 565a266142 063/162: Add kt to auto-mode-alist to trigger kotlin-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 043615d3c3 065/162: Merge branch 'master' of https://github.com/purcell/kotlin-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode b4ec722a4c 071/162: lexical-binding setting must be at first line, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode ed5bb641a9 073/162: makes tab-width configurable,
ELPA Syncer <=
- [nongnu] elpa/kotlin-mode 52c8099b45 078/162: Merge pull request #1 from taktoa/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode afbf3ae8fe 081/162: Merge branch 'master' of https://github.com/gregghz/kotlin-mode into gregghz-master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode cd4901acc6 080/162: Merge pull request #6 from jasonm23/patch-1, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode f54da34b3f 088/162: Merge pull request #11 from russel/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode c051947e27 041/162: kotlin-mode: Highlight string interpolations, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode a659099864 037/162: kotlin-mode: Add kotlin-mode--syntax-propertize-interpolation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode c40557c411 053/162: Merge pull request #1 from gergoerdi/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 2f3d991159 060/162: Remove redundant declaration of hook and keymap, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 953bb91328 151/162: Merge pull request #50 from taku0/fix-comment-at-bob, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode ab61099682 152/162: use 4 for defualt tab width, ELPA Syncer, 2022/01/29