Commit graph

1,429 commits

Author SHA1 Message Date
huwwa
32ecc2c050 shell: improve next-error
* remove popups, sidepanes, helppanes.
* verify file existence before opening.
* refine error/source windows:
    * find window showing the error source buffer,
      split a new one if none are found.
    * if current window is showing error source buffer,
      find file in next window, split a new one if none are found.
    * center cursor after going to error.
* show error line on window's first line.
* center cursor after going to error.
2026-06-12 15:41:07 +02:00
huwwa
073f6c005b shell: follow caption message on interactive shell
* remove unnecessary check.
* minor cosmetics.
2026-06-12 15:41:07 +02:00
huwwa
68d50fc88d shell: avoid silent exit for commands starting in popup/minibuf 2026-06-12 15:41:07 +02:00
Charlie Gordon
a0c8560e1e Fix previous-buffer cycling
* fix modulo arithmetics for negative values
* no special case of single buffer
2026-06-10 04:25:13 -04:00
Charlie Gordon
77e57d11c7 Colorization: improve colorization of diff and process output
* improve color combining code for diff/patch output: preserve code
  syntax coloring on red or green background.
* improve `curline_style` handling (needs more work)
* add `QETermStyle` transparent color handling in `apply_style`
* highlight trailing blanks in a single place
* transpose `qe_term_get_style()` arguments for consistency
* add `qe_term_style_string()` and `qe_styledef_string()`
* extend style string parser to accept missing foreground color
2026-06-09 14:19:28 -04:00
Charlie Gordon
d34d0680d5 compare-windows: improve resync on single line changes
* when subsequent lines match, try and skip changes on current line
2026-06-08 18:21:52 +02:00
huwwa
ce4ac13d48 Invalidate diag message on refresh and erase it on input 2026-06-07 13:48:53 +02:00
huwwa
ee2a886348 buffer/file fix some bugs
* fix crash bug on `C-X C-B C-X C-F xxx RET`.
* add check for `S_ISREG` as file name might contain a directory
  (e.g. *dired* buffer when starting qe with a directory), which
  caused a bug whenever that directory was modified asynchronously.
* increment pos after insertion.
2026-06-07 13:46:21 +02:00
Charlie Gordon
699bdff915 Simplify mode probing
* add `filenames` specification in `ModeDef` structures
* generic mode probing can match a list of filenames
* remove unneeded mode_probe functions
* this enables diff coloring on Makefile
2026-06-05 18:42:56 -04:00
Charlie Gordon
66eb50c39e Improve Makefile, github CI and TODO.md
* add generic target for host tools
* disable netbsd target in github CI (fails for unrelated reason)
* upgrade github CI to actions/checkout@v6
* clean and reorder TODO.md
2026-06-05 15:53:10 -04:00
Charlie Gordon
9135840c67 X11: fix crash bug
* add null pointer tests for xim and xic to avoid crash
  if `X_HAVE_UTF8_STRING`.
* release resources upon closing display
2026-06-05 06:36:23 -04:00
Charlie Gordon
3da74c964b Buffer/file: add diff-buffer-file
* add command to compare buffer with its file in a popup
* add [d] for diff when prompting for buffer/file synching
* add default behavior for buffer/file synching
* add CONFIG_LINUX, CONFIG_FREEBSD, CONFIG_OPENBSD, CONFIG_NETBSD
* add diff styles
2026-06-04 15:08:24 +02:00
Charlie Gordon
eff66d1e8c Buffer/File: check for file changes
* keep track of original file size and time in buffer data
* check for file changes upon window change, buffer modification and save
* prompt for reloading buffer contents and other options
2026-06-04 15:08:24 +02:00
Charlie Gordon
4d8fedb4c3 compare-windows: improve resync algorithm
* resync on current line if non trivial match at end of line
* try and find common block of identical lines by adding or deleting
  up to 60 lines
2026-06-04 13:22:34 +02:00
Charlie Gordon
c390f3fcfe block-navigation: refine methodology for comments and strings
* fix bug on character constants ('(' ...) when styles are disabled
* fix end of comment/regex detection when scanning strings
* handle double escapes: "\\\"" is a 2 character string
* stop scanning when reaching outer block boundary
* scan blocks of comments as a single entity
2026-06-04 13:22:10 +02:00
Charlie Gordon
7e2e2b5e7f improve colors and styles
* improve curline_style handling
* add completion for variable values
2026-06-04 13:21:46 +02:00
Charlie Gordon
7ccb4f4ae7 fixes in compare-windows and variable completion popup
* `compare-windows` used to toggle all ignore flags if invoked without
   an argument. This was bogus.
