summaryrefslogtreecommitdiff
path: root/lua/vis-std.lua
AgeCommit message (Collapse)Author
2024-04-25lua: Report viewport lines and bytes in one tableRudy Dellomas III
This will break all plugins which currently use Win.viewport.
2024-03-27lua: update default plugins to work with scintillua 6.2Randy Palamar
vis{,-std}.lua: * replace removed _TOKENSTYLES with _TAGS * don't add default styles to the lexer. lexers no longer define their own styles filetype.lua: update path detection for scintillua 6.2
2024-03-25ui: refactor style handlingRandy Palamar
The old style handling had a lot edge cases where one of the colours or the attribute wouldn't get applied correctly. This commit adds a new style_set() method to the Ui which should be called instead of manually touching a cell's style. This also means that the Cell struct can be made opaque since all the handling is now done inside the ui-terminal files. With this it is now viable to combine the light and dark 16 colour themes into a single base-16 theme. This theme works very well with the Linux virtual console and will now be the default theme regardless of if the terminal supports 256 colours or not. This should address the common complaints about vis not respecting the users default terminal colours. fixes #1151: Theming is sometimes partially applied or ignored see #1103: terminal no longer has transparency/opacity see #1040: Transparent background and setting options by default
2024-01-23lua: fix deprecated name for change-256colorsMichiel van den Heuvel
2023-12-05lua: drop redrawtime optionRandy Palamar
This hasn't worked in almost a year and even if it did it makes no sense. Based on my testing lexing takes a couple milliseconds at most. If it took 1 second (the default value for this option) vis would be completely unusable. If people want support for this it should be submitted upstream and vis will act based on the outcome of that. closes #1122: lexer no longer obeys redrawtime
2023-08-27lua: make sure lpeg is in fact optionalRandy Palamar
fixes #1119: lua: lpeg module isn't actually optional
2022-11-29Resync the lexers with Scintilluaqiu-x
- Resync the lexers with Scintillua - Update the lexer readme - Update `zenburn` theme to fix some highlighting issues - lexers: redirect print function to vis:info() - Fix support for custom style names - As per error message "lexer.delimited_range() is deprecated, use lexer.range()". - Remove remaining `lexer.delimited_range()` call - Set syntax to `nil` if the file type has no matching lexer - Updated Go lexer for Go 1.18. - lexers/dsv: convert to new lexer format (cherry picked from commit 9edbc3cd9ea1d7142b1305840432a3d2739e755a) - lexers/gemini: disable legacy gemini lexer This reverts commit 468f9ee1b027a7ce98b1a249fa1af5888feeb989. It is in legacy format and of questionable quality. Ideally it should be contributed upstream from where it will eventually trickle down to us. - lexers/git-rebase: convert to new lexer format (cherry picked from commit 4000a4cc9ac4a4c2869dfae772b977a82aee8d8c) - lexers/strace: convert to new lexer format (cherry picked from commit e420451320d97eb164f5629c1bcfab0b595be29d) - lexers/typescript: add new upstream lexer revision 28e2b60 (cherry picked from commit 7326e6deecdaa75fa94ae9ebdb653f9f907b33f2) - use `package.searchpath` instead of a local `searchpath` function - Restore `filetype: support filetype detection via hashbang` - Remove redundant comment - Restore gemini lexer
2020-02-24lua: add `redrawtime` optionGeorgi Kirilov
Upper bound lexing time and cancel highlighting if it is exceeded.
2020-02-24lua: optimize the win:style() loopGeorgi Kirilov
barely noticeable CPU usage improvement, although the number of iterations went down by an order of magnitude.
2018-05-17vis: display count/input queue content in status barMarc André Tanner
Fix #695
2018-01-22lua: fix theme loading when lexer module is not availableMarc André Tanner
The color settings are currently stored in the `vis.lexers` table, make sure it is not nil even when loading the lexer module (or one of its dependencies e.g. lpeg) failed.
2017-07-14vis-lua: make selection first class primitives in Lua APIMarc André Tanner
2017-04-09vis: remove handling of \r\n line endingsMarc André Tanner
Use something like dos2unix(1) and unix2dos(1), if you need to edit such files.
2017-03-31lexers: sync with scintillua changeset 600 rev fdeca0b808bfMarc André Tanner
I think the default value for the cache argument to the lexer load function should be true, not false. Optimize for the common case. This makes the API ugly/harder to use. But for now we follow upstream.
2017-03-19Move :set horizon option implementaiton to luaMarc André Tanner
2017-03-19Move :set theme option implementation to luaMarc André Tanner
2017-03-19Move :set syntax option implementation to luaMarc André Tanner
It is no longer possible to change the used syntax by assigning to the `win.syntax = name` field, instead the function win:set_syntax(name)` should be called. The distinction between filetype and syntax lexer to use should probably be clarified/cleaned up at some point.
2017-03-14Restructure display codeMarc André Tanner
Use pull instead of push based model for display code. Previously view.c was calling into the ui frontend code, with the new scheme this switches around: the necessary data is fetched by the ui as necessary. The UI independent display code is moved out of view.c/ui-curses.c into vis.c. The cell styles are now directly embedded into the Cell struct. New UI styles are introduced for: - status bar (focused / non-focused) - info message - window separator - EOF symbol You will have to update your color themes. The terminal output code is further abstracted into a generic ui-terminal.c part which keeps track of the whole in-memory cell matrix and #includes ui-terminal-curses.c for the actual terminal output. This architecture currently assumes that there are no overlapping windows. It will also allow non-curses based terminal user interfaces.
2017-03-05lua: reimplement word and file name completion in luaMarc André Tanner
The file name completion does not yet behave the same way as the previous C code because the completion prefix is currently simply calculated using the `iw` text object which does not handle common path elements (e.g. `.`, `/`, `~`, etc).
2017-03-01vis-lua: make cursor.pos return nil if cursor position is invalidMarc André Tanner
It remains to be seen whether that is a good idea, but at least it will reveal possible bugs.
2017-02-28lua: reimplement number increment <C-a> and decrement <C-x>Marc André Tanner
Based on a patch by Denis Warsow. Stuff which could probably be improved: - in vim the cursor does not need to be on top of the number, it suffices to be on the same line. - decrementing beyond zero does not work for hexadecimal and octal numbers, vim seems to wrap around in this case. 0x00000000 <C-x> becomes 0xffffffff Close #506
2017-02-28lua: move digraph handling to separate 'plugin'Marc André Tanner
Load a standard plugins directly from vis-std.lua.
2017-02-22lua: expose vis:module_exist method, load lexer and lpeg module during startupMarc André Tanner
2017-01-31vis: add workaround for broken color handling in Terminal.appMarc André Tanner
Terminal.app sets $TERM=xterm-256color and ships a corresponding terminfo description advocating that it is capable of color changes to the 256 color palette when in fact it can not. We introduce a new boolean option "change-256colors" which is true by default but can be used to disable color changes. It is automatically set if Terminal.app is detected using $TERM_PROGRAM. This should fix display artifacts as described in #456.
2017-01-27vis-digraph: add utility to handle digraphsjosuah
Hook it up via Lua to <C-k> in insert and replace mode. Close #460 #475
2016-12-14lua: make sure we always load a default themeMarc André Tanner
2016-12-14lua: improve error message when failing to load lpeg/lexer moduleMarc André Tanner
Differentiate between the case where the module is not found and the case where an error occured while loading it. This should make it easier to debug cases in which there is a Lua version mismatch between vis and lpeg.
2016-12-14lua: avoid errors if no theme is setMarc André Tanner
Close #429
2016-12-08vis-lua: move mode constants from vis.MODE_* to vis.modes.*Marc André Tanner
2016-12-08vis-lua: expose init event and use it to set default themeMarc André Tanner
The init event is emitted immediately after `visrc.lua` has been sourced, but before any other events have occured, in particular the command line arguments have not yet been processed. Close #422
2016-12-08lua: add simple event multiplexing mechanismMarc André Tanner
The editor core calls into the functions registered in the `vis.events` table which then multiplex the events to all registered event handlers. The first handler which returns a non `nil` value terminates event propagation.
2016-12-07lua: move non-core code out of vis.luaMarc André Tanner
The following structure is adapted: * visrc.lua entry point for all Lua code * vis.lua only implements the Lua part of the core API * vis-std.lua registers standard event handlers (e.g. syntax highlighting, statusbar handling, theme changes etc). It is sourced from vis.lua. * plugins/* non essential editor functionality, needs to be explicitly enabled by loading it from visrc.lua