Commit graph

1,280 commits

Author SHA1 Message Date
Charlie Gordon
08fc3e80e9 fix electric key ~ behavior in filename completion 2024-09-07 18:40:44 +02:00
Charlie Gordon
52da57f60c fix partial comment detection 2024-09-07 18:40:44 +02:00
Charlie Gordon
9e10de752e Improve color selection and completion
- add `set-style-color(string style, string color)` command
- display color and style samples in completion window
- display style names in `what-cursor-position` on `C-x =`
- remove duplicates in completion lists
2024-09-07 18:40:44 +02:00
Charlie Gordon
454cf61a79 use C indenter for Perl 2024-09-07 18:40:44 +02:00
Charlie Gordon
00131d44d1 fix cast and comment 2024-09-07 18:40:44 +02:00
Charlie Gordon
e6fa7527bc Fix variable name completion display 2024-09-07 18:40:44 +02:00
Charlie Gordon
89097a8eba group function prototypes by source file 2024-09-07 18:40:44 +02:00
Charlie Gordon
16b6d8f1f6 Add StringArray functions
- add `sort_strings()` and `remove_duplicate_strings()`
2024-09-07 18:40:44 +02:00
Charlie Gordon
4dd72d26e1 Improve apropos display
* list extra commands separately (commands with matches in description only)
* colorize variable names
* fix tab-width computation to keep bindings aligned
2024-09-07 18:40:44 +02:00
oguillaumin
8dbc6df413 Add paragraph and sentence commands
* add buffer functions:
  int eb_skip_whitespace(EditBuffer *b, int offset, int dir);
  int eb_skip_blank_lines(EditBuffer *b, int offset, int dir);
  int eb_skip_paragraphs(EditBuffer *b, int offset, int n);
  int eb_next_sentence(EditBuffer *b, int offset);
  int eb_prev_sentence(EditBuffer *b, int offset);
  int eb_skip_sentences(EditBuffer *b, int offset, int n);
* modify paragraph selection method.
* improve paragraph commands
* add paragraph commands:
  - `fill-region`, `fill-buffer`, `fill-region-as-paragraph`
  - `backward-kill-paragraph`
* add sentence commands
  - `backward-kill-sentence`, `backward-sentence`, `forward-sentence`,
  - `kill-sentence`, `mark-end-of-sentence`
* add transpose commands:
  - `transpose-paragraphs` and `transpose-sentences`
2024-08-31 13:49:00 +02:00
oguillaumin
b5a1899ca2 reorder CMD macro arguments for consistency 2024-08-31 13:49:00 +02:00
oguillaumin
7038c09183 fix command binding alignment in help buffers 2024-08-31 13:49:00 +02:00
oguillaumin
0450984ffd more ideas 2024-08-31 13:49:00 +02:00
oguillaumin
d2aa2a8c13 colorize grep -[ABC] output in shell buffers 2024-08-31 13:49:00 +02:00
oguillaumin
f05215c22c Add space deleting commands
* `delete-leading-space`: Delete any leading whitespace on the current line
* `delete-trailing-space`: Delete any trailing whitespace on the current line
* `delete-trailing-whitespace` Delete all the trailing whitespace across the current buffer.
These commands handle the region if highlighted
2024-08-31 13:49:00 +02:00
oguillaumin
1e691469a2 Add automatic block quoting on electric keys
* typing '"`<>()[]{} when a block is highlighted inserts matching delimiters
  around the block.
2024-08-31 13:49:00 +02:00
oguillaumin
5bef7b771f Add state and buffer fields
* add `b->ref_count`
* add `b->qs` pointer
* add `qs->first_hidden_window`
* handle both window lists in `edit_detach()`
2024-08-31 13:49:00 +02:00
oguillaumin
2d9800662a Substantial dired rewrite
* add hierarchical view in dired left panel:
  - left on closed dir or file moves to parent dir
  - left on closed dir or file with no parent inserts the open parent dir at the top
  - right on closed dir opens the directory
  - right on open dir goes down to last visited item in this list or first if none
  - right on file skips to the right window in preview mode
  - space on directory expands or collapses it
