Commit Graph

10457 Commits

Author SHA1 Message Date
Pound_Hash
cbca06de49 Alan Welsh 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.
2022-06-05 14:35:47 -07:00
Tony Gong
680dc8cd91 Golang do not align to open ( or {
Changed the indentation behavior such that an extra level of
indentation is added after a line containing a ( or { that is
not closed on the same line instead of aligning to the unclosed
( or {. This is consistent with how `go fmt` formats source code.

Added regression tests.
2022-06-05 06:19:30 -07:00
Tony Gong
039a10a34c Do not indent Golang comments as code
When indenting on newline in Go files, only remove trailing whitespace
on the previous line and copy indentation of the previous line if in
comment context.

Added regression tests.
2022-06-05 06:05:45 -07:00
Tony Gong
6f801c6cda Golang separate hook group for inserting ) and }
Add a separate hook group for inserting ) and } on newline because the
current implementation does not work in 100% of cases and should be
able to be disabled independently of copying comment characters (which
is much easier in comparison to get right) if one does not care about
this feature.
2022-06-05 06:03:09 -07:00
Qi Xiao
b99bad6fd0 rc elvish: Support new "catch" keyword. 2022-06-05 12:59:09 +01:00
Tony Gong
f4e4d6234b Tony Gong 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.
2022-06-04 07:38:40 -07:00
Maxime Coste
34e1f3cc1b Merge remote-tracking branch 'krobelus/consistent-trim-indent' 2022-06-04 10:57:11 +10:00
Maxime Coste
e08383a31a Merge remote-tracking branch 'krobelus/shift-space' 2022-06-04 10:53:50 +10:00
Maxime Coste
56bcb6b761 Merge remote-tracking branch 'krobelus/replace-std-iterator' 2022-06-04 10:52:47 +10:00
Maxime Coste
dc1ee01c98 Merge remote-tracking branch 'sidkshatriya/highlighter-doc-edits' 2022-06-04 10:51:56 +10:00
Maxime Coste
6ffec75406 Code style cleanups around insert completer 2022-06-04 10:50:09 +10:00
Maxime Coste
a16de52f9c Merge remote-tracking branch 'krobelus/track-inserted-completions-better' 2022-06-04 10:33:06 +10:00
Maxime Coste
083bf82c23 Remove strace call in test that was committed by mistake
Closes #4621
2022-06-03 16:01:58 +10:00
Maxime Coste
66ab823fa8 Merge remote-tracking branch 'omasanori/build-releases' 2022-06-03 15:58:05 +10:00
Maxime Coste
72e181e099 Merge remote-tracking branch 'AnthonyYoManz/3743-support-focus-in-sway' 2022-06-03 15:57:33 +10:00
Maxime Coste
503e5bc507 Only set fd to non-block if there is an EventManager
Fixes #4630
2022-06-03 15:57:25 +10:00
DixiE
0048e9f488 Support focus Within Sway WM
While Wayland offers nothing general to help us support `focus` on all
window managers, WM-specific implementations are generally possible.
Sway is a tiling window manager that mimics i3, and has a reasonably
powerful CLI that can help us achieve this.

In addition to supporting `focus` for Sway, this change paves the way
for additional WM-specific Wayland functionality by adding a detection
step to wayland.kak, in a similar fashion to detection.kak.
2022-06-02 10:57:28 +01:00
Masanori Ogino
1d439f0ab8 Add a workflow to upload Linux build on releases
Building static binaries with Alpine Linux's musl libc-based toolchain
should make them work on any distros with Linux kernel 2.6.39 and newer.

Fixes https://github.com/mawww/kakoune/issues/4555

References:

- https://wiki.musl-libc.org/supported-platforms.html

Signed-off-by: Masanori Ogino <masanori.ogino@gmail.com>
2022-05-31 17:13:11 +09:00
Maxime Coste
ac6f928ad4 Fix switch completion 2022-05-30 19:27:18 +10:00
Johannes Altmanninger
66078243ec Run InsertCompletionHide hook before insertions that close completion menu
Insert mode completions are accepted by typing any key.  For example,
if there is a completion "somefunction()", then typing

	some<c-n>;

will insert

	somefunction();

and then the InsertCompletionHide hook will fire.  The hook parameter
is a range that contains the entire thing: the actual completion plus
the trailing semicolon that closed the completion menu.

The [original motivation] for the hook parameter was to support
removing text inserted by completion, so we can apply text edits
or expand snippets instead. One problem is that we don't want to
remove the semicolon. Another problem came up in a discussion
about [snippets]: let's say we have a snippet "add" that expands to

	add(?, ?)

where ? are placeholders. After snippet expansion the cursor replaces
the first placeholder. If I type "ad<c-n>1" I expect to get "add(1, ?)".
If the InsertCompletionHide hook only runs after processing the "1"
keystroke, this is not possible without evil hacks.

Fix these problems by running InsertCompletionHide when a completion is
accepted _before_ inserting anything else into the buffer.  This should
make it much easier to fully implement [LSP text edits]. I doubt
that anyone besides kak-lsp is using the hook parameter today so this
should be a low-risk fix.

[original motivation]: https://github.com/mawww/kakoune/issues/2898
[snippets]: https://github.com/kak-lsp/kak-lsp/pull/616#discussion_r883208858
[LSP text edits]: https://github.com/kak-lsp/kak-lsp/issues/40
2022-05-29 15:24:38 +02:00
Johannes Altmanninger
6595aae23e make clean: also clean up generated version files
We also discussed using "git clean -dXf" but that could remove files
that were not generated by make.

Closes #4619
2022-05-29 10:31:59 +02:00
Johannes Altmanninger
6f28178b91 rc filetype: add trim-indent hooks to all languages that have indent hooks
An indent hook automatically adds whitespace, so it seems prudent to
add the hook to remove unwanted whitespace again. This is what we do
in most languages already.
2022-05-29 08:23:33 +02:00
Johannes Altmanninger
19806a4b4c rc coq: remove unconventional indentation
The next commit will touch this file.
2022-05-29 08:23:33 +02:00
Johannes Altmanninger
fea851b78b rc filetype: add some missing ModeChange hooks for trim-indent
Some languages have a trim-indent command but don't use it (for no
apparent reason). Make them trim trailing spaces when exiting insert
mode, like most other languages support scripts do.
2022-05-29 08:23:33 +02:00
DixiE
e1fd534637 AnthonyYoManz 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.
2022-05-27 09:02:41 +01:00
Johannes Altmanninger
b929748f8e rc filetype: fix double space in trim-indent hooks 2022-05-26 17:08:15 +02:00
Johannes Altmanninger
4c7207991a rc crystal: stop using ruby-trim-indent 2022-05-26 17:08:15 +02:00
Maxime Coste
d9ea62666b Filter out switches when completing commands
Fixes #4625
Fixes #4209
Fixes #4040
2022-05-26 19:54:09 +10:00
Maxime Coste
a63465aba8 Fix indent commands not being committed as an undo group
2edabde919 removed the
ScopedEdition that took care of committing the undo
group after indenting operations.
2022-05-26 19:54:09 +10:00
Sidharth Kshatriya
5a5fc50c12 highlighter doc: some clarificatory edits 2022-05-23 16:52:30 +05:30
Johannes Altmanninger
1529cfb2c2 Stop using deprecated std::iterator
As reported in #4615 and others, GCC 12.1 emits deprecation warnings
because we use std::iterator. Replace it with the modern equivalent.

Closes #4615
2022-05-21 15:10:03 +02:00
Maxime Coste
4c7c4a1454 Simplify Buffer::do_insert and Buffer::do_erase 2022-05-20 08:30:43 +10:00
Pound_Hash
3a661bd27c Amended grammar, punctuation, and word choice. 2022-05-17 10:39:06 -07:00
Maxime Coste
a8f289000c Merge branch 'readme' of http://github.com/Pound-Hash/kakoune 2022-05-16 19:49:22 +10:00
Maxime Coste
e570dc0a61 Merge remote-tracking branch 'sidkshatriya/ocaml-comment-convenience' 2022-05-16 19:48:02 +10:00
Maxime Coste
860be32ddd Merge branch 'command_parsing' of http://github.com/Pound-Hash/kakoune 2022-05-16 19:46:58 +10:00
Sidharth Kshatriya
70f9d8fbef OCaml: Recognize '\"' as a char literal and not the start of a string literal 2022-05-15 11:23:06 +05:30
Sidharth Kshatriya
8cfe59fcb0 OCaml: Automatically insert closing comment when user starts a comment
An OCaml comment is `(* Some comment *)`. Like the C-family this can be
a multiline comment.

Recognize when the user is trying to commence a comment when they type `(*` and
then automatically insert `*)` on behalf of the user. A small convenience.

Co-authored-by: Maxime Coste <mawww@kakoune.org>
2022-05-13 12:58:30 +05:30
Pound_Hash
a3c0665acc 1) Modified some wording to be more precise
2) Reformatted paragraphs to wrap at column 80
3) Added periods are the end of several lines for overall consistency
2022-05-10 09:53:03 -07:00
Maxime Coste
459c6f589f Merge branch 'cjs' of http://github.com/clarfonthey/kakoune 2022-05-10 22:37:43 +10:00
Maxime Coste
a28dd16b2e Merge remote-tracking branch 'adamchristiansen/gitignore-highlighting' 2022-05-10 22:36:44 +10:00
Maxime Coste
ae001a1f91 Run EventManager whenever writing to a file descriptor would block
This approach is not very elegant as it hooks into the event manager
deep inside the call graph, but solves the exiting issue and is an
okay stop gap solution until a better design comes up.