* when reading a variable name (eg: `eval-expression`), improve alignment
  of variable descriptions in popup window
2026-06-04 13:20:57 +02:00
Charlie Gordon
d852856f0d Fix compiler warning on ambiguous operator combination 2026-06-04 09:51:11 +02:00
huwwa
52417f1ec1 navigation: improve forward-block / backward-block
- ensure stopping at the precise boundary between adjacent strings/comments
separated by spaces.
- bypass bracket balancing inside strings or comments.
- prioritize bracket skipping inside comment/string when starting at a bracket.
- prioritize string skipping when starting at a quote.
2026-05-27 09:09:24 +02:00
Charlie Gordon
c702bd012f Bufed: fix sorting order for system buffers 2026-05-27 01:43:40 +02:00
Charlie Gordon
8977efa8a4 Shell: small improvements
* use `closefrom` if available
* use recommended approach to update tty winsize
2026-05-26 10:36:48 +02:00
huwwa
f91d04168b shell: refine non-interactive commands
* replace pty usage with pipes for non-interactive commands.
* remove `SF_INFINITE` flag.
2026-05-26 09:34:58 +02:00
Charlie Gordon
897b7555d2 bufed: improve sorting method
* keep track of buffer creation, modification and access times
* add buffer sorting methods (buffer times, pathname, basename)
* always sort systems buffers last in alpha order
* small touch up in modeline
2026-05-23 22:34:28 +02:00
huwwa
832662b4a5 popup: prevent accidental window closure on keyboard-quit 2026-05-21 09:47:46 +02:00
huwwa
71963ca4c2 input: add select-input-method command 2026-05-20 20:35:56 +02:00
huwwa
501db1bb1b kmap: support the entire Arabic keybord 2026-05-19 23:09:24 +02:00
huwwa
40d50127b8 kmap: use appropriate arabic keyboard kmap file 2026-05-19 08:22:28 +02:00
huwwa
34417ea5dc fix cursor on partial compose matches
Unconditional window offset increments caused incorrect increments
during partial matches.
2026-05-19 08:22:28 +02:00
Charlie Gordon
7391eb26c5 Configure: reorganize the configure script and Makefile
Clarify tiny build options:
* distinguish `tiny` which controls whether the tiny version should be built
* and `tiny_only` which restricts the build to just the tiny version
* add `--disable-tiny` to set `tiny=no`
* add `--tiny-only` to only build the tiny version
* add js, json and c2 modes in tiny version
2026-05-19 00:08:53 +02:00
Charlie Gordon
21b00da0cb bufed/dired: toggle hex display for non-ASCII codepoints
* `dired-toggle-encoding` and `bufed-toggle-encoding` (key \)
  also toggle display of Unicode letters as hex escapes
2026-05-18 15:18:00 +02:00
Charlie Gordon
e89e07e318 bufed/dired: fix layout for non printing characters
* add `eb_put_filename()` to encode buffer or file names with
  non-ASCII characters according to PF_xxx flags
* add `CF_SAVE_LIST` flag for completions to store the list
  of matches in `MinibufState`
* fix bufed and dired layout issues
* fix buffer and filename completion popup layout
* add commands to control display of Unicode and non printing
  charcaters in buffer or file names:
  - U toggles unicode display
  - \ cycles through 4 possible encodings: ? ^J \x10 \010
* use `(*fp)()` syntax for indirect function calls
2026-05-18 12:31:06 +02:00
Charlie Gordon
d6b37ca511 Sundries: bug fixes
* fix crash bug on `delete_equivalent()`: qe_free takes a double pointer
* remove unused ShellState variables
* initialize term structures
2026-05-18 01:15:21 +02:00
Charlie Gordon
dc4eb3efb6 man: ensure full manual page is formatted and uses hightlighting
- set `MAN_KEEP_FORMATTING=1` and `MANPAGER=cat` for the man
  command and handle overstriking in the terminal emulation.
