1
0
forked from aniani/vim

931 Commits

Author SHA1 Message Date
Aliaksei Budavei
d2f4987999
runtime(syntax-tests): Introduce self tests for screen dumping
Write a batch of test files with made-up syntax to serve for
additional linewise checks to be manually performed whenever
the algorithm for screen dump file generation is modified.

Define a shell variable VIM_SYNTAX_SELF_TESTING to run these
tests:
	cd runtime/syntax/
	VIM_SYNTAX_SELF_TESTING=1 make clean test

related: #15150

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-06 11:59:35 +02:00
Aliaksei Budavei
cc5482edb4
runtime(syntax-tests): Clear and redraw the ruler line with the shell info
The current contents of sh_01_99.dump and sh_09_99.dump
begin with ":redraw" in the ruler line whereas both the
comment and the need for the redraw command execution imply
blanks "       ".

related: #15150

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-06 11:56:56 +02:00
Aliaksei Budavei
8418446644
runtime(syntax-tests): Allow for folded and wrapped lines in syntax test files
The current implementation falls short for syntax test files
on two accounts:
1. With folded lines -- some lines before folded lines are
    unnecessarily repeated in generated dump files because
    closed folded lines are always treated as opened for the
    cursor to move _in_ instead of to move _over_ them.
2. With wrapped lines (longer than 75 columns) -- some lines
    are omitted in generated dump files because calculations
    for the cursor progress and its movement commands only
    refer to file lines and not their layout within a 20x75
    buffer (less &cmdheight).

As an alternative, we abandon deterministic (and inaccurate
at times) calculations for the cursor progress and, instead,
advance the cursor by as much as before for a single dump
file, but now rely on marking the last visible line and
additional movement to position lines at desired offsets,
carefully preserving compatibility for the &scrolloff and
&ruler values inherited from defaults.vim.  The parent Vim
process will keep track of progress through a syntax test
file made by its child process ("terminal") by reading the
rightmost end of the ruler line from the terminal buffer,
looking for " All " or " Bot " for its cue to finish dump
file generation.

With these changes applied, the lossless line length limit
will be raised from 75 to 1425 (for a 19x75 view) columns.

Also, prefer "lastline" to "truncate" for &display; hiding
the content of any last _long_ line in a view goes against
the purpose of syntax file testing -- all lines should be
recorded.

related: #15150
fixes: #14245

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-06 11:56:31 +02:00
RestorerZ
cd33faf614
patch 9.1.0527: inconsistent parameter in Makefiles for Vim executable
Problem:  inconsistent parameter in Makefiles for Vim executable
Solution: consistently use $VIMPROG across all Makefiles
          (RestorerZ)

closes: #15099

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-04 17:48:01 +02:00
Kafva
3d2a996267
runtime(dockerfile): enable spellchecking of comments in syntax script
closes: #15147

Signed-off-by: Kafva <36083692+Kafva@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-04 11:40:41 +02:00
Aliaksei Budavei
01a4fb104d
runtime(java): Compose "g:java_highlight_signature" and "g:java_highlight_functions"
With the variables defined, distinctly highlight parts of
a method declaration header: its name and parameter list
parens, from its type parameters, return type, and formal
parameters; and distinctly highlight parts of a lambda
expression: its parameter list parens and the arrow, from
its formal parameters and identifiers.

closes: #15083

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-23 10:03:33 +02:00
Doug Kearns
fc64ac0be2
runtime(vim): Update base-syntax, fix function tail comments
Match Vim9-script comments after :def and :enddef and legacy-script
comments after :func and :endfunc, in any definition context.

Highlight incorrect comment types after these commands as errors.

fixes: #15062
closes: #15072

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-22 11:20:36 +02:00
Evan Hanson
17e0a1969d
runtime(scheme): update runtime files
Add TODO highlighting, disable text-wrapping, add "define-library" to
lispwords on CHICKEN. Update MAINTAINERS.

closes: #15063

Signed-off-by: Evan Hanson <evhan@foldling.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-21 07:49:39 +02:00
Aliaksei Budavei
beb02ed674
runtime(java): Optionally highlight parameterised types
In the presence of parameterised types whose names begin
with a capital letter and end with a less-than sign "<" that
introduces a type argument or a list of comma-separated type
arguments, followed by a greater-than sign ">", a variable
"g:java_highlight_generics" can be defined to have some
components of such types uniformly coloured (by picking
highlight groups for javaGenericsC{1,2}, javaWildcardBound).