Fixes #4605
2022-05-10 22:36:13 +10:00
ltdk
fadbad51ca Mark .cjs as javascript 2022-05-09 13:20:27 -04:00
Adam Christiansen
1735aae85f Fixed extra + sign leftover from patch
An extra + sign was removed that was a remnant of a suggested
patch/diff.
2022-05-09 09:30:39 -06:00
Adam Christiansen
70013f5174 Fix gitignore highlighter glob handling
Fixes the handling of multiple backslashes before gitignore * and ?
glob patterns. Adds character classes to gitignore highlighting.

Co-authored-by: Johannes Altmanninger <aclopte@gmail.com>
2022-05-09 09:30:33 -06:00
Maxime Coste
3882b0e21b Merge branch 'gitmodules' of http://github.com/clarfonthey/kakoune 2022-05-09 20:07:47 +10:00
Maxime Coste
7f245e92fb Merge branch 'doc_doc' of http://github.com/Pound-Hash/kakoune 2022-05-09 20:04:53 +10:00
Maxime Coste
e036c4556a Merge remote-tracking branch 'c7skasku/highlight-0X' 2022-05-09 20:03:37 +10:00
Maxime Coste
34e4c53c50 Merge remote-tracking branch 'in0ni/master' 2022-05-09 20:03:02 +10:00
Johannes Altmanninger
987e367955 Work around incomplete std::to_chars() support in libstdc++ 10
Ubuntu 20.04 ships GCC's libstdc++ 10 from 2020 which implements
std::to_chars() for integers but not for floats. Use the float overload
only if the library advertises support via the feature testing macro.

This can be removed once we require GCC 11 (see
https://www.gnu.org/software/gcc/gcc-11/changes.html).

Closes #4607
2022-05-08 14:00:27 +02:00