Fix: preserve all leading spaces in paragraph indentation
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
This commit is contained in:
parent
5e3571f689
commit
6d65902933
@ -128,11 +128,16 @@
|
|||||||
PREV-STATE: 1=latin, 2=CJK (previous content type).
|
PREV-STATE: 1=latin, 2=CJK (previous content type).
|
||||||
NEXT-WIDTH: width of next character (1=latin, 2=CJK).
|
NEXT-WIDTH: width of next character (1=latin, 2=CJK).
|
||||||
Rules:
|
Rules:
|
||||||
- Latin-Latin: single space handled by glue, multiple preserves all but last
|
- Leading spaces (boxes is nil): preserve all spaces
|
||||||
- CJK involved (prev or next is CJK): preserve ALL spaces"
|
- CJK involved (prev or next is CJK): preserve all spaces
|
||||||
|
- Latin-Latin with single space: let glue handle it
|
||||||
|
- Latin-Latin with multiple spaces: preserve all but last"
|
||||||
(when (and spaces (not (string-empty-p spaces)))
|
(when (and spaces (not (string-empty-p spaces)))
|
||||||
(let ((cjk-involved (or (= prev-state 2) (= next-width 2))))
|
(let ((cjk-involved (or (= prev-state 2) (= next-width 2))))
|
||||||
(cond
|
(cond
|
||||||
|
;; Leading spaces (no previous boxes): preserve all
|
||||||
|
((null boxes)
|
||||||
|
(setq boxes (cons spaces boxes)))
|
||||||
;; CJK involved: preserve all spaces
|
;; CJK involved: preserve all spaces
|
||||||
(cjk-involved
|
(cjk-involved
|
||||||
(setq boxes (cons spaces boxes)))
|
(setq boxes (cons spaces boxes)))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user