Commit graph

278 commits

Author SHA1 Message Date
Charlie Gordon
f1888d89b5 display: fix graphics cursor in process buffer
- force cursor minimum width at end of line
2017-04-28 21:46:01 +00:00
Charlie Gordon
ff1952f5a0 display: improve line wrap handling
- add WRAP_AUTO and WRAP_TERM (for terminal emulator)
  WRAP_AUTO wraps lines if the window is more than 3/4 of the screen width
  if window is narrower, lines are truncated.
  WRAP_TERM does not display the \ wrapping mark to simulate terminal behavior
- add default_wrap member in ModeDef structure
- delegate to view pane for man, ssh and compile commands
2017-04-25 17:41:27 +00:00
Charlie Gordon
5bb58a9c16 display: improve window splitting API
- add EditState *qe_split_window(EditState *s, int prop, int side_by_side);
  takes proportion and direction
- set-trace splits the current window 75/25
- add start-trace-mode
2017-04-25 17:15:03 +00:00
Charlie Gordon
eacb2ad6e0 shell: major improvements in tty emulator
terminal emulator:
- add EditState.cols and EditState.rows: window dimensions in characters
- pass target window to new_shell_buffer()
- use window size for shell terminal emulator initial screen size
- set COLUMNS and LINES environment variables for child processes
- factorize emulator character output
- increase number of CSI arguments
- simplify and improve CSI m argument processing including
  multiple argument sequences
