Commit graph

1,216 commits

Author SHA1 Message Date
クエン酸
bed552a905 Add commands next-buffer / previous-buffer (#20)
* Bind `next-buffer` to `C-x C-right` and `previous-buffer` to `C-x left` just like GNU Emacs
* next-buffer & previous-buffer skip buffers with BF_SYSTEM flag.
* next-buffer & previous-buffer command is ignored from minibuffer and popups.
* fix compilation errors on linux
2024-05-19 17:06:04 +02:00
Charlie Gordon
a9d4b1c0fa Add v8-torque support
- colorize decorators @xxx in js-mode
2024-03-10 12:15:59 +01:00
Charlie Gordon
234566f028
Merge pull request #17 from mystuffs/master
Add "Result" keyword for Rust
2024-03-06 08:43:41 +01:00
Charlie Gordon
eb46f4bd87 Improve shell-mode colorizer
- dump colorize_states in describe-window
- improve shell output parser to colorize code in shell output:
  * recognize patch output (diff -u)
  * recognize compiler errors
  * recognize some commands: cat, head, tail
2024-02-10 20:47:53 +01:00
Charlie Gordon
b179e97c1c Add ignore-preproc option in compare-windows
- add ignore-preproc global variable
- C-u 0 A-= resets the ignore flags
2024-02-10 20:41:53 +01:00
Charlie Gordon
85b5854d65 Fix markdown parsing bug 2024-02-10 20:37:38 +01:00
Charlie Gordon
a48695fb70 Add Vale and Bee language colorizers 2024-02-10 20:34:59 +01:00
Charlie Gordon
8994456e62 Fix clang compiler warnings
- add fallthrough pseudo keyword
- fix some macro issues
- fix compiler warnings
2024-02-10 20:29:26 +01:00
Charlie Gordon
b5ef5511ca Add Crystal language colorizer (work in progress) 2024-02-10 20:01:33 +01:00
Charlie Gordon
b625b5af00 Fun stuff
- add Newton fractal type
- accept universal argument in madelbrot-test for fractal type
2023-07-08 22:56:36 +02:00
Charlie Gordon
38e22bc211 Improve scripting language
- improve qs/js syntax highlighter
- improve markdown code block language detection
- fix binding for increase-width and decrease-width
- increase COLORED_MAX_LINE_SIZE to 16k
2023-07-08 22:54:49 +02:00
rilysh
abd615773a add "Result" keyword Rust 2023-05-21 12:16:26 -04:00
Charlie Gordon
1f79d713b0 Improve CSV syntax highlighter
* refine number and date matching
2023-03-15 09:58:33 +01:00
Charlie Gordon
7cf5878805 Add CSV mode
* add csv-mode with colorizer
* split lang/extra-modes.c to lang/emf.c and lang/sharp.c
* bump VERSION to 6.1.1c
2023-03-13 23:07:26 +01:00
Charlie Gordon
06b3d373bb Update number syntax for C23 and C++
* support quote as digit separator in C/C++ modes
  - this convention is horrible!
  - why not use _ which is compatible with the ppnumber syntax?
* bump VERSION to 6.1.1b
2023-03-09 12:57:59 +01:00
Charlie Gordon
d9633d761a Sundries
* update README.md and TODO.md
* study alternative key mapping scheme
* some constifications
2023-03-09 12:38:45 +01:00
Charlie Gordon
909f097165 Sundries
* should add auto-indent visual display for minified XML, JS, JSON files
2023-03-05 19:42:12 +01:00
Charlie Gordon
cdc935a773 Fix linux compilation problems
- add useless cast to fix unsigned comparison warning
- bump VERSION to 6.1.1a
2023-03-05 14:36:44 +01:00
Charlie Gordon
5a990e0866 Update stb_image.h to version 2.28
* version 2.28 (dated 2023-01-29) has many error detection patches
  but still needs some simple patches to silence warnings
* bumped VERSION to 6.1.1
2023-03-05 14:17:33 +01:00
Charlie Gordon
fcf4c46321 Add regex support for search and replace
* import libunicode and libregexp from QuickJS
* add utility functions:
  min/max_uint32, min/max_int64 clz/ctz/32/64
  bswap12/32/64
* add packed get and put inline functions
* add DynBuf package (dbuf_xxx)
* add unicode_to/from_utf8()
* add regex support in eb_search
* add partial regex support in query_replace: no subexpressions support
* bumped VERSION to 6.1.0
2023-03-05 13:34:19 +01:00
oguillaumin
f36144d6a8 Change license to MIT
* bumped VERSION to 6.0.0
2023-03-05 02:04:02 +01:00
oguillaumin
cb5fbbce4e Merge qfribidi into unicode_join
* remove qfribidi.h and qfribidi.c
* simplify get_mirror_char(), use table from Unicode 15.0
* improve bidir_get_type(), compact_list()
* use combined type tests for 3, 4 and 6 types
* bumped VERSION to 5.4.2
2023-03-05 01:12:14 +01:00
Charlie Gordon
b321c1923a increase string lengths in script fragments
* bump buffer size from 256 to 2048 in format and variable retrieval
* number VERSION to 5.4.1g
2023-03-04 15:59:09 +01:00
Charlie Gordon
c223ed2760 small changes in unicode_join:
* use more consistent names
* use incl/excl range in binary searches
2023-03-03 20:10:10 +01:00
Charlie Gordon
e25667c577 Fix eval_region
* factorize evaluation result handling
* make QEValue.type signed to handle TOK_ERR and TOK_EOF
* extract buffer contents as UTF-8
* eval-region and eval-buffer take universal argument to insert expression
  result instead of showing as message
2023-02-24 12:14:40 +01:00
Charlie Gordon
bf0c938d19 Sundries
* bind `eval-region` to `M-C-z`
* fix configure and Makefile for arm64 target
* output selected target in configure

* bump version to 5.4.1f
2023-02-21 15:04:55 +01:00
Charlie Gordon
2231ae93f6 Improve qscript language and support
* add multi-line strings with """ syntax and escaped newlines
* call commands with allocated string arguments instead of local arena
* improve triple quoted string support in C like colorizers
* increase SEARCH_LENGTH to 2K (should use allocated arrays)
* fix kill-matching-lines definition
* fix utf8_to_char32 implementation inconsistency for empty destination
* fix buffering errors in eb_insert_utf8_buf() and eb_insert_char32_buf()

* bump version to 5.4.1e
2022-11-22 23:21:28 +01:00
Charlie Gordon
d0f7b7a904 Various improvements for consistency
* add -Wno-packed compiler option
* add CONFIG_REGEX flag, undefined for tiny build
* disable regex commands in tiny build
* add documentation for some search commands and APIs
* reorder search tags for readability
* add isearch_yank_char
* use emacs names for:
  isearch-repeat-backward, isearch-repeat-forward,
  isearch-ring-advance, isearch-ring-retreat,
  isearch-yank-word-or-char
* add occur alias for list-matching-lines
* add char32_to_utf8()
* restored some macros in cutils.h:
  likely(x), unlikely(x), __maybe_unused, BOOL, FALSE, TRUE
* remove max(), min(), maxp(), minp(), clampp()
* add typed arithmetic functions:
   min_int(), max_int(), clamp_int(), min3_int(), max3_int()
   min_offset(), max_offset(), clamp_offset()
* use typed functions everywhere

* bump version to 5.4.1d
2022-11-21 00:20:18 +01:00
Charlie Gordon
216b3ff8b7 Fix gcc 12.2 insane optimisation issues fixes issue #11
* use memcpy and other value casts to avoid strict aliasing violations.
  gcc 12.2 was wrongly assuming that utf8_decode(&p) did not modify p
  because *pp was never explicitly set, albeit *(const u8 **)pp = p; was
  storing te updated value of p into it and the code generated for that
  was produced.  The code generator was miscompiling strtokey1 because
  the compiler relied on bogus code analysis at the call site.

  The gcc team is wasting many hours of valuable debugging time.
  They should at least issue a warning about aliasing rules violations.

* fix compiler warning on missing Xvideo header

* fix compiler warning on missing fallthrough

* bump version to 5.4.1c
2022-11-11 17:49:50 +01:00
Charlie Gordon
138be0a3ca Improvements in search functions
* eb_get_region_contents and eb_get_contents take an extra argument
  encode_null to encode embedded null bytes as "\xC0\x80"
* use steps instead of flags for isearch state array:
  max 256 code points, 512 steps and 768 search bytes
* add remove_string() to remove a string from a StringArray and pack the array
* rename get_history() as qe_get_history() and make it public
* prevent multiple registration of command tables in qe_register_commands()
* silence compiler warning on array size in charname_complete()
* remove last_search_u32 data, use search history list instead
* restrict search commands to the current region if highlighted

* bump version to 5.4.1b
2022-11-11 15:45:49 +01:00
Charlie Gordon
6880277ec0 Improvements in search functions
* add search modes:
  copy-matching-lines, kill-matching-lines, list-matching-lines
  - add enum for search modes

* add search flag support in all search functions:
    search_forward, search_backward, count-matches, delete-matching-lines,
    delete-non-matching-lines, copy-matching-lines, kill-matching-lines,
    list-matching-lines, query-replace, replace-string
  - highlight matches during search string input
  - add search flag toggle functions in minibuffer_edit
    same code and bindings as for incremental search
  - add handlers in CompletionDef for minibuffer_edit session start and end
  - use generic search tag system to store flags in search string

* misc improvements and bug fixes:
  - test and set append-next-kill on kill-region
  - split `do_copy_region` from `do_kill_region`
  - remove argument in `do_kill_region` for `kill-region`
  - change immediate string argument code letter from 'S' to '@'
  - exit popup with do_popup_exit() in do_keyboard_quit
    remove popup_mode binding
  - add ESiii and ESsii command calling conventions
  - pass key and argval to:
    minibuffer_complete, do_minibuffer_complete_space,
    do_minibuffer_electric_key

* add default bindings:
    `next-error` on `M-g n`, `M-g M-n`
    `previous-error` on `M-g p`, `M-g M-p`
    `goto-line` on `M-g g`, `M-g M-g`, `C-x g`
    `goto-char` on `M-g c`

* bump version to 5.4.1a
2022-11-06 12:08:19 +01:00
Charlie Gordon
60390867ae Use wide char specific classification and case functions
* qe_toupper and qe_tolower handle only ASCII subset
* add qe_wtolower() and qe_wtoupper() for Unicode case conversions
  current implementation is partial
* handle accents in qe_wtolower() and qe_wtoupper() only
* add qe_iswalpha(), qe_iswlower() and qe_iswupper()
* restrict filename lowercasing kludge in reduce_filename()
* restrict qe_findchar() and qe_indexof() to ASCII subset
* rename functions:
   eb_match_str  => eb_match_str_utf8
   eb_match_istr => eb_match_istr_utf8
   strimatch_pat => utf8_strimatch_pat
   ustr_get_word => utf8_get_word
   wctoupper     => qe_wctoupper
   wctolower     => qe_wctolower
   strimatch_pat => utf8_strimatch_pat
   str_get_word  => str_get_word7
* handle accented letters in buffer casing functions
2022-11-01 01:19:32 +01:00
Charlie Gordon
9376e4be76 Handle accented letters in case functions
* add wctoupper() and wctolower()
* add qe_unaccent(c);
* use ligature functions for the above
* handle accents in qe_toupper() and qe_tolower()
* add convert_entry() method in CompletionDef
* pass CompletionDef pointer to minibuffer_edit callback
2022-10-31 10:59:11 +01:00
Charlie Gordon
47cc1d4052 Allow Unicode character names in insert-char, with completion
* add pattern matching in completion using *
* add `C-x 8 RET` binding for `insert-char`
* add charname completion
* add CT_GLOB and CT_IGLOB enumeration modes
* use CT_STRX for more completions
* add strmatch_pat() and strimatch_pat() utility functions
* add open_resource_file()
2022-10-30 21:18:39 +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
0099f138c9 Move UTF-8 utility functions to util.c
- simplify utf8_decode()
- simplify longest common prefix code in do_minibuffer_complete
- remove redundant include files
2022-10-17 18:38:21 +02:00
Charlie Gordon
c561a42273 Reduce header file dependencies
- remove redundant include files
- no longer include qe.h in charset.c, libqhtml
- add unicode_join.h for bidir definitions
- move QASSERT, MAX_WORD_SIZE, MAX_FILENAME_SIZE from qe.h to util.h
- move CompleteState and CompleteFunc to util.h
- bump VERSION to 5.3.4z
2022-10-15 19:32:59 +02:00
Charlie Gordon
7b6b5ed1e3 Disable Unicode terminal version detection
- disable Unicode version detection and reporting
- bump VERSION to 5.3.4y
2022-10-04 14:59:21 +02:00
Charlie Gordon
0a06b457ff Fixed crash bug on HTML files 2022-10-04 14:55:38 +02:00
Charlie Gordon
0be702e51b use UTF-8 in uppercase in comments 2022-10-04 14:53:25 +02:00
Charlie Gordon
d2c8ee3a9f fix bidir table size output 2022-10-01 16:02:52 +02:00
Charlie Gordon
ea9dd8ec90 Fix linux compilation problems
- remove unused variables
- create unidata directory when retrieving Unicode files
2022-10-01 15:57:59 +02:00
Charlie Gordon
fd76eae931 Small fixes
- fix warnings in tools/cptoqe.c
- fix signed char issue in tools/kmaptoqe.c
- fix optional argument parsing in tools/unicode_gen.c
- generate qe_bidir_get_type() and qe_bidir_get_type_test()
  functions for bidir_tables target
2022-10-01 15:35:23 +02:00
Charlie Gordon
490ebfbb0b Fix gcc warning. Fixes issue #9 2022-09-29 12:19:58 +02:00
Charlie Gordon
7e12eb51b2 add include guard in wcwidth.h 2022-09-27 22:38:29 +02:00
Charlie Gordon
1beb610d76 Update glyph width methodology
- rename unicode_tty_glyph_width() as qe_wcwidth()
- compute tables for qe_wcwidth() with tools/unicode_gen.c
  from the latest Unicode version
- add qe_wcwidth_variant() to determine if terminal may use
  incorrect width for a given glyph.
- reposition TTY cursor for glyphs with ambiguous width
- remove unicode_width.h
- add wcwidth.h and wcwidth.c generated by tools/unicode_gen.c
- update tools/unicode_gen.c and tools/unitable.c
- determine Unicode version support at start time
  displayed by describe-screen command
- display code point width and variant in what-cursor-position command (C-x ?)
- bumped VERSION to 5.3.4x
2022-09-27 22:30:05 +02:00
Charlie Gordon
d1fb4dde64 Add macros for block comparison, copy and move
After spending a few hours debugging a stupid memcpy size error, I
decided to use a typed version of memcpy, memcmp and memmove wherever
the array type size is greater than 1.

- add blockcmp(p1, p2, n), blockcpy(p1, p2, n), blockmove(p1, p2, n)
  for operation on typed arrays
- add max_uint() and min_uint()
- bumped VERSION to 5.3.4w
2022-09-27 09:32:41 +02:00
Charlie Gordon
298cd473e1 Small changes
- favor using cutils.h over util.h
- small improvement in bidi class lookup functions
- bumped VERSION to 5.3.4v
2022-09-20 13:15:53 +02:00
Charlie Gordon
bd50376780 Various improvements
- add charset.h
- add tools/unitable.c to compute unicode_width.h
- add tools/unicode_gen.c to compute more unicode tables
- use Unicode 15.0.0
- add rules to compute width tables from Unicode tables and TTY
- move basic definitions from util.h to cutils.h
- use CONFIG_SESSION for session support (undefined if CONFIG_TINY)
- define CompleteFunc and CT_xxx flags for completion functions
- pass CompleteFunc to xxx_complete() functions
  this allows more generic implemetation, without including qe.h
- rename fill_border() as fill_window_slack() for readability
- add QELEVEL environment variable to detect recursive invocation
- use stricter parser for load_ligatures()
- bump VERSION to 5.3.4u
2022-09-19 15:16:59 +02:00
Charlie Gordon
b8f81236cd Split util module
- split color/css functions from util.c into color.c
- add util.h and color.h for declarations
- util.c no longer includes qe.h
- move get_clock_ms() and get_clock_usec() to unix.c
- remove unused QString functions
- bump VERSION to 5.3.4s
2022-09-15 11:28:34 +02:00