Commit Graph

10038 Commits

Author SHA1 Message Date
Frank LENORMAND
6976b1dce4 rc modeline: Prevent command execution
This commit prevents specially crafted modelines from making the
editor execute arbitrary Kakoune commands.

By using a tabulation character as a separator, commands can be
injected in the value of the options listed in the modeline. For
example:

	# kak: tabstop=2;set-option	buffer	pwned	yes

Fixes #3735.
2020-09-18 09:01:32 +03:00
Maxime Coste
dbd7e4da79 Merge remote-tracking branch 'voroskoi/gopls' into master 2020-09-17 19:49:33 +10:00
Maxime Coste
fd658f6995 Merge remote-tracking branch 'lenormf/fix-3733' into master 2020-09-17 19:39:48 +10:00
Maxime Coste
b8f56a65ed Merge remote-tracking branch 'deviant/add-go-alternative-file' into master 2020-09-17 19:38:59 +10:00
Maxime Coste
0e58d4702c Merge branch 'patch-1' of http://github.com/xiaq/kakoune into master 2020-09-17 19:35:56 +10:00
Maxime Coste
cb047a4a7d Merge remote-tracking branch 'tototest99/ninja-syntax' into master 2020-09-17 19:34:54 +10:00
Maxime Coste
81163ce48a Merge remote-tracking branch 'Aajn/python-highlighter' into master 2020-09-17 19:33:51 +10:00
VÖRÖSKŐI András
9fe1a2a9a4 gopls: fixes based on krobelus@ review 2020-09-16 21:58:22 +02:00
antab
810689ad60 fix: variables adjacent to = and in build declaration 2020-09-16 21:09:27 +02:00
Frank LENORMAND
643bf2bb59 test: Implement a regression test for #3733 2020-09-16 11:00:15 +03:00
Frank LENORMAND
95c095f3fb rc modeline: Don't select more lines than configured
This commit addresses an off-by-one error that selected `modelines`+1
lines when looking for modelines in a buffer.

Note that setting `modelines` to 0 will still select one line.

Fixes #3733.
2020-09-16 11:00:15 +03:00
antab
ea4f2b8837 feat: add basic ninjafile support 2020-09-16 00:03:17 +02:00
David Arnold
1ff9895fe4 just: re-implment bash/sh interpreter 2020-09-15 16:32:07 -05:00
David Arnold
3857696df6
just-highlighter: pre call out to shebang regions 2020-09-15 16:10:40 -05:00
David Arnold
3770baaab0 fix justfile highlighter
This fixes serveral shortcomings of the current implementation:

- valid recipt definitions eg
foo bar="quz":
where previously interrupted by justfile/double_string
and therefore they where not highlighted correctly

- global variable assignments where not captured at all
2020-09-15 15:52:00 -05:00
antab
b5a7f63f7e tototest99 Copyright Waiver
I dedicate any and all copyright interest in this software to the
public domain.  I make this dedication for the benefit of the public at
large and to the detriment of my heirs and successors.  I intend this
dedication to be an overt act of relinquishment in perpetuity of all
present and future rights to this software under copyright law.
2020-09-15 22:48:00 +02:00
Piotr Chrominski
bfbf4d2080 Fix python docstring highlighter
Escaped ' or " at the end of a docstring no longer break highlighting.
2020-09-15 22:01:55 +02:00
Piotr Chrominski
ef10d07be8 Piotr Chrominski Copyright Waiver
I dedicate any and all copyright interest in this software to the
public domain.  I make this dedication for the benefit of the public at
large and to the detriment of my heirs and successors.  I intend this
dedication to be an overt act of relinquishment in perpetuity of all
present and future rights to this software under copyright law.
2020-09-15 21:56:05 +02:00
VÖRÖSKŐI András
2b18b1d088 rc/go-tools.kak: remove
Working functions replaced by gopls
Use kak-lsp if you need in place documentation and autocompletion
2020-09-15 01:02:19 +02:00
VÖRÖSKŐI András
568020d67b rc gopls.kak: initial import
Add support for the following gopls commands:
 - format
 - imports
 - definition
 - references