- minimal support for `:` as argument separator eg:
  \033[38;5;128:128:128m
- support erase line vt100 command:
  \033[K, \033[0K erase end of line
  \033[1K         erase beginning of line
  \033[2K         erase complete line
debugging:
- pass string argument to set-trace: on, off or list of trace indicators
- remove doctor command
- add QE_TRACE_EMULATE for emulator trace messages
- fix incorrect uses of eb_delete()
2017-04-21 14:44:14 +00:00
Charlie Gordon
d8180c89c4 display: improve crc because of trivial collisions 2017-04-19 08:20:20 +00:00
Charlie Gordon
d1cefb2663 display: improve crc formula to avoid trivial collisions
- use 64 bit checksum values
- use simple formula with fewer collisions.
2017-04-18 14:26:39 +00:00
Charlie Gordon
c57a7c6233 display: small fixes for consistency
- add wrappers in display.h
- renamed tty dpy_xxx handlers for consistency
- separate tty_term_resize called on signal and tty_dpy_invalidate
- add dpy_xor_rectangle for software cursor, remove QECOLOR_XOR
2017-04-18 09:14:55 +00:00
Charlie Gordon
7b40bb4f3a display: improve automatic redisplay upon terminal window resize
- signal and detect asynchronous redisplay signal from SIGWINCH
2017-04-17 23:01:21 +00:00
Charlie Gordon
3580b53452 syntax: improve minibuffer and popup handling
- remove static state for minibuffer handling, use mode specific state attached
  to the buffer.
- remove static pointer for the popup last active window.  Use new
  target_window member in EditState.
- remove EditState.minibuf, replaced by WF_MINIBUF flag in EditState.flags
- rename minibuffer commands for consistency
- remove unused global variable debug_flags
- prevent search from minibuffer
- fix toggle-full-screen refresh bug. C-x f is bound to toggle-full-screen
  and could be typed by mistake for C-x C-f, switching to full screen mode
  but with a refresh delay.  This caused confusing behavior interpreted as a
  layout bug.
- make charset_ucs2le, charset_ucs2be, charset_ucs4le, charset_ucs4be local
  in charset.c
- make edit_detach() and edit_attach() local in qe.c
- redraw status and diag messages in edit_display(). This caused display
  bugs in x11 as asynchronous messages were erased by minibuffer window
  refresh.
- display status messages in diag area (bottom right screen corner) if
  minibuffer is active.
- force put_status message update if message starts with !
- force complete_refresh if window was resized or layout was changed
2017-04-17 18:14:15 +00:00
Charlie Gordon
e08867b692 basic: reduce global variable clutter
- make more registered objects static
- document some non static global objects
- remove some global variables
2017-04-16 21:51:19 +00:00
Charlie Gordon
abe81df0b2 basic: move some global variables
- move up_down_last_x to an EditState member
- make single_window static in qe.c
- move user_option to the QEmacsState structure
- move minibuffer and completion state to a MinibufState structure
- remove static state in do_minibuffer_exit
- add key name: LB for `{`, RB for `}` and VB for `|`
2017-04-16 17:31:14 +00:00
Charlie Gordon
3dccd7f696 basic: improve command line parsing
- add qe_strtobool(str, def). Returns boolean value from str:
  y yes t true 1 evaluate to true
  any other string evaluates to false
  the empty string evaluates to def
- add bstr_t type:
  constant bounded string with pointer and length.
  bstr_make creates a bstr_t from a string pointer or NULL
  bstr_token creates a bstr_t from a string upto a separator
  bstr_get_nth creates a bstr_t from a the nth element of a string list
  bstr_equal compares bstr_t objects for equality
- use macros for type safe registation of command line options
- combine short, long, argument names and help string
- support command line options with optional arguments
2017-04-16 17:20:49 +00:00
Charlie Gordon
f1de1ca561 files: add do_find_file_noselect command
- add LF_NOSELECT flag for qe_load_file()
- add find-file-noselect command: load a file into a buffer but do not
  attach the buffer to the current window.  Due to the current implementation
  of set_mode, the buffer is only attached to the file, the file will only be
  loaded when it is finally attached to a window.
2017-04-15 13:10:53 +00:00
Charlie Gordon
b39607410e fixed compilation warnings 2017-04-14 06:59:17 +00:00
Charlie Gordon
e333c211fe display: fix some popup issues
- prevent some commands from a popup-window or close it
2017-04-12 07:54:30 +00:00
Charlie Gordon
6c595c1f2c colors: extend color system
- add 8K color modes and 64-bit QETermStyle values
- add 64-bit buffer style support
- reduce colored character system used in syntax handlers to 8-bit style
  and 24-bit code point
- use QETermStyle type instead of int wherever a composite style is used
- force color system used by the terminal with environment variables:
  USE_16_COLORS=1, USE_256_COLORS=1 or USE_TRUE_COLORS=1
2017-04-12 07:33:20 +00:00
Charlie Gordon
5d463eb5ad styles: improve consistency
- rename font styles QE_STYLE_xxx to QE_FONT_STYLE_xxx
- rename font family QE_FAMILY_xxx to QE_FONT_FAMILY_xxx
- improve tests/16colors.pl: display bold italics combination
- improve tests/color-spaces.pl: compare true color and palette dumps
- add colortest target in Makefile to produce various color patterns
2017-04-11 06:46:13 +00:00
Charlie Gordon
799b1489bc display: full support for 256 color virtual terminal
- add various utilities for color escape sequence testing:
  tests/16colors.pl
  tests/256colors2.pl
  tests/color-spaces.pl
  tests/truecolors.sh
  tests/xterm-colortest.sh
  tests/xterm-colour-chart.py
- use colored code-points only for syntax highlighting
- use QETermStyle and QEStyleDef internally
- convert to TTYChar attributes only for text terminal output.
- remove most CHAR_MASK and STYLE_SHIFT handling
- pass QETermStyle array to get_colorized_line mode handlers
- pass QETermStyle array to isearch_colorize_matches
- remove combine_static_colorized_line
- move color matching functions to util.c
- rename get_tty_color as qe_map_color
- improve local variable naming consistency:
  DisplayState *ds, QEStyleDef *stp, QEStyleDef styledef.
2017-04-03 08:33:57 +00:00
Charlie Gordon
4104ab568b display: improve color and style handling
- add support for 256 and true color terminals
- fix color handling for defined styles
- fix bold, italic and underline handling for terminals
- use more explicit symbols for qe-term emulator in shell.c
- shell buffer terminal emulator still uses 16 colors
- display buffer style in C-X =
- bumped version to 0.5.0dev
2017-04-02 01:12:01 +00:00
Charlie Gordon
073fbc3439 tags: fix some bugs, extend system
- pass target window to completion functions
- fix tag completion at find-tag prompt
- add tag support in python mode
- set tag offset to the actual word instead of start of line
2017-03-31 15:33:02 +00:00
Charlie Gordon
35d2610146 clang: add primitive tag support
- add buffer properties with offset tracking
- use buffer properties for type, macro, function and object definitions.
- display current function or type name on mode line
- add list-tags command to show the tags detected for the current buffer
- add goto-tag on C-X , and M-F1 to jump to the definition of the current word
- add find-tag on C-X . to search for a given tag with completion
2017-03-31 07:51:56 +00:00
Charlie Gordon
d06fdbfd14 basic: changed API for popup windows
- pass current window to show_popup()
- remove show_ptr argument from new_help_buffer()
- call show_popup() unconditionally
- add int eb_vprintf(EditBuffer *b, const char *fmt, va_list ap);
2017-03-26 15:57:24 +00:00
Charlie Gordon
91d842618f modes: add less mode for .less files
- rename all popup related mode functions from less_* to popup_*
- add less-mode for .less files (preprocessor for css files)
- add FILE to list of C types
2017-03-25 18:00:52 +00:00
Charlie Gordon
34a4da48b2 files: add -1 (--single-window) command line option
- add command line options to prevent window splitting
2017-03-20 18:43:33 +00:00
Charlie Gordon
3a65d1143a display: fix single accent curor position 2017-03-17 16:26:16 +00:00
Charlie Gordon
26fd39d9e0 unicode: improve support for wide and combining code points
- qe_isaccent() recognises all combining code points (to be refined)
- add computer generated width table unicode_width.h
- display difference in hex in compare-windows to distinguish
  space and nbsp, normal and combined form for accented letters.
- display multiple combining code points in what-cursor-position (C-x =)
- attach combining code points to preceeding space in display_char_bidir
- handle accents specificaaly in flush_fragment
- handle combining code-points in screen backstore via indirection table
  this transient table can be inspected via describe-screen
2017-03-16 09:16:31 +00:00
Charlie Gordon
ec07d5aec8 basic: charset improvements
- add QECharset.encode_table as a default for CharsetDecodeState.table
- make CharsetDecodeState.table const
- use static initializers for utf8 tables
- add al32utf8 charset name (used in Oracle for true utf-8 encoding)
- use direct pointers in unicode_glyph_range_index
- initialize unicode_glyph_range_index at run time
- rename unicode_glyph_tty_width as unicode_tty_glyph_width
- changed unihex display to space out single width characters
2017-03-15 23:42:23 +00:00
Charlie Gordon
063801372c file: improve qe_load_file API
- pass flags as bit mask for:
  kill_buffer, load_resource, cwd_relative, split_window
- fix bug with multiple files on command line from different directories
2017-03-15 07:32:48 +00:00
Charlie Gordon
38fdd559f5 display: improve display structure handling
- add QEDisplay.dpy_describe handler
- rename dpy_init as screen_init
- allocate TTYState instead of using static struct in tty.c
2017-03-15 07:24:31 +00:00
Charlie Gordon
8573982c12 basic: improve goto-line and goto-char and next-mode
- handle size suffixes kmg and KMG
- split qe_find_target_window() for next-mode and find-file
  from a dired left pane
2017-03-02 15:21:16 +00:00
Charlie Gordon
983bef5bcc basic: show error message if load-resource-file fails 2017-02-25 19:39:49 +00:00
Charlie Gordon
56a0b95bc4 config: fix window context for .qerc files fix code fragment coloring
- save and restore qs->active_window around .qerc config file parsing
  and set qs->active_window to target window for attribute setting.
2017-01-31 20:22:13 +00:00
Charlie Gordon
5e8c4b023d shell: colorize file fragments from compilation and grep
- add `offset` member in `QEColorizeContext` structure
- add `ModeDef *qe_find_mode_filename(const char *filename, int flags);`
- make `combine_static_colorized_line` public
- add public function `shell_colorize_line`:
  detect file fragments with filename followed by `:` without space at bol
  special case clang errors that display the file contents after the line
- special case `shell_colorize_line` for static color combination scheme
2017-01-01 15:40:46 +00:00
Charlie Gordon
23bfd2ea69 basic: C-l twice recenters the window 2017-01-01 12:51:22 +00:00
Charlie Gordon
0f1d2244e7 basic: improve config file handling
- add `add-resource-path(string)` to add a new resource directory
- bind `load-file-from-path` on C-c C-f
2016-12-31 18:45:08 +00:00
Charlie Gordon
dee4908fe8 display: disable broken bidir display 2016-12-31 11:28:41 +00:00
Charlie Gordon
94464bd939 dired: add filelist mode
- add `WF_FILELIST` window flag for preview-mode tests
- add `argval` argument to `do_dired()`
- `dired_view_file()` displays message and returns preview pane
- `dired` command with argument selects filelist mode with navigation pane
  bound to C-u C-x C-d
- add `filelist` command
2016-12-31 11:12:16 +00:00
Charlie Gordon
87a151fd95 comments 2016-12-27 12:31:36 +00:00
Charlie Gordon
f41235695f display: some fixes, simplifiations
- add `gutter_width` in `DisplayState` for line number column
- add `int get_glyph_width(QEditScreen *screen,
                           EditState *s, int style_index, int c);`
  and `int get_line_height(QEditScreen *screen,
                           EditState *s, int style_index);`
  to compute font dimensions from style index and window
- compute borders more accurately in `display_window_borders()`
- clip text drawing, use window relative coordinates in `flush_line()`
- fix width computation for diagnostic status display in X11
- use QE_STYLE_DEFAULT and remove redundant e->default_style references
2016-12-27 10:13:46 +00:00
Charlie Gordon
8587dd62a2 display: improve handling of very long lines
- simplify the code
- fix display of continuation lines when line numbers are visible
2016-12-26 13:57:36 +00:00
Charlie Gordon
bd5086c85c build: remove c99 specific constructions 2016-12-26 09:28:36 +00:00
Charlie Gordon
7969fbb276 build: use separate object directory for x11 build
- configure no longer defines CONFIG_X11 in C
- generate modules.txt in each target directory
2016-12-25 23:32:48 +00:00
Charlie Gordon
f9ebd10d55 display: simplifications and comments
- add remarks about tricky display internal states
- display `x_disp[]` on mode-line
2016-12-23 22:51:47 +00:00
Charlie Gordon
4e1cb3cf37 display: improvements
- pass `cursor_func` and `cursor_opaque` to `display_init()`
- add dummy `display_close()`
- add `DISP_NONE` display mode
- fix timing message display, trim *messages* buffer
2016-12-23 20:28:56 +00:00
Charlie Gordon
79bf90c8d6 basic: simplifications
- remove `eb_nextc_style()`
- `eb_nextc()` does not modify `b->cur_style`
- add `eb_get_style()` to retrieve style for given offset in full-style buffers
- add `eb_next()` and `eb_prev()` to skip chars
- pass `offset` to `eb_get_line()` and `generic_get_colorized_line()`...
- use `eb_skip_chars()` in `do_delete_char()` and `text_write_char()`
- replaced `eb_get_strline()` with `eb_fgets()` with similar semantics
  except return value is number of bytes before the newline or end of line
- no longer pass end offset to `isearch_colorize_matches()`
- just pass number of code points to `combine_static_colorized_line()`
- no longer call `isearch_colorize_matches` from `generic_get_colorized_line`
2016-12-23 19:51:48 +00:00
Charlie Gordon
374b514528 display: small improvements
- rename method dispatcher `text_display` as `display_line`
  rename corresponding mode based handlers as `xxx_display_name`
- rename method dispatcher `text_backward_offset` as `backward_offset`
- add default text handlers for `move_bof` and `move_eof` in
  hex, binary and unihex modes
- handle utf-8 in window prompt (ex: default buffer name for C-x b)
- add various TODOs
2016-12-23 15:51:51 +00:00
Charlie Gordon
9c99730239 display: cursor handling
- merge do_center_cursor and do_center_cursor_maybe:
  do_center_cursor takes an `int force` argument
- add set-window-style command to change `e->default_style`
- change argument sign for do_scroll_left_right() for consistency
  scroll window by increments of space_width
  toggle WRAP_LINE, WRAP_WORD and WRAP_TRUNCATE in do_scroll_left_right()
- do not force WRAP_TRUNCATE in dired view pane to avoid problems on files
  with extremely long lines
2016-12-23 13:00:55 +00:00
Charlie Gordon
71ab83a208 display: optimize low level buffer content read functions
- remove style handling from eb_nextc()
- add eb_nextc_style()
2016-12-13 17:20:51 +00:00
Charlie Gordon
214d02c67b improve current directory handling for shell mode
- get_default_path() takes buffer and offset instead of window
- mode specific handler returns NULL is current directory cannot be determined
- set EditBuffer->default_mode upon creating buffer_mode_data
- add ShellState->curpath to hold shell buffer current directory
- add shell_get_curpath to parse shell output for current directory
  in shell prompt, check if dir actually exists.
- update shell directory upon enter key.
  should instead keep a list with validity ranges
2016-11-26 11:30:29 +00:00
Charlie Gordon
e0961c3a4e completion: improve popup window handling
- fix completion popup current selection display
- TAB toggles completion popup open/close if there are matches
- SPC opens the completion popup and pages down through matches
- add non ambiguous completion as highlighted region in mini-nbuffer
- adding more characters with popup active rescans and filters list
- remove completion popup as more typing occurs without a match
2016-07-29 11:20:08 +00:00