micro/internal
Dmitry Maluka 9fabffc880
Fix issues with handling invalid regex in syntax files (#2913)
* Fix panic due to invalid regex in a syntax file

When a user's custom syntax file has a malformed filename regex or
header regex, MakeHeaderYaml() returns error but we do not properly
handle it, which results in a panic due to a dereference of the `header`
pointer which is nil:

Micro encountered an error: runtime.errorString runtime error: invalid memory address or nil pointer dereference
runtime/panic.go:221 (0x44c367)
runtime/panic.go:220 (0x44c337)
github.com/zyedidia/micro/v2/internal/buffer/buffer.go:709 (0x82bc0f)
github.com/zyedidia/micro/v2/internal/buffer/buffer.go:392 (0x828292)
github.com/zyedidia/micro/v2/internal/buffer/buffer.go:261 (0x8278c8)
github.com/zyedidia/micro/v2/cmd/micro/micro.go:203 (0x8b9e7b)
github.com/zyedidia/micro/v2/cmd/micro/micro.go:331 (0x8ba9e5)
runtime/proc.go:255 (0x4386a7)
runtime/asm_amd64.s:1581 (0x467941)

* Do not ignore invalid filename regex error in a syntax file

When the filename regex in a syntax file is malformed but the subsequent
header regex is correct, the filename regex error gets silently ignored,
since the `err` value is overwritten by the subsequent successful header
regex result.
2023-09-09 19:17:23 -07:00
..
action Add onSetActive callback (#2885) 2023-08-31 17:29:07 +01:00
buffer Fix issues with handling invalid regex in syntax files (#2913) 2023-09-09 19:17:23 -07:00
clipboard Use zyedidia/clipper for external clipboard 2022-06-14 08:40:57 -04:00
config Resolve merge conflict with scrollbarchar 2023-07-08 14:06:41 -07:00
display Add 'scrollbarchar' option (#2342) 2023-07-08 14:02:01 -07:00
info Add HistorySearchUp and HistorySearchDown actions (#1829) 2023-07-08 14:00:22 -07:00
lua chore: os.SEEK_CUR os.SEEK_END os.SEEK_SET has been deprecated since Go 1.7 (#2856) 2023-07-04 12:13:41 -07:00
screen Add fakecursor option 2023-01-26 18:02:54 -08:00
shell Fix term output capturing 2023-09-08 23:27:39 -07:00
util util.HttpRequest helper to make requests with headers (#2678) 2023-01-30 01:29:06 -08:00
views Fix unsplit crash 2020-02-08 21:06:13 -05:00