1
0
Fork 0
mirror of https://github.com/vim/vim synced 2025-03-27 12:06:44 +01:00
Commit graph

29 commits

Author SHA1 Message Date
Christian Brabandt
86ef815959
patch 9.1.0377: Formatting text wrong when 'breakindent' is set
Problem:  formatting text wrong when 'breakindent' is set
          (Gary Johnson)
Solution: temporarily disable 'breakindent' option when formatting text,
          so that the breakindent is not wrongly taken into account for
          the line length

fixes: 
closes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-04-27 11:55:08 +02:00
Christian Brabandt
bba79808cb
patch 9.1.0309: crash when 'textwidth' > MAX_INT
Problem:  crash when 'textwidth' > MAX_INT (after vv9.1.0055)
          (Zoltan Balogh)
Solution: limit textwidth to MAX_INT

fixes: 
closes: 

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-04-11 22:54:44 +02:00
zeertzjq
94b7c3233e
patch 9.1.0172: More code can use ml_get_buf_len() instead of STRLEN()
Problem:  More code can use ml_get_buf_len() instead of STRLEN().
Solution: Change more STRLEN() calls to ml_get_buf_len().  Also do not
          set ml_line_textlen in ml_replace_len() if "has_props" is set,
          because "len_arg" also includes the size of text properties in
          that case. (zeertzjq)

closes: 

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-12 21:50:32 +01:00
kawaii-Code
78019df645
patch 9.1.0055: formatting long lines is slow
Problem:  formatting long lines is slow
          (kawaii-Code)
Solution: optimize gq (internal_format) for long
          lines (kawaii-Code)

Implemented two workarounds that significantly reduce
the amount of pointless calls. Ideally the algorithm
would be rewritten not to be n^2, but it's too complicated
with too many corner cases.

closes: 

Signed-off-by: kawaii-Code <nia.personal.0@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-25 21:40:05 +01:00
Sean Dewar
988f74311c
patch 9.1.0047: issues with temp curwin/buf while cmdwin is open
Problem:  Things that temporarily change/restore curwin/buf (e.g:
          win_execute, some autocmds) may break assumptions that
          curwin/buf is the cmdwin when "cmdwin_type != 0", causing
          issues.

Solution: Expose the cmdwin's real win/buf and check that instead. Also
          try to ensure these variables are NULL if "cmdwin_type == 0",
          allowing them to be used directly in most cases without
          checking cmdwin_type. (Sean Dewar)

Alternatively, we could ban win_execute in the cmdwin and audit all places that
temporarily change/restore curwin/buf, but I didn't notice any problems arising
from allowing this (standard cmdwin restrictions still apply, so things that may
actually break the cmdwin are still forbidden).

closes: 

Signed-off-by: Sean Dewar <seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-23 22:31:55 +01:00
Christian Brabandt
305127f9f2
patch 9.0.2100: CI: test_termdebug fails
Problem:  CI: test_termdebug fails
Solution: only test for a changed winlayout, if the window
          width actually changed

Also, include an unrelated comment (which doesn't warrant its own patch
number)

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-11-11 18:59:33 +01:00
Yegappan Lakshmanan
032713f829 patch 9.0.1245: code is indented more than necessary
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes )
2023-01-25 21:05:38 +00:00
zeertzjq
9cbf791995 patch 9.0.1236: code in same_leader() can be simplified
Problem:    Code in same_leader() can be simplified.
Solution:   Simplify code that is executed only once. (closes )
2023-01-23 16:57:08 +00:00
Bram Moolenaar
11977f9175 patch 9.0.1225: reading past the end of a line when formatting text
Problem:    Reading past the end of a line when formatting text.
Solution:   Check for not going over the end of the line.
2023-01-21 13:09:19 +00:00
Martin Tournoij
7904fa420e patch 9.0.0657: too many #ifdefs
Problem:    Too many #ifdefs.
Solution:   Graduate the +cmdwin feature.  Now the tiny and small builds are
            equal, drop the small build.  (Martin Tournoij, closes )
2022-10-04 16:28:45 +01:00
Bram Moolenaar
a4e0b9785e patch 9.0.0634: evaluating "expr" options has more overhead than needed
Problem:    Evaluating "expr" options has more overhead than needed.
Solution:   Use call_simple_func() for 'foldtext', 'includeexpr', 'printexpr',
            "expr" of 'spellsuggest', 'diffexpr', 'patchexpr', 'balloonexpr',
            'formatexpr', 'indentexpr' and 'charconvert'.
