aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-07-26add missing lexer specific styles to solarized themeMatěj Cepl1-0/+120
This is a parallel to https://github.com/martanne/vis/pull/1197 Signed-off-by: Matěj Cepl <mcepl@cepl.eu>
2024-07-04Add additional html style tags to base-16.luajvvv1-0/+2
This closes https://github.com/martanne/vis/issues/1196.
2024-05-30Fail silently when syntax has no lexerMichiel van den Heuvel3-12/+9
This'll patch vis.lexers.load to return nil when the lexer could not be found. Previously it would've errored out, which the load in lexer.lua still will as this is used in lexers themselves. Another possibility is to only patch set_syntax in vis.lua and the WIN_HIGHLIGHT handler in vis-std.lua, but as most references to vis.lexers.load already handle a nil return, this seems better.
2024-05-30remove the vis->initialized memberRandy Palamar5-34/+26
I already fixed the reason that this even existed (vis_event_emit getting called at random times when the editor wasn't ready). The option checking in main() was moved up because I noticed it was in the wrong place while thinking about where to emit the INIT event. There is no reason to do a bunch of useless work just to print the version.
2024-05-24combine Win and UiWinRandy Palamar9-192/+152
These are not seperate things and keeping them this way makes gives this convoluted mess where both Wins and UiWins must have linked lists to the other Wins and UiWins in the program despite the fact that neither of them can exist in isolation. This, like my previous cleanup commits, is part of a larger goal of properly isolating the various subsystems in vis. Doing so is required if we ever want to be able to have a vis-server and a vis-client.
2024-05-24remove SyntaxSymbol redirection typeRandy Palamar3-29/+19
There is no reason why this isn't just a char *.
2024-05-23drop cell_blank from ViewRandy Palamar2-14/+7
No need for this to be stored in every View since its just a never modified cell with a space. Also delete the cell_unused global since all it does is provide a 0 initialized Cell.
2024-05-22build: update alpine in docker build to version 3.20Christian Hesse1-1/+1
Just a version bump, no changes required.
2024-05-21remove some view pointer chasingRandy Palamar13-151/+139
Same as previous commit each window only has a single View. No need for it to be stored elsewhere in memory.
2024-05-21remove some ui pointer chasingRandy Palamar12-73/+65
There only exists a single Ui so there is no need to force a pointer redirection for accessing it. The Ui member was moved down in vis-core.h to punt around an issue with the way lua checks for existing objects. It may show up again as I flatten more structs.
2024-05-21replace UiTerm with Ui & delete function pointersRandy Palamar13-333/+188
2024-05-21replace UiTermWin with UiWin & remove function pointersRandy Palamar8-136/+82
2024-05-21make Selection unopaqueRandy Palamar11-139/+72
2024-05-21make View unopaqueRandy Palamar12-193/+108
2024-05-21cleanup some single line get/set functionsRandy Palamar7-100/+54
2024-05-21cleanup vis event interfaceRandy Palamar9-288/+236
This removes the function pointer interface which was adding needless complexity and making it difficult to add new events. Now if new events are only meant for lua they only need to be added to the lua interface. This will also have a minor reduction in runtime memory usage and produce a smaller binary. The only runtime difference is that QUIT happens after all windows have been closed and their files freed.
2024-05-21Merge vis-tests into test directoryRandy Palamar454-0/+114700
Going forward all tests should be submitted here directly.
2024-05-21Prepare to merge vis-testRandy Palamar3-23/+0
2024-05-19fix primary cursor color displaynobody1-1/+2
2024-05-18workaround __builtin_strncpy bounds checkingRandy Palamar1-1/+1
2024-05-12enable warnings in default CFLAGSRandy Palamar1-0/+1
2024-05-12lua: allow changing the displayed file of a windowFlorian Fischer3-0/+20
Change the file displayed in a window by writing the new file name to the window's file member. This is useful to change the displayed file during events. Using the edit command during an event caused by a pervious edit command causes a double free.
2024-05-08drop deprecated option namesRandy Palamar1-20/+10
2024-05-06lua: filetype: properly search for lexer pathRandy Palamar1-2/+2
fixes #1190: Missing mail.lua lexer
2024-05-03lua: themes: add `STYLE_CODE`Thim Cederlund1-1/+2
used by the following lexers: gemini, markdown and txt2tags to highlight sections of code.
2024-05-03configure: check for 'lua5.4-lpeg' tooMr Alin1-1/+1
2024-05-01set version to v0.9-gitRandy Palamar1-1/+1
2024-05-01release 0.9Randy Palamar4-13/+84
2024-04-30lua: complete-filename: use biggest possible prefixFlorian Fischer1-1/+1
This allows for example to complete file names in markdown images. E.g.: ![](pic<C-x><C-f> will complete the file name. Previously it would have detected the '[' as prefix.
2024-04-30lua: uncomment list of lexer specific styles in default themeRandy Palamar1-2/+0
2024-04-29lua: Serve viewport dimensions in viewport tableRudy Dellomas III1-3/+11
These values are useful for calculating terminal positions.
2024-04-29Emit an event (ui_draw) immediately before drawing the screenRudy Dellomas III8-1/+24
This allows better control over styling, as well as potential for entirely new UI elements implemented entirely using the Lua API.
2024-04-29Add Lua function to Win for directly editing cell styling by positionRudy Dellomas III3-0/+43
2024-04-29lua: small filetype/style setting cleanupRandy Palamar2-20/+5
Filetype extension mapping already needs to match regular expressions so we might as well us it to simplify things. set_syntax doesn't need to handle pseudo scintilla style definitions. I couldn't even find any examples of table style definitions anywhere let alone references to other definitions as $(style.myvarname) (hint: variables in lua already handle this).
2024-04-25lua: Report viewport lines and bytes in one tableRudy Dellomas III2-4/+17
This will break all plugins which currently use Win.viewport.
2024-04-21vis-cmd: silence gcc warning & remove strlen callMatěj Cepl1-1/+2
2024-04-21ci: fix macOS runnerRandy Palamar1-7/+4
Apparently Github changed the permissions on /usr/local in the default image so now we need to use `sudo` for luarocks to be able to install packages. While I'm here: update the checkout dependency and use macOS-latest image instead of multiple old images.
2024-04-21Disable reverse with "notreverse" in style definitionsRudy Dellomas III1-0/+2
2024-04-21Add a Lua constant for UI_STYLE_LEXER_MAXRudy Dellomas III1-0/+1
Currently, there's no mechanism for defining user styles without risk of collision with default lexer and theme settings. Very few lexers use more than 10, let alone all 64 of the allowed styles, so UI_STYLE_LEXER_MAX - (no. of user defined styles) allows for a reasonably large number of user-defined styles before collision becomes a problem.
2024-04-07plugins/filetype: fix javascript/typescript detectiongit-bruh1-2/+2
2024-03-27lua: update default themesRandy Palamar2-1/+122
This also involves modifying the style definitions so that they include sub tags as well. For example command.section in latex should be mapped to COMMAND_SECTION.
2024-03-27lua: cache loaded lexersFlorian Fischer1-0/+14
Caching lexers causes lexer tables to be constructed once and reused during each HIGHLIGHT event. Additionally it allows to modify the lexer used for syntax highlighting from Lua code. This is used for example for the syntax aware spellchecking performed by the vis-spellcheck plugin.
2024-03-27lua: update default plugins to work with scintillua 6.2Randy Palamar3-15/+4
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-27Get lexers from the subdirectory of directories on the path.Matěj Cepl1-1/+1
Based on the advice from the upstream maintainer of Scintillua (gh#orbitalquark/scintillua#87).
2024-03-27update lexers to orbitalquark/scintillua@b789ddeMatěj Cepl153-3773/+5374
Rather than cherry pick patches from after 6.2 we will just grab everything as is.
2024-03-25ui: refactor style handlingRandy Palamar13-126/+89
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-03-25Add parentheses around '&&' within '||'.Matěj Cepl1-2/+2
Silencing compiler's -Wparentheses warning.
2024-03-25complete-word: restore mode to INSERT on exitRandy Palamar1-0/+2
2024-03-21Fix typosMax Schillinger2-3/+3
2024-03-14filetype.lua: add typst detectionDisonantemus1-0/+3