* add `do_dired_path()`
* fix `qe_load_file()` for directories specified as relative paths
* fix `qe_load_file()` loading a directory into the dired left panel
* add dired sorting by fullname
* fix directory grouping for non alpha sort
* use direct array of `DiredItem` instead of `StringArray`
* add `dired_ignore_extensions[]`
* add `classify_fullnames()` to help with tree sorting
* add completion on `dired-sort` prompt
* add `dired-summary` on `?`
2024-08-31 13:49:00 +02:00
oguillaumin
574cb4ac0f Add utility functions
- `canonicalize_path` returns destination array
  allow for destination to overlap source
- `qe_strcollate` compare directory name before contents
  this fixes the pathnames sorting
- add `get_relativename(filename, dirname)`
2024-08-31 13:49:00 +02:00
oguillaumin
2995c4d9b4 Add colorizer for SerenityOS Jakt language 2024-08-31 13:49:00 +02:00
oguillaumin
17b0c4803d Add sreg_match(): simple regular expression matcher
Simple regexp patterns use a subset of POSIX regexp:
- only simple character classes, no escape sequences
- no assertions (except $), no backreferences
- embedded groups always generate maximal matches which
  may cause the outer expression to fail match
2024-08-31 13:49:00 +02:00
oguillaumin
667f18f774 more ideas 2024-08-31 13:49:00 +02:00
oguillaumin
2c2a91043e Fix some indentation issues
* fix `replace_indent` in mixed TAB/SPC cases
* merge `get_indent_chars` into `make_indent`
* improve `normalize_indent`
2024-08-31 13:49:00 +02:00
oguillaumin
329204ab58 improve C comment colorization of diff output in shell buffer 2024-08-31 13:49:00 +02:00
oguillaumin
d427acc62a Comments, ideas 2024-08-31 13:49:00 +02:00
oguillaumin
1d3cabeaa2 Improve indentation commands
* add `find_indent` and `make_indent` ancillary functions
* add `untabulate` on `S-TAB` to remove one indentation level
* rename `do_tab` as `do_tabulate` for consistency
* `tabulate` indents the region one level if visible
* add `indent-rigidly` commands: indent block interactively
2024-08-31 13:49:00 +02:00
oguillaumin
9fde8fd9b9 Add syntax mode for nanorc files 2024-08-31 13:49:00 +02:00
oguillaumin
a2ddad9aba Merge qeconfig.h into qe.c
- remove qeconfig.h
- insert `basic_commands` definition table in main module qe.c
2024-08-31 13:49:00 +02:00
oguillaumin
f44d9bdf74 Add multiline cursor editing
- add `swap_int()`
- add commands for multi-line cursor:
  * `start-multi-cursor` on `C-x <`
    set the mark for a region with a cursor on each line
  * `end-multi-cursor` on `C-x >`
    end recording the multi-line cursor region and start editing
    cancel the multi-line cursor with `C-g`
  * `add-multi-cursor` on `C-x #`
    add an extra cursor at point. Activate multi-line cursor editing
    with `C-x \`
  * `activate-multi-cursor` on `C-x \`
    start multi-line cursor editing. Stop with C-g.
- UX is tentative, more work needed based on usage.
2024-08-31 13:49:00 +02:00
oguillaumin
6d4f13b9ea add preliminary syntax mode for the rye language 2024-08-31 13:49:00 +02:00
oguillaumin
e77e21bffd Select region on shifted cursor movement keys 2024-08-31 13:49:00 +02:00
oguillaumin
509303a416 Improve documentation
- add @include directive
- add `match_annotation` for flexible matching, ignoring - and _
- add `fatal()`, `error()` and `warning()` handlers
2024-08-31 13:49:00 +02:00
oguillaumin
da0ce59b03 fix shell mode colorisation 2024-08-31 13:49:00 +02:00
oguillaumin
ee2e3c767b Colorize lines up to 16 MB
- add `eb_get_line_length()`
- move `buf` and `sbuf` to `QEColorizeContext`
- reallocate line and style buffers on long lines
2024-08-31 13:49:00 +02:00
oguillaumin
494ea38c33 Improve memory allocation APIs
- replace `qe_malloc_dup()` with `qe_malloc_dup_bytes()` and `qe_malloc_dup_array()`
- replace `qe_realloc()` with `qe_realloc_bytes()` and `qe_realloc_array()`
- pass numbers of objects to `qe_malloc_dup_array` and `qe_realloc_array`
- add `qe_strndup()`
2024-08-31 13:49:00 +02:00
François Revol
0935cb4894
Atari port fixes (#35)
* Do not use CFLAGS for host tools when cross-compiling.
* Add a missing $(EXE). Maybe we should have a HOST_EXE but at least we can build.
* set target OS & CPU
  Not really used, only for cosmetics.
  Also, m68k is big endian. (Do we use this anywhere yet?)
* Force GNU-C99 standard for LLONG_MIN
* work around missing d_type in dirent struct
2024-07-28 00:04:20 +02:00
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
3852fb9c19 Update copyrights 2024-07-28 00:00:03 +02:00
Charlie Gordon
4be625f5c4 Improve macro handling
* add `macro-counter` variable
* add `QEState` fields `nb_macro_keys_run`, `macro_counter`, `macro_format`.
* add `int find_key_suffix(const char *str, char c)`
* pass `argval` to `do_call_last_kbd_macro` to handle early exit
* add `clear_macro`, `stop_macro`
* add `int check_format_string(const char *fmt, const char *template)`
* do not use `alloca` for `eb_vprintf`
* add `dbuf_str(db)`: null terminate the buffer and return a string pointer.
* add macro commands:
  `edit-last-kbd-macro`, `name-last-kbd-macro`, `insert-kbd-macro`,
  `read-kbd-macro`, `macro-add-counter`, `macro-set-counter`,
  `macro-insert-counter`, `macro-set-format`
* `start-keyboard-macro` restarts macro learning mode if learning already
* add documentation on macro commands
* stop macros upon errors (when ringing the bell)
* stop macros if prompting the user for confirmation
2024-07-28 00:00:03 +02:00
Charlie Gordon
84393d6c4f Add bell sounds
* add `QEDisplay::dpy_sound_bell`
* add `\007` prefix in `put_status` to sound bell
2024-07-28 00:00:03 +02:00
Charlie Gordon
492a8fc0ce Improve macro handling
* `C-x (` restarts macro learning mode if learning already
* add documentation on macro commands
2024-07-28 00:00:03 +02:00
Charlie Gordon
1df739bcb0 ocumentation
* add documentation comments
* `dbuf_init` and `dbuf_init2` return the object
* usr portable `memcpy` based approach for unaligned word access
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
af64810cb4 Add documentation on utility functions
* add `int ustr_get_identifier_x(dest, size, c, str, i, n, c1)`
* add `int cp_skip_blanks(const char32_t *str, int i, int n)`
2024-07-28 00:00:03 +02:00
Charlie Gordon
66f4b556ff Add documentation on utility functions
* adjusted `ustr_match_keyword` for consistency
* implement `byte_quote` natively
* implement `buf_byte_quote` using `byte_quote` instead of the reverse
2024-07-28 00:00:03 +02:00
Charlie Gordon
131490e482 Improve ppl-mode 2024-07-28 00:00:03 +02:00
Charlie Gordon
65e1bfcea7 Improve buf_t API and documentation
* rename `buf_encode_byte()` as `buf_quote_byte()`
* change `buf_printf` return value for consistency
* let `strquote` always return the length of the conversion like `snprintf`
2024-07-28 00:00:03 +02:00
Charlie Gordon
d60df466d3 Improve ustr_get_identifier
* remove `get_salmon_identifier()`
* change `swift_parse_identifier()` for consistency
* change `wolfram_get_identifier()` for consistency
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
a345775998 Add PPL mode
Add colorizer for Christian Neumanns' Practical Programming Language
2024-07-28 00:00:03 +02:00