Commit graph

30 commits

Author SHA1 Message Date
Charlie Gordon
fc85c4f8e6 colorizers: some factorisation
- pass initial character to `ustr_get_identifier` and `ustr_get_word`.
- add lowercasing variant `ustr_get_identifier_lc()`
- remove `get_word_lc()` in makemode.c
- remove `get_js_identifier()` in clang.c
2017-05-29 06:21:42 +00:00
Charlie Gordon
84547c6209 build: fix compile time warning
- fix some warnings on unused variables and variables potentially
  used before set
- force definition of va_copy() and atomic_get_and_set() for haiku
2017-04-15 09:39:02 +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
c5a3bb8ecb updated heading 2017-03-25 18:14:59 +00:00
Charlie Gordon
b962e33ade updated copyrights 2016-03-06 19:53:06 +00:00
Charlie Gordon
2ec28aef7a cmake: added colorizer for cmake files 2016-03-06 18:03:25 +00:00
Charlie Gordon
5b85c88800 added language coloring for Neko and NekoML
- added language coloring for Neko and NekoML
- improved Makefile parsing and coloring
2015-04-05 15:10:01 +00:00
Charlie Gordon
3b9520dc9d select Makefile mode for .gmk files 2014-06-01 18:01:50 +00:00
Charlie Gordon
611e44403d prepare mode separation (view / syntax / data)
* add fields in EditBuffer struct
* pass buffer and flags to mode_init functions
* add default_mode_init function to avoid tests
2014-06-01 13:54:58 +00:00
Charlie Gordon
2e5cc16713 improve syntax colorizing modes consistency
* create separate modes for all syntax colorizers
* add colorizing_flags to mode structure for code sharing
* pass ModeDef struct pointer to colorizing function
* remove obsolete window fields
2014-05-30 17:18:12 +00:00
Charlie Gordon
b8004d7072 simplify mode definitions
* assume text mode primitives for MODEF_SYNTAX modes
* initialize mode structures inline instead of cloning text_mode
2014-05-29 18:29:14 +00:00
Charlie Gordon
569401da15 simplify mode init/close
* always regsister callbacks on s->top and s->top_offset
* handle saved_data generically, remove window callback
  this will be replaced with view history mecanism.
2014-05-29 10:26:13 +00:00
Charlie Gordon
f527a58e18 add mode flags to specify different types of modes
* add  mode_flags as extra argument to qe_register_mode
* change all mode registration calls accordingly
2014-05-27 12:05:52 +00:00
Charlie Gordon
ba22305321 remove useless init_mode functions and empty command lists 2014-05-26 20:29:09 +00:00
Charlie Gordon
2ef06f9131 pass QEColorizeContext to ColorizeFunc callbacks
* pass state and state_only as members of QEColorizeContext
* simplify ColorizeFunc, make them more consistent
* use offsets instead of pointers to prepare for further API changes
2014-04-05 15:49:14 +00:00
Charlie Gordon
b1ab7efb54 improve colorizers
* use mode specific namespace for colorizer states and styles
* use enum values instead of preprocessor macros for states and styles
2014-04-02 12:58:12 +00:00
Charlie Gordon
b2c2c9374e improve c-mode, add mode_flags to handle language mode flavors
* add mode_flags and mode_name in EditState
* pass mode_flags to ColorizeFuncs
* define several CLANG mode flavors for C, C++, Javascript, Java, etc.
* add flavor specific keyword lists for c-mode
* add regex support in c-mode for Javascript flavor
2014-03-24 10:58:09 +00:00
Charlie Gordon
5712445f60 force makefile-mode on GNU makefiles 2014-03-13 07:59:31 +00:00
Charlie Gordon
0052071fb2 use SET_COLOR macros in various colorizers
* use macro to prepare for coloring API change
* done for lisp-mode, markdown-mode, perl-mode, shell-script-mode,
  org-mode, makefile-mode
