Commit graph

9 commits

Author SHA1 Message Date
Charlie Gordon
7b803ace0e Improve syntax coloring APIs
* pass const `char32_t` array and `QETermStyle` array to `ColorizeFunc`
* add `cp_colorize_line()` wrapper to call colorizer function on null
  terminated buffer.
* remove unused `EditBuffer` colorize fields
* remove `EditState` field `colorize_func`: rely on `colorize_mode` only
* no longer combine style into codepoint buffer.
* remove `STYLE_BITS`, `STYLE_SHIFT`, `CHAR_MASK`
* rename `set_colorize_func` as `set_colorize_mode`
* rename `SET_COLOR` and `SET_COLOR1` as `SET_STYLE` and `SET_STYLE1`
* add documentation for buffer API functions
2024-07-28 00:00:03 +02:00
Charlie Gordon
ea123bb012 Simplifications
* use `cp_skip_blanks` in language colorizers
* simplify signature matching for here documents
2024-07-28 00:00:03 +02:00
Charlie Gordon
6e2b6e24c2 Add eb_add_tag()
* add `eb_add_tag(b, offset, name)`:
  * check for duplicate definitions
  * duplicate string argument
* use `ab_add_tag()` instead of `eb_add_property()` from language colorizers
* fix `get_js_identifier()` for `c == 0` case.
2024-07-28 00:00:03 +02:00
Charlie Gordon
a388a95305
Pass QEmacsState pointer to all module_init and module_exit functions (#24) 2024-05-19 19:15:08 +02:00
oguillaumin
f36144d6a8 Change license to MIT
* bumped VERSION to 6.0.0
2023-03-05 02:04:02 +01:00
Charlie Gordon
7e70e611b6 Use char32_t for all code point variables and arrays
- char32_t is defined in cutils.h but may conflict with <uchar.h>
- all qe_isxxx functions take a char32_t
- add etf8x encoding for full range of char32_t type
- add utf8_decode_strict()
- add ustr_match_keyword()
- utf8_encode() / utf8_decode() handle up to 32 bits
- improve detect_charset():
  - detect utf8 and utf8x
  - avoid failure on partial utf8 sequence at end of buffer
  - detect overlong utf8 sequences
- fix display bugs for code points beyond MAX_UNICODE_DISPLAY
- simplify do_compare_windows(), avoid magic char values.
- rename functions:
    eb_encode_uchar -> eb_encode_char32
    eb_insert_uchar -> eb_insert_char32
    eb_insert_uchars -> eb_insert_char32_n
    eb_match_uchar -> eb_match_char32
    eb_delete_uchar -> eb_delete_char32
    eb_replace_uchar -> eb_replace_char32
    utf8_to_unicode -> utf8_to_char32
- use char32_t for all variables and arrays holding code-points
- fix some language syntax parsers.
- fix detect_eol_type_32bit(), used uint16_t instead of uint32_t
- bump VERSION to 5.4.0
2022-10-29 19:43:38 +02:00
Charlie Gordon
d052ab31ff Fix many compilation warnings for clang -Weverything
- made some local objects static
- fix many const cast issues
- fix comma operator warnings
- add const correct strtol_c(), strtoll_c(), strtold_c()
- add unconst(t) to override const removal warnings
- comment VLAs and flexible arrays
- use get_basename_offset() to enable const correct
  get_basename() and get_basename_nc()
- use get_extension_offset() to enable const correct
  get_extension() and get_extension_nc()
- always include config.h
- use size_t for some size arguments:
  umemmove(), umemcpy(), umemcmp(), qe_memicmp()
- add qe-doc.info and qe-doc.pdf targets
- fix shadowing bug in buf_write: used tor return 0 instead of byte count
- bumped version to 5.3.1e
2022-08-10 18:50:19 +02:00
Charlie Gordon
b96388ee95 Fix infinite loop in memfind()
- memfind used to loop forever trying to match shell_handlers
- match python2.8 and python3 in shbang line
- bump version to 5.3.1d
- this fixes #1 reported by cmsigler, thank you
2022-08-07 03:29:18 +02:00
Charlie Gordon
3b4f3c9f48 Split more languages from lang/extra-mode.c:
- add ada basic fortran haskell lua pascal python ruby smalltalk sql
  vimscript modes as separate modules
2020-11-18 23:20:57 +01:00