mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
diagnostics: learn how to count column number with multibyte chars
So far diagnostics were cheating: in addition to the 'column' field of locations (based on actual screen width per multibyte characters and on tabulation expansion), the scanner sets the 'byte' field. Diagnostics used this byte count to decide where to insert (color) style. We want to be able to truncate the quoted lines when there are too wide to fit the screen. This requires that the diagnostics learn how to count columns, the byte-in-boundary trick no longer works. Bytes are still used for fix-its. * bootstrap.conf: We need mbfile for mbf_getc. * src/location.c (caret_info): We need an mbfile. (caret_set_file): Initialize it. (caret_getc): Convert to mbfile. (location_caret): Instead of relying on the byte position to decide where to insert the color style, count the current column using boundary_compute.
This commit is contained in:
5
lib/.gitignore
vendored
5
lib/.gitignore
vendored
@@ -133,6 +133,7 @@
|
||||
/isnanf.c
|
||||
/isnanl-nolibm.h
|
||||
/isnanl.c
|
||||
/iswblank.c
|
||||
/itold.c
|
||||
/ldexpl.c
|
||||
/libc-config.h
|
||||
@@ -149,6 +150,10 @@
|
||||
/math.c
|
||||
/math.h
|
||||
/math.in.h
|
||||
/mbchar.c
|
||||
/mbchar.h
|
||||
/mbfile.c
|
||||
/mbfile.h
|
||||
/mbrtowc.c
|
||||
/mbsinit.c
|
||||
/mbswidth.c
|
||||
|
||||
Reference in New Issue
Block a user