Thanks krobelus@ and lenormf@ for their review and suggestions.
2020-09-15 01:01:35 +02:00
samueldple
59c6c071de
Fix grammar in manual entry 2020-09-12 11:05:14 +01:00
VÖRÖSKŐI András
244b1c8a7c VÖRÖSKŐI András Copyright Waiver
I dedicate any and all copyright interest in this software to the
public domain.  I make this dedication for the benefit of the public at
large and to the detriment of my heirs and successors.  I intend this
dedication to be an overt act of relinquishment in perpetuity of all
present and future rights to this software under copyright law.
2020-09-11 23:09:13 +02:00
V
c6b7e3d74a Add :alt command for go files 2020-09-10 00:23:46 +02:00
samueldple
ec38b3a82a
samueldple Copyright Waiver
I dedicate any and all copyright interest in this software to the
public domain.  I make this dedication for the benefit of the public at
large and to the detriment of my heirs and successors.  I intend this
dedication to be an overt act of relinquishment in perpetuity of all
present and future rights to this software under copyright law.
2020-09-09 14:35:13 +01:00
Maxime Coste
ec3d7c3104 Add support for removing from options
`set -remove ...` will remove from the current option value, substracting
from int, removing elements from vectors and maps.
2020-09-09 21:00:30 +10:00
Maxime Coste
6f260c2ab2 Merge remote-tracking branch 'm-kru/latex' into master 2020-09-08 19:06:56 +10:00
Qi Xiao
1f5d566d15
Update commands.asciidoc
Fix typo: "automatically" should be "atomically"
2020-09-07 23:46:30 +01:00
Michał Kruszewski
0f63dd339a Provide better support for Go language.
1. Highlight short variable declaration operator :=.
2. 'while' is not go keyword.
3. Auto insert ')', '}', when line ends with '(' or '{'.
2020-09-07 21:48:06 +02:00
V
cd9fd2fdb6 V Copyright Waiver
I dedicate any and all copyright interest in this software to the
public domain.  I make this dedication for the benefit of the public at
large and to the detriment of my heirs and successors.  I intend this
dedication to be an overt act of relinquishment in perpetuity of all
present and future rights to this software under copyright law.
2020-09-06 14:14:14 +02:00
Michał Kruszewski
7d358e9ea1 Michał Kruszewski Copyright Waiver
I dedicate any and all copyright interest in this software to the
public domain.  I make this dedication for the benefit of the public at
large and to the detriment of my heirs and successors.  I intend this
dedication to be an overt act of relinquishment in perpetuity of all
present and future rights to this software under copyright law.
2020-09-06 07:46:59 +02:00
Maxime Coste
cfbff4e132 Merge remote-tracking branch 'kayhide/purescript-filetype' into master 2020-09-06 11:23:48 +10:00
Maxime Coste
c98d6c3062 Merge remote-tracking branch 'krobelus/initialize-shell-vars' into master 2020-09-06 10:52:07 +10:00
Maxime Coste
cf7955cdfb Merge remote-tracking branch 'lenormf/docstring-newline-format' into master 2020-09-06 10:50:51 +10:00
Maxime Coste
f84c550d30
Apply suggestions from code review
Co-authored-by: Screwtapello <thristian@gmail.com>
Co-authored-by: Johannes Altmanninger <aclopte@gmail.com>
2020-09-06 10:56:37 +10:00
Maxime Coste
22676647fe Merge remote-tracking branch 'krobelus/python-no-indent-after-comment' into master 2020-09-06 10:48:49 +10:00
Maxime Coste
97fd0c0510 Merge remote-tracking branch 'lenormf/repl-normalise' into master 2020-09-06 10:48:08 +10:00
Michał Kruszewski
705712f13b Improve latex support.
Auto insert "\end{[word]}" for "\begin{[word]}".
2020-09-05 16:14:22 +02:00
Tim Allen
a25cc215e8 Reference content goes in docstrings, explanations go in prose docs.
Also, make sure docstrings reference the prose docs, so people who stumble over
an interesting-looking command or option can find out more about it.
2020-09-04 19:20:50 +10:00
Hideaki Kawai
c613e3c7f1 Create purescript filetype 2020-09-04 11:33:08 +09:00
Hideaki Kawai
c87e41c195 Hideaki Kawai Copyright Waiver
I dedicate any and all copyright interest in this software to the
  public domain.  I make this dedication for the benefit of the public at
  large and to the detriment of my heirs and successors.  I intend this
  dedication to be an overt act of relinquishment in perpetuity of all
  present and future rights to this software under copyright law.
2020-09-04 11:27:06 +09:00
Tim Allen
66cc39cb14 Update plugin docs to not duplicate docstring information. 2020-09-03 17:18:19 +10:00
Tim Allen
9934788155 Add more user-oriented documentation for the documentation system. 2020-09-03 16:49:18 +10:00
Tim Allen
e3298c6320 Address code-review comments
- some wording changes in included documentation
- find supports multiple starting paths, we don't need to launch it 3 times
- Change the regex that trims the file extension to only trim the last extension

Some additional things I noticed:

- find should use -L to see through symlinks like the autoload processing does.
- find should check the user's autoload directory first, so users can override
  Kakoune's built-in documentation.
2020-09-03 15:21:54 +10:00
Tim Allen
d628cb50cf rc: Add some documentation for existing plugins.. 2020-09-03 01:55:36 +10:00
Tim Allen
4296305171 doc.kak: Also search through plugins (stdlib and per-user) for docs.
This makes the somewhat-dubious assumption that every plugin will have uniquely-
named documentation files, instead of automatically putting every plugin's docs
into a namespace. However, plugins already have to deal with flat namespaces for
commands, options, filetypes, etc. so one more shouldn't hurt.

Fixes #2466.
2020-09-03 01:19:20 +10:00
Jiri Konecny
b77e5f0364
Update spec file to newer version 2020-09-02 14:57:59 +02:00
Frank LENORMAND
0cd706254a rc clang grep: Make docstrings more readable 2020-09-02 11:57:34 +03:00
Johannes Altmanninger
407c72d90a Clear unwanted environment variable
This adds two things I forgot in
9a7d8df4 (Avoid accidentally using environment variables in sh scopes)

Mea culpa, the problem was that I was skipping matches with "filetype"
because that's usually just a hook parameter as in "WinSetOption filetype=.."

	rg --pcre2 '\b(?!filetype=)\w+=' rc/

So I missed these two cases where a shell variable is actually called "filetype".

The one in git.kak was not a problem because show_git_cmd_output is only
ever called with sane inputs.  However, file.kak does use the filetype
environment variable for many mime types, for example:

	filetype=somefiletype\''; echo -debug injection; nop '\' kak /dev/null

Will run the echo since /dev/null has mime type "inode/chardevice"
2020-09-02 06:54:19 +02:00
Johannes Altmanninger
e1de4aa118 python.kak: Do not indent after comments ending in :
Fixes #3693

This will not work for lines like the one below but I think that's okay
because it does work for most comments.

	foo() # foo:
2020-09-02 06:44:36 +02:00
Maxime Coste
e0d2602e6a Kakoune 2020.09.01 2020-09-01 20:37:20 +10:00