[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode a61cb8b 062/405: Fixed issue with doc comment
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode a61cb8b 062/405: Fixed issue with doc comment indentation |
Date: |
Sat, 13 Jul 2019 09:59:43 -0400 (EDT) |
branch: externals/phps-mode
commit a61cb8ba0b1ceb8f35e0f293a36ccae50a8aa5f5
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Fixed issue with doc comment indentation
---
phps-functions.el | 13 ++++++++-----
sample-php-files/class.php | 2 +-
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/phps-functions.el b/phps-functions.el
index 8115cf1..a0f4aa1 100644
--- a/phps-functions.el
+++ b/phps-functions.el
@@ -67,13 +67,14 @@
(boundp 'phps-mode/lexer-tokens)
(> indent-start indent-end))
(let ((token-number start-token-number)
- (valid-tokens t))
+ (valid-tokens t)
+ (tokens phps-mode/lexer-tokens))
;; (message "token start %s, token end %s" start-token-number
end-token-number)
(while (and valid-tokens
(<= token-number end-token-number))
- (let ((token (car (nth token-number phps-mode/lexer-tokens)))
- (token-start (car (cdr (nth token-number
phps-mode/lexer-tokens))))
- (token-end (cdr (cdr (nth token-number
phps-mode/lexer-tokens)))))
+ (let ((token (car (nth token-number tokens)))
+ (token-start (car (cdr (nth token-number tokens))))
+ (token-end (cdr (cdr (nth token-number tokens)))))
(when (and valid-tokens
(or (>= token-start (point))
(>= token-end (point)))
@@ -86,7 +87,7 @@
(string= token "]")
(string= token ";")
(eq token 'T_CLOSE_TAG))))
- ;; (message "Token %s - %s in %s was invalid" token
token-number phps-mode/lexer-tokens)
+ ;; (message "Token %s - %s in %s was invalid" token
token-number tokens)
(setq valid-tokens nil)))
(setq token-number (+ token-number 1)))
(when valid-tokens
@@ -155,6 +156,7 @@
;; (message "Stopping iteration at: %s %s" start position)
(throw 'stop-iteration nil))
+ ;; Did we find any token on this line?
(when (and (not found-line-tokens)
(>= token-start line-beginning)
(<= token-end line-end))
@@ -176,6 +178,7 @@
(_)))
(when (and (< token-start line-beginning)
+ (>= token-end line-end)
(eq token 'T_DOC_COMMENT))
(setq line-in-doc-comment t))
diff --git a/sample-php-files/class.php b/sample-php-files/class.php
index e980006..730480e 100644
--- a/sample-php-files/class.php
+++ b/sample-php-files/class.php
@@ -2,7 +2,7 @@
/**
* Some comments here
* @todo was here
- */
+ **/
class MyClass
{
- [elpa] externals/phps-mode a259292 047/405: Changed indentation function to work solely on tokens, (continued)
- [elpa] externals/phps-mode a259292 047/405: Changed indentation function to work solely on tokens, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 4098f46 049/405: Started with incremental lexer, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode da1d1de 051/405: Temporary lexer after change until other work is ready, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 990d3dd 054/405: Added test for indentation of multiple-line doc comment, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode dd80d27 055/405: Started work on detecting doc comment blocks, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e1b7160 053/405: (newline-and-indent) now working, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 8aa1ab6 059/405: Another test for getting point data inside doc block, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 09daec3 052/405: Foundation for incremental lexer and syntax colorer completed, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 3f4c344 056/405: Fixed detection of doc comment blocks, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 3824abf 060/405: Resolved indent with trailing parenthesis, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode a61cb8b 062/405: Fixed issue with doc comment indentation,
Stefan Monnier <=
- [elpa] externals/phps-mode 6c597fb 065/405: Updated readme, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 0ca9fe8 058/405: Detection of point inside doc comment block improved, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 67f9a7a 057/405: Moved lexer-get-point-data to functions, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 27cd705 069/405: Updated readme, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 58300fd 070/405: More updates of readme, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 86ec35f 066/405: Incremental lexer working somewhat, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode ec71e15 074/405: Fixed bug where token-numbers are not defined, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 236f05e 071/405: Updated makefile to not use hard-coded path to emacs, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode bf633d2 061/405: Added test for indent of final line of doc comment block, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode ba8165a 063/405: Fixed bug with brace count not including braces inside double quoted strings, Stefan Monnier, 2019/07/13