- this approach works on macOS, linux, FreeBSD and OpenBSD
2026-05-17 16:12:36 +02:00
huwwa
cbeb5d4acd Shell: prevent man command from paging
- apply infinite-height prior to winsize initialization.
- use `LESS_LINES` environment variable.
- use `PAGER=less -F` to make less quit at the end of the man page
2026-05-17 12:49:56 +02:00
Charlie Gordon
ca1eb2ff88 util: simplifications and doc fixes
* add `qe_shell_match` to replace `fnmatch`
* fix some documentation errors
2026-05-17 12:17:25 +02:00
Charlie Gordon
2109b2b536 util: do not test pointer before calling qe_free
* testing the pointer before calling `qe_free` is considered
  useless and bad style in the project.
2026-05-17 12:16:57 +02:00
huwwa
053871bec7 Pager: verify existance of last buffer on abort 2026-05-17 00:03:01 +02:00
huwwa
34488a2ed4 Shell: use window width and height fields directly 2026-05-17 00:03:01 +02:00
huwwa
e8518d0b9b popup: fix bugs
- if command was started from a popup window then reuse it.
- delete window only if popup.
2026-05-16 22:46:01 +02:00
huwwa
eefc007d60 Pager: add pager-abort command 2026-05-16 22:32:06 +02:00
huwwa
c654f504e5 Shell: refine target window selection logic
The behavior follows this priority order:

1. reuse an existing window already displaying the buffer,
2. if shell-command-other-window is not set, use the current
   window, otherwise
3. select the largest available non-active window.
4. split a new window if no sutiable window is found.
5. fall back to the current window if splitting fails.
2026-05-16 22:32:06 +02:00
huwwa
a927d093ab Shell: improve shell_close/shell_read_cb
- add check when process is signaled.
- put appropriate status message when non-interactive.
- follow output stream when non-interactive.
2026-05-16 22:32:06 +02:00
huwwa
ec1aee59a4 Shell: cosmetic changes
- add interactive shell process caption.
- rearrange lines.
2026-05-16 22:32:06 +02:00
huwwa
13d1668a63 modes: improve papup mode
- Add `popup-abort` command.
- Update caption and restore readonly when reusing popup buffer.
- Prevent bugs when changing from minibuf to popup window.
2026-05-15 14:31:58 +02:00
huwwa
e79b7974bc popup-list: support M-n and M-p to move by 4 lines 2026-05-15 14:31:58 +02:00
Charlie Gordon
e84394a8bb navigation: improve forward-block / backward-block
* improve block skipping:
  - if starting inside a string or a comment, skip to the end of the
    string or comment while balancing blocks
  - otherwise skip string and comments when balancing blocks
  - fix behavior on very long lines, eg: **highlight.pack.js**
* if a nesting error occurs, point and mark are set around the mismatched
  delimiters. use C-x C-x to skip between them
* simplify `get_colorized_line()`
* add `cp_get_line()` to factorize code
* add `eb_peek_prevc()` to get previous codepoint without end offset
* improve documentation conciseness
2026-05-14 16:13:16 +02:00
Charlie Gordon
5a37c1cbc3 occur: reuse the same buffer but clear contents
* use `BC_REUSE | BC_CLEAR` to avoid killing the `*occur*` buffer
* this ensures the `*occur*` buffer stays current in windows that show it
* modify the `BC_CLEAR` semantics to imply `BC_REUSE`
* simplify calls: remove redundant `BC_REUSE` flag
2026-05-11 19:16:05 +02:00
Charlie Gordon
7f3b31d8d4 Shell: add optional shell modes
- `shell_buffer_read_only` controls if the shell buffer should become
  read-only and use pager-mode when not interactive
- `shell_mode_auto_interactive` controls if the shell interactive mode is
  switched to and from automatically based on cursor movement commands
- disable auto interactive if region is highlighted
- fix crash bug in qe_register_emulation_bindings for "emacs" emulation
2026-05-11 00:21:56 +02:00
huwwa
880aa115cd shell: sync interactive state between windows sharing the same shell buffer 2026-05-11 00:21:56 +02:00
huwwa
7d7a7d0fac shell: update toggle input status message 2026-05-11 00:21:56 +02:00