1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-09-20 01:08:33 +03:00
kakoune/rc/filetype
Hugo Musso Gualandi 8755fc679e lua.kak: improve the indentation logic
This commit makes several improvements to the Lua indentation logic.

- Don't indent if the keyword is inside a string or comment
- Indent inside "do end"
- Indent inside "repeat until"
- Indent after a line ending with "{" or "("
- More accurate un-indentation for the "end" keyword

For the last point, previously we tried to match the indentation of the
starting keyword of the block.  However, sometimes this guessed wrong
and produced the wrong indentation, as the following example shows. The
new logic is to indent the "end" by one less level than the contents of
the block.

   while true do
      if false then
      end
      end -- This was incorrectly matched with the "if"
2021-09-11 01:27:41 -03:00
..
arch-linux.kak Add categories in rc/ 2019-03-21 01:06:16 +01:00
asciidoc.kak asciidoc: Add a highlighters for links 2020-07-30 16:56:56 -04:00
awk.kak Update deindentation rule for awk.kak, cabal.kak, go.kak 2020-07-29 15:06:27 -06:00
c-family.kak c-family.kak: properly quote shell variable 2021-04-30 11:53:18 +02:00
cabal.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
clojure.kak rc: Make docstrings more readable 2020-02-03 20:53:28 +01:00
cmake.kak Update remaining files to new provide/require format 2019-04-11 15:54:58 -07:00
coffee.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
coq.kak fix indent behavior for lines without indent 2020-05-03 17:48:44 +08:00
crystal.kak Replace my implementation of crystal-insert-on-new-line with already-existing ruby one 2020-08-02 11:39:59 -06:00
css.kak Update deindenting in css.kak 2020-07-29 09:35:36 -06:00
cucumber.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
cue.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
d.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
dart.kak dart: add extension to the list of keywords 2021-07-01 16:03:30 +02:00
dhall.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
diff.kak diff.kak: add diff file and diff hunk text objects 2020-04-03 15:48:54 -04:00
dockerfile.kak *sh.kak: do not highlight expansions if their $ is escaped 2020-09-19 08:06:46 +02:00
elixir.kak Rename exec->execute-keys for consistency 2021-06-06 14:29:51 +06:00
elm.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
eruby.kak Add missing eRuby indent group 2021-06-15 14:30:35 +02:00
etc.kak Fixed several more support files. 2019-04-10 16:48:46 -07:00
exherbo.kak Update remaining files to new provide/require format 2019-04-11 15:54:58 -07:00
fennel.kak add fennel filetype 2021-03-01 19:51:36 +03:00
fish.kak rc fish: fix keyword highlighting false positive 2021-08-09 22:45:52 +02:00
fsharp.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
gas.kak src: Create a <semicolon> named key 2019-10-22 11:02:06 +02:00
gdscript.kak rc: add gdscript.kak 2021-06-06 14:08:13 +03:00
gentoo-linux.kak Add gentoo linux ebuild filetype detection. 2021-08-06 11:30:06 -07:00
git.kak rc git: indented # is not a comment in commit message 2020-10-21 22:08:35 +02:00
gluon.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
go.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
graphql.kak chore(rc): support nested field strings in graphql 2021-01-14 15:46:50 -05:00
haml.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
haskell.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
hbs.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
html.kak [html] Fix indentation when entering a newline while in the middle of a tag 2019-11-03 12:25:02 +01:00
i3.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
ini.kak rc ini: More leniently highlight section names 2020-05-14 10:25:38 +03:00
janet.kak Add basic support for the Janet language 2021-04-23 14:49:24 -03:00
java.kak Java: add highlighting for char literal 2021-05-17 21:15:30 +02:00
javascript.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
jinja.kak rc jinja: Highlight Jinja statements/expressions 2020-01-08 12:22:34 +01:00
json.kak Clean up my previous updates 2020-07-29 09:40:58 -06:00
julia.kak rc julia: add multiline comments 2021-02-21 19:20:03 +01:00
just.kak just: highlight function expressions 2020-09-22 00:24:29 -05:00
kakrc.kak rc kakrc: Add the rename-buffer keyword 2020-11-17 15:58:58 +03:00
kickstart.kak Update remaining files to new provide/require format 2019-04-11 15:54:58 -07:00
kotlin.kak Highlight extra chars in literal 2021-05-18 20:51:52 +02:00
latex.kak Improve latex support. 2020-09-05 16:14:22 +02:00
ledger.kak src: Create a <semicolon> named key 2019-10-22 11:02:06 +02:00
lisp.kak {clojure,lisp}.kak: handle doubled brackets 2020-01-03 15:14:56 -05:00
lua.kak lua.kak: improve the indentation logic 2021-09-11 01:27:41 -03:00
mail.kak Highlight mail References headers 2020-04-21 13:21:35 +10:00
makefile.kak *sh.kak: do not highlight expansions if their $ is escaped 2020-09-19 08:06:46 +02:00
markdown.kak Improve highlighting of markdown lists 2021-07-06 13:32:23 +02:00
mercurial.kak Update remaining files to new provide/require format 2019-04-11 15:54:58 -07:00
mercury.kak rc: make insertion hooks more consistent 2021-04-17 20:56:23 +02:00
meson.kak meson: improve highlighting, add static words 2021-01-13 15:44:38 +01:00
mlb.kak Add highlighters for Standard ML 2020-06-23 19:22:35 +01:00
moon.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
nim.kak Merge remote-tracking branch 'SolitudeSF/suffix' 2021-04-18 17:07:30 +10:00
ninja.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
nix.kak Fix regex for nix paths 2021-08-23 11:06:14 +01:00
ocaml.kak ocaml quoted-strings 2020-07-20 13:07:45 +03:00
pascal.kak make pascal filetype compatible with bash 2021-07-17 20:01:12 +02:00
perl.kak Allowed for references of strings 2021-05-17 14:30:33 -04:00
php.kak Fix unterminated string in rc/filetype/php.kak 2021-09-02 14:54:47 -07:00
pony.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
protobuf.kak Fix deindentation in protobuf.kak 2020-07-29 20:41:18 -06:00
pug.kak src: Create a <semicolon> named key 2019-10-22 11:02:06 +02:00
purescript.kak Fix purescript comments and keywords 2021-05-30 15:39:58 +03:00
python.kak rc: make insertion hooks more consistent 2021-04-17 20:56:23 +02:00
r.kak R file highliight change. Merged into single highlighter for math, summary and complex functions. 2021-07-30 11:29:29 -05:00
ragel.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
restructuredtext.kak rc restructuredtext: don't highlight first character of next line as code 2021-02-10 21:09:16 +01:00
ruby.kak Rename exec->execute-keys for consistency 2021-06-06 14:28:28 +06:00
rust.kak add TODO comment highlighting 2021-05-02 20:38:42 -04:00
sass.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
scala.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
scheme.kak add sps and sls file extensions for scheme 2021-05-28 20:51:06 +10:00
scss.kak Replace ModeChange hooks by ModePush and ModePop 2019-10-16 20:45:53 +11:00
sh.kak sh.kak: Highlight special parameters, e.g. $@, in double quotes 2020-11-14 13:53:52 +01:00
sml.kak Add highlighters for Standard ML 2020-06-23 19:22:35 +01:00
sql.kak Fix function highlighting by adding lazy instead of greedy regexp quantifier 2020-10-14 14:54:43 -06:00
svelte.kak Improve svelte highlighter 2020-11-13 00:21:05 +01:00
swift.kak rc swift: Add open and internal keywords 2021-06-24 14:29:10 +03:00
systemd.kak Add categories in rc/ 2019-03-21 01:06:16 +01:00
taskpaper.kak src: Create a <semicolon> named key 2019-10-22 11:02:06 +02:00
terraform.kak Add filetype for terraform files with syntax hl 2019-11-18 20:41:42 +00:00
toml.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
troff.kak Add comment highlighter for troff files. 2021-02-25 20:18:10 +01:00
tupfile.kak Fixed many of the filetype support modules to not use BufSetOption to load 2019-04-09 20:54:19 -07:00
vhdl.kak [VHDL] Add 'character' to types highlight. 2021-04-29 13:38:15 +02:00
void-linux.kak Add categories in rc/ 2019-03-21 01:06:16 +01:00
yaml.kak rc: use a separate *-insert hook to auto-insert comments 2021-04-17 20:56:23 +02:00
zig.kak rc zig: auto-insert multiline string prefix on newline 2021-06-12 03:38:27 -07:00