2022-10-01 19:43:52 +01:00
Bram Moolenaar
a4d158b3c8 patch 9.0.0206: redraw flags are not named specifically
Problem:    Redraw flags are not named specifically.
Solution:   Prefix "UPD_" to the flags, for UPDate_screen().
2022-08-14 14:17:45 +01:00
Bram Moolenaar
113d9dec99 patch 9.0.0170: various minor code formatting issues
Problem:    Various minor code formatting issues.
Solution:   Improve code formatting.
2022-08-08 15:49:18 +01:00
Bram Moolenaar
b8329db36a patch 9.0.0044: typos in comments, wrapping lines
Problem:    Typos in comments, wrapping lines.
Solution:   Adjust comments.  Wrap lines.
2022-07-06 13:31:28 +01:00
Bram Moolenaar
78d52883e1 patch 8.2.5013: after text formatting cursor may be in an invalid position
Problem:    After text formatting the cursor may be in an invalid position.
Solution:   Correct the cursor position after formatting.
2022-05-24 13:57:54 +01:00
Bram Moolenaar
7e66778815 patch 8.2.5008: when 'formatoptions' contains "/" wrongly wrapping comment
Problem:    When 'formatoptions' contains "/" wrongly wrapping a long trailing
            comment.
Solution:   Pass the OPENLINE_FORMAT flag.
2022-05-23 13:10:48 +01:00
Bram Moolenaar
8e145b8246 patch 8.2.4993: smart/C/lisp indenting is optional
Problem:    smart/C/lisp indenting is optional, which makes the code more
            complex, while it only reduces the executable size a bit.
Solution:   Graduate FEAT_CINDENT, FEAT_SMARTINDENT and FEAT_LISP.
2022-05-21 20:17:31 +01:00
Bram Moolenaar
6ed545e797 patch 8.2.4928: various white space and cosmetic mistakes
Problem:    Various white space and cosmetic mistakes.
Solution:   Change spaces to tabs, improve comments.
2022-05-09 20:09:23 +01:00
Bram Moolenaar
249591057b patch 8.2.4911: the mode #defines are not clearly named
Problem:    The mode #defines are not clearly named.
Solution:   Prepend MODE_.  Renumber them to put the mapped modes first.
2022-05-07 20:01:16 +01:00
Bram Moolenaar
48a8a83303 patch 8.2.4908: no text formatting for // comment after a statement
Problem:    No text formatting for // comment after a statement.
Solution:   format a comment when the 'c' flag is in 'formatoptions'.
2022-05-07 15:43:52 +01:00
Bram Moolenaar
3ba685eeef patch 8.2.4183: cannot use an import in 'formatexpr'
Problem:    Cannot use an import in 'formatexpr'.
Solution:   Set the script context when evaluating 'formatexpr'.
2022-01-22 19:17:31 +00:00
Bram Moolenaar
264d3ddac0 patch 8.2.3932: C line comment not formatted properly
Problem:    C line comment not formatted properly.
Solution:   If a line comment follows after "#if" the next line is not the end
            of a paragraph.
2021-12-29 14:09:32 +00:00
Dominique Pelle
af4a61a85d patch 8.2.3914: various spelling mistakes in comments
Problem:    Various spelling mistakes in comments.
Solution:   Fix the mistakes. (Dominique Pellé, closes )
2021-12-27 17:21:41 +00:00
Bram Moolenaar
6e371ecb27 patch 8.2.3787: no proper formatting of a C line comment after a statement
Problem:    No proper formatting of a C line comment after a statement.
Solution:   Find the start of the line comment, insert the comment leader and
            indent the comment properly.
2021-12-12 14:16:39 +00:00
Bram Moolenaar
ecabb51107 patch 8.2.3754: undesired changing of the indent of the first formatted line
Problem:    Undesired changing of the indent of the first formatted line.
Solution:   Do not indent the first formatted line.
2021-12-06 19:51:01 +00:00
Christian Brabandt
818ff25cd1 patch 8.2.3615: wrong indent in first line if re-formatting with indent expr
Problem:    When re-formatting with an indent expression the first line of a
            paragraph may get the wrong indent. (Martin F. Krafft)
Solution:   Apply the correct indenting function for the first line.
            (Christian Brabandt, closes , closes )
2021-11-18 13:56:37 +00:00
Bram Moolenaar
e100440158 patch 8.2.1898: command modifier parsing always uses global cmdmod
Problem:    Command modifier parsing always uses global cmdmod.
Solution:   Pass in cmdmod_T to use.  Rename struct fields consistently.
2020-10-24 20:49:43 +02:00
Bram Moolenaar
e52702f003 patch 8.2.0901: formatting CJK text isn't optimal
Problem:    Formatting CJK text isn't optimal.
Solution:   Properly break CJK lines. (closes )
2020-06-04 18:22:13 +02:00
Bram Moolenaar
11abd09521 patch 8.2.0674: some source files are too big
Problem:    Some source files are too big.
Solution:   Move text formatting functions to a new file. (Yegappan
            Lakshmanan, closes )
2020-05-01 14:26:37 +02:00