2014-03-10 22:11:24 +00:00
Charlie Gordon
7e05ffc8d9 add new extensions for Makefile and shell script modes 2014-03-02 10:45:10 +00:00
Charlie Gordon
9eb5944588 Improve mode selection and mode specific command safety
* add set-auto-mode() to (re)select best mode for buffer
* add set-next-mode() on M-m to cycle appropriate buffer modes
* add set-previous-mode()
* add default_mode and saved_mode in buffers to improve mode switching
* add dired mode probing and store st_mode in buffer to detect directories
* add charset, eol_type and buffer in ModeProbeData
* clean mode selection and window buffer attachment (needs more work)
* compute sorted list of appropriate modes in probe_mode
* convert charset and eol_type in mode_probe
* add signatures in buffer priv_data to perform save casts
* move BufedState to b->priv_data, protect mode specific functions
  add bufed_mode_probe function, cycling through modes comes back to bufed mode
* move DiredState to b->priv_data, protect mode specific functions
  add dired_mode_probe function, cycling through modes comes back to dired mode
* add heading line in dired buffer with directory spec
* protect shell-mode specific functions.
* restart shell in shell() command if exited
* some cosmetics changes (remove useless __unused__, missing messages ...)
2014-02-10 21:21:39 +00:00
Charlie Gordon
5039815fdd fix some mode probe issues
* perform generic test on extension in text_mode_probe
* allow mode force in language modes by returning 1 instead of 0 in probe
2014-02-06 00:22:17 +00:00
Charlie Gordon
b953aaf811 improve consistency in buffer variables
* change tab-size to tab-width
* make tab-width a buffer variable
* add fill-column buffer variable
* add set-fill-column on C-x f
* add default-tab-width and default-fill-column global variables
* force indent-tabs-mode in makefile mode
* force tab-width to 8 in shell output buffers
2014-01-21 00:01:20 +00:00
Charlie Gordon
c91bd12b8f simplified editing modes
* added colorize_func in ModeDef struct
* removed mode_init functions for most language modes
* other small improvements in mode_probe functions
* no need for get_basename in mode_probe functions
2014-01-05 23:42:54 +00:00
Charlie Gordon
b3a709013a improve mode selection, cleanup
* pass ModeDef pointer to mode_probe functions
* add extensions field to mode structure
* rename ascii mode to binary mode
* rename mode variables and fields to more specific names
2014-01-04 17:26:30 +00:00
Charlie Gordon
2d0783cfd9 renames basename to get_basename to avoid conflicts 2008-04-08 06:54:44 +00:00
Charlie Gordon
a5eae3ed92 bumped copyrights, some cosmetics 2008-01-08 16:37:54 +00:00
Charlie Gordon
f11cf4a207 eb_scratch takes buffer creation flags
added eb_find_new -> find a buffer by name, create one from flags if not found.
qe_register_cmd_table takes ModeDef* instead of mode name
do_global_set_key -> do_set_key with local/global flag
added local-set-key
reuse *bufed* buffer if one exists
bind increase/decrease-width commands from command definition
cosmetics, comments, remarks
renamed kill buffers from *yank* to *kill-%d*
save QErrorContext in parse_args, load_all_modules:
  improves readability in *messages* buffer
fixed qe_init to fall back from x11 display to terminal session upon failure
2008-01-04 22:24:37 +00:00
Charlie Gordon
4743fa1308 added remove_slash and append_slash path utilities
renamed canonize to canonicalize
added crude support for ~user -> /home/user
added win32 specific stuff in basename
added C-/ as an alias for C-_
some cosmetics, moved code
create files with mode 0644 in raw_save_buffer
untabified, removed redundant spaces
modified code generators to the same effect
2008-01-03 09:51:29 +00:00
Charlie Gordon
fa760147c8 added Perl mode: perl.c
added Makefile mode: makemode.c
added HTML source mode: htmlsrc.c
added more dependencies in Makefile
added styles for HTML source coloring:
    html-comment, html-string, html-script, html-entity, html-tag
no longer rely on \n at end of line in c_colorize_line
2007-12-18 18:07:03 +00:00