For example,
------------------------------------------------------------
java.io.InputStream stream = java.io.InputStream.nullInputStream();
java.util.function.Function<String,
    java.util.function.BiFunction<String, String, String>> updater =
	property -> (oldValue, newValue) -> oldValue;
java.util.logging.LogManager.getLogManager()
    .updateConfiguration(stream, updater);
------------------------------------------------------------

Note that the diamond form and explicit type arguments do
not qualify for this kind of recognition.

For example,
------------------------------------------------------------
new java.util.HashSet<>().<String>toArray(new String[0]);
------------------------------------------------------------

References:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-4.html#jls-4.5
https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.9
https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.12.2.1

closes: #15050

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-20 21:00:53 +02:00
Aliaksei Budavei
94c5d8a5e2
runtime(java): Remove the group exclusion list from @javaTop
Instances of anonymous classes can be passed as method
arguments and should be subject to line folding as well.

closes: #15048

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-19 20:10:47 +02:00
Maxim Kim
1ce65e35ac
runtime(csv): include a simple csv filetype and syntax plugin
fixes: #15038

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-18 19:48:15 +02:00
h-east
84ac2126f4
runtime(doc): Fix typos in several documents
closes: #15034

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-17 18:12:51 +02:00
Mohamed Akram
917ff8a19d
runtime(html): bump length of character references in syntax script (#15022)
This allows handling longer references such as
`&CounterClockwiseContourIntegral;`.

Signed-off-by: Mohamed Akram <mohd.akram@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-16 16:47:36 +02:00
Yinzuo Jiang
79da22de75
runtime(kdl): fix KdlIndent and kdlComment in indent script (#15019)
Signed-off-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-16 08:47:47 +02:00
Aliaksei Budavei
371bab0594
runtime(java): Fold multi-line comments with the syntax kind of &fdm (#15016)
Also:

- Restore the capability to mark as an error braces nested
  in parens with g:javaInParen.
- Try not to fold top-level-type bodies.  (Defining multiple
  package-private top level types in a single source file is
  not recommended as it can impose order among compilation
  units; so it is assumed that only one such top level type
  is usually defined.)
- Compose ‘method header’ highlighting and block braces
  folding.
- Do not highlight block braces whenever ‘method header’
  highlighting is requested.

This bundling of ‘method headers’ and block braces for
highlighting can be traced back to Vim v5.0; however, no
comment or documentation entry conveys any justification.
For example, it is hard to discover the connection between
block braces for "while", "if", etc., statements and method
body block braces.  The former behaviour can be attained in,
e.g. ~/.vim/after/syntax/java.vim:

------------------------------------------------------------
if exists("g:java_highlight_functions")
    syn clear javaBlock javaInParen
    syn match javaBlockOther "[{}]"
    syn region javaBlock transparent matchgroup=javaBlockStart
	\ start="\%(^\|^\S[^:]\+\)\@120<!{" end="}" fold
    hi def link javaBlockStart javaFuncDef
    hi def link javaBlockOther javaBlockStart

    if exists("g:java_mark_braces_in_parens_as_errors")
	syn match javaInParen contained "[{}]"
    endif
endif
------------------------------------------------------------

Note: Read ‘a method header omitting a _throws_ clause’ for
every ‘method header’ appellation used above.


Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-16 08:42:55 +02:00
dkearns
ae321b51f7
runtime(vim): Update base-syntax, match shebang lines (#15011)
Match shebang lines in Vim9 and legacy script.

Mark these as an error if they appear anywhere other than the first line
of a legacy-script file.  In Vim9 script these match as normal line
comments rather than an error.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-15 15:06:17 +02:00
Doug Kearns
6dd5840fdf
runtime(html): Restore HTML syntax file tests
Rendered element content results in test failures on macOS and FreeBSD.

The included content for these elements was incidental to the primary
intent of the test to check element tag highlighting so set
g:html_no_rendering to disable content rendering.

FreeBSD fails for even an empty <strike> element.

See #13591 and #14215.

closes: #13595

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-14 21:18:33 +02:00
Doug Kearns
262e25e5a1
runtime(vim): Update base-syntax, match :sleep arg
Match :sleep arg properly including a lone "m" with a leading count.

closes: #15003

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-14 20:16:35 +02:00
dkearns
a3bddb759e
runtime(vim): Update base-syntax, match :catch and :throw args (#14989)
Match :catch /{pattern}/ and :throw {expr1}.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-13 17:48:10 +02:00
Aliaksei Budavei
902b766858
runtime(java): Include element values in non-marker annotations (#14979)
Make a formal definition for normal and single-element kinds
of annotations that otherwise require for their containment
to repeat each time all syntax groups that describe element
values.

Reference:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-9.html#jls-9.7

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-13 17:30:09 +02:00
Doug Kearns
31441d509a
runtime(vim): Update g:vimsyn_comment_strings dump file tests
Leading whitespace is no longer matched as part of the line comment as
of #13936.

closes: #14971

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-12 20:44:10 +02:00
dkearns
959c3c887b
runtime(vim): Update base-syntax, configurable comment string highlighting (#14931)
Allow highlighting of strings within comments to be disabled by setting
g:vimsyn_comment_strings to false.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-11 20:18:08 +02:00
dkearns
059cbe8933
runtime(vim): Update base-syntax, match multiline continued comments (#13936)
Match multiline (continued) line comments.

Continued tail comments are not supported yet.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-11 19:27:53 +02:00
dkearns
6ea3dfe8de
runtime(vim): Remove orphaned screen dump files (#14965)
These are no longer generated by the current test input files.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-11 19:04:46 +02:00
inzuo Jiang
2d88210b3c
runtime(kdl): include syntax, indent and ftplugin files
closes: #14956

Co-authored-by: Aram Drevekenin <aram@poor.dev>
Signed-off-by: inzuo Jiang <jiangyinzuo@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-10 21:13:56 +02:00
Kentaro Hayashi
b8076f92a1
runtime(deb822sources): add missing Enabled field in syntax script
closes: #14898

It lacks the support of Enabled: boolean option field [1]:

e.g.

  Types: deb
  Uris: https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs/
  Components: main
  Suites: vscodium
  Architectures: amd64 i386 arm64 armhf
  Enabled: yes
  Signed-By: /var/lib/extrepo/keys/vscodium.asc

This patch was also forwarded to upstream. [2]

[1] https://manpages.debian.org/unstable/apt/sources.list.5.en.html#DEB822-STYLE_FORMAT
[2] https://salsa.debian.org/vim-team/vim-debian/-/merge_requests/16

Signed-off-by: Kentaro Hayashi <kenhys@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-10 18:22:31 +02:00
Aliaksei Budavei
d6b4afb636
runtime(java): Exclude lambda expressions from _when_ _switch-case_ label clauses (#14945)
These guard clauses are always boolean expressions, whereas
lambda expressions can only appear in either an assignment,
a casting, or an invocation context.

References:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-14.html#jls-14.11.1
https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.27

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-09 18:39:52 +02:00
Doug Kearns
92f4e91590
runtime(vim): Update base-syntax, allow whitespace before :substitute pattern
Allow whitespace between the :substitute command and its pattern
argument.  Although unusual, it is supported and there are examples in
the wild.

Match Vi compatible :substitute commands like :s\/{string}/.  See :help
E1270.

fixes: #14920
closes: #14923

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-05 19:47:04 +02:00
Shougo Matsushita
60c8743ab6
patch 9.1.0465: missing filecopy() function
Problem:  missing filecopy() function
Solution: implement filecopy() Vim script function
          (Shougo Matsushita)

closes: #12346

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-03 23:01:40 +02:00
Riley Bruins
0a0830624a
patch 9.1.0464: no whitespace padding in commentstring option in ftplugins
Problem:  no whitespace padding in commentstring option in ftplugins
Solution: Change default to include whitespace padding, update
          existing filetype plugins with the new default value
          (Riley Bruins)

closes: #14843

Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-03 20:40:45 +02:00
Pierrick Guillaume
280e5b13ca
patch 9.1.0453: filetype: rasi files are not recognized
Problem:  filetype: rasi files are not recognized
Solution: regonize '*.rasi' files as rasi filetype,
          include a filetype and syntax plugin
          (Pierrick Guillaume)

ported from: https://github.com/Fymyte/rasi.vim

closes: #14821

Signed-off-by: Pierrick Guillaume <pierguill@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-31 12:00:49 +02:00
Aliaksei Budavei
7129f2ad2f
runtime(java): Improve the matching of lambda expressions (#14880)
- Distinguish some formal parameters.
- Support multi-line definitions.

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-31 11:11:34 +02:00
zeertzjq
0b74eeceb8
runtime(stylus): remove remaining css code (#14866)
This seems to be a forgotten fixup in 2d919d2744 (r141568461)

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-28 07:23:41 +01:00
Christian Brabandt
393708cff6
runtime(vim): re-generate vim syntax from generator
related: #14861

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-27 15:50:07 +02:00
h_east
c984b2fd9d
runtime(vim): fix syntax vim bug (Close #14858) (#14861)
Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-27 15:40:25 +02:00
Linda_pp
86071925ed
runtime(typescriptreact): fix highlighting nested and escaped quotes in string props (#14852)
Signed-off-by: rhysd <lin90162@yahoo.co.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-26 18:22:26 +02:00
James McCoy
0076ddc07d
runtime(debian): update Debian runtime files (#14849)
* Add space in template for 'commentstring'
* Add 'comments' and 'commentstring' support to debcontrol
* debversions: Move Ubuntu releases outside of standard support to unsupported
  Although trust, xenial, and bionic are not EOL yet, their standard support period has ended.

Reported-by: Riley Bruins <ribru17@gmail.com>
Co-authored-by: Riley Bruins <ribru17@gmail.com>
Signed-off-by: James McCoy <jamessan@debian.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-25 20:56:49 +02:00
rhysd
5e45715084
runtime(typescript): update outdated syntax files
fixes: #14721
fixes: HerringtonDarkholme/yats.vim#277
closes: #14840

Signed-off-by: rhysd <lin90162@yahoo.co.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-24 19:03:03 +02:00
Josef Litoš
b1ffc52694
runtime(i3config/swayconfig): fix floating_modifier highlight (#14841)
Signed-off-by: JosefLitos <litosjos@fit.cvut.cz>
Signed-off-by: James Eapen <james.eapen@vai.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-24 17:31:36 +02:00
Amelia Clarke
35dfe58a54
patch 9.1.0442: hare runtime files outdated
Problem:  hare runtime files outdated
Solution: runtime(hare): update hare.vim to match upstream
          (Amelia Clarke)

closes: #14836

Signed-off-by: Amelia Clarke <selene@perilune.dev>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-24 08:05:00 +02:00
James Eapen
22ac941208
runtime(i3config/swayconfig): support floating_modifier none; revert broken highlighting
- fix floating_modifier $mod normal|inverse was being hightlighted as error
  reverting the floating_modifier change from dd83b63
- will currently allow invalid syntax after floating_modifier

fixes: #14826
closes: #14827

Co-authored-by: JosefLitos <litosjos@fit.cvut.cz>
Signed-off-by: James Eapen <james.eapen@vai.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-23 20:48:54 +02:00
Josef Litoš
679f5abb99
runtime(i3config/swayconfig): allow indented commands (#14757)
fixes: #14752

Co-authored-by: jamespeapen <jamespeapen@users.noreply.github.com>
Signed-off-by: Josef Litoš <54900518+JosefLitos@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-13 22:03:42 +02:00
Aliaksei Budavei
2f5ff73827
runtime(syntax-tests): Filter out non-Latin-1 characters for syntax tests (#14767)
Syntax tests are run with the LC_ALL=C environment variable
passed to "make".  Occasionally, there are CI failures for
such test files containing non-Latin-1 characters with error
messages pointing to multi-byte characters:

https://github.com/vim/vim/actions/runs/8824925004/job/24228298023#step:10:16370 ,
https://github.com/vim/vim/actions/runs/8840856619/job/24276935260#step:10:16347 ,
https://github.com/vim/vim/actions/runs/8854043458/job/24316210645#step:10:16362 ,
https://github.com/vim/vim/actions/runs/8856501136/job/24322848765#step:10:16354 ,
https://github.com/vim/vim/actions/runs/9038417238/job/24839482152#step:11:16980 .

But since the very same unchanged tests pass at other times:

https://github.com/vim/vim/actions/runs/8827593571/job/24235935458#step:10:16353 ,
https://github.com/vim/vim/actions/runs/9065214647/job/24905321661#step:11:17002 ;

these failures are unrelated to the nature of syntax tests
and should be considered false positives.

As a temporary workaround, all bytes of known non-Latin-1
characters can be replaced in memory with an arbitrary ASCII
byte (?) by applying a filter

> " To ignore part of the dump, provide a "dumps/{filename}.vim" file with
> " Vim commands to be applied to both the reference and the current dump, so
> " that parts that are irrelevant are not used for the comparison.  The result
> " is NOT written, thus "term_dumpdiff()" shows the difference anyway.

before lines are compared between files.


Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-13 21:06:05 +02:00
Aliaksei Budavei
d3952e8cfe
runtime(java): Strive to remain compatible for at least Vim 7.0 (#14744)
Also:

- Limit all look-behind regexp patterns.
- Cache regexp capabilities for [:upper:] and [:lower:].

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-10 23:39:31 +02:00
Aliaksei Budavei
06bdac1580
runtime(java): Stop handpicking syntax groups for @javaTop (#14727)
* runtime(java): Stop handpicking syntax groups for @javaTop

Also:

- Remove the obsolete comment for g:java_allow_cpp_keywords.
- Remove the commented out groups java\%[Debug\]StringError.
- Infer and set the preferred formatting Vim options from
  the modeline.

Since vim-6-0u, non-contained syntax groups can be referred
to by using the "contains=TOP..." argument.

* Set &encoding and &termencoding to "utf-8" for test files

* Limit non-ASCII charset to [§ƒɐɘʬʭΑ-Τα-μ] for test files

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-10 14:49:06 +02:00
Maxwell G
cb3691811b
runtime(spec): add new items to scripts section in syntax plugin
- %generate_buildrequires — added in RPM 4.15
- %conf — added in RPM 4.18

closes: #14723

Ref: https://rpm-software-management.github.io/rpm/manual/spec.html#build-scriptlets

Signed-off-by: author
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-08 20:28:51 +02:00
Gregory Anders
6a4ea471d2
patch 9.1.0396: filetype: jj files are not recognized
Problem:  jj files are not recognized
Solution: recognize '*.jjdescription' files as jj filetype
          (Gregory Anders)

See: https://github.com/martinvonz/jj

closes: #14733

Signed-off-by: Gregory Anders <greg@gpanders.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-08 20:17:43 +02:00
Wu Yongwei
c5def6561d
runtime(cpp): Fix digit separator in syntax script for octals and floats
Also fix the incorrect rendering of floats that start with ".".

closes: #14724

Signed-off-by: Wu Yongwei <wuyongwei@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-07 18:33:30 +02:00
Philip H
2d919d2744
patch 9.1.0386: filetype: stylus files not recognized
Problem:  filetype: stylus files not recognized
Solution: Detect '*.styl' and '*.stylus' as stylus filetype,
          include indent, filetype and syntax plugin
          (Philip H)

closes: #14656

Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-01 18:42:11 +02:00
Aliaksei Budavei
c4d0c8c812
runtime(java): Improve the recognition of the "indent" method declarations (#14659)
There is a flaw in the current implementation that has been
exacerbated around v5.2.  It lies in the recognition of all
three indentation styles simultaneously: a tab, two space,
and eight space character(s).  With it, it is not uncommon
to misidentify various constructs as method declarations
when they belong to two-space indented members and other
blocks of a type and are offset at eight space characters or
a tab from the start of the line.

For example,

------------------------------------------------------------
class Test
{
  static String hello() { return "hello"; }

  public static void main(String[] args)
  {
    try {
      if (args.length > 0) {
        // FIXME: eight spaces.
        System.out.println(args[0]);
      } else {
        // FIXME: a tab.
	System.out.println(hello());
      }
    } catch (Exception e) {
      throw new Error(e);
    }
  }
}
------------------------------------------------------------

------------------------------------------------------------
:let g:java_highlight_functions = 'indent'
:doautocmd Syntax
------------------------------------------------------------

A better approach is to pick an only indentation style out
of all supported styles (so either two spaces _or_ eight
spaces _or_ a tab).  Note that tabs and spaces can still be
mixed, only the leading tab or the leading run of spaces
matters for the recognition.  And there is no reason to not
complement the set of valid styles with any number of spaces
from 1 to 8, inclusively.

Please proceed with the necessary change as follows:

- rename from "indent" to "indent2" for a 2-space run;
- rename from "indent" to "indent8" for an 8-space run;
- continue to have "indent" for a tab run;
- define an "indent" variable with a suffix number denoting
  the preferred amount of indentation for any other run of
  spaces [1-8].

As before, this alternative style of recognition of method
declarations still does not prescribe naming conventions and
still cannot recognise method declarations in nested types
that are conventionally indented.

The proposed changes also follow suit of "style" in stopping
the claiming of constructor and enum constant declarations.


Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-04-29 20:24:35 +02:00