Skip to content

Commit 7377011

Browse files
committed
Use position-bytes function instead of point
I thought this was intuitively a problem of phpactor/worse-reflection, but in fact it is a problem of Tolerant PHP Parser. https://github.com/Microsoft/tolerant-php-parser In modern environments it is obsolete to operate in byte units instead of character units, but Tolerant PHP Parser's current implementation adopt byte offsets.
1 parent c5328bb commit 7377011

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

phpactor.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
(point-min) (point-max)))
217217
(:path (phpactor--expand-local-file-name buffer-file-name))
218218
(:source_path (phpactor--expand-local-file-name buffer-file-name))
219-
(:offset (1- (point)))
219+
(:offset (1- (position-bytes (point))))
220220
(:current_path (phpactor--expand-local-file-name buffer-file-name))
221221
(t (error "`%s' is unknown argument" key))))
222222

0 commit comments

Comments
 (0)