Commit Graph

3305 Commits

Author SHA1 Message Date
Jöran Karl
18a81f043c util: Generalize the file mode of 0666 with util.FileMode 2025-02-28 18:57:53 +01:00
Jöran Karl
69064cf808 util: Improve and rename EscapePath() to DetermineEscapePath()
If the new URL encoded path is found then it has precedence over the '%' escaped
path. In case none of both is found the new URL approach is used.
2025-02-28 18:57:53 +01:00
Jöran Karl
e828027cc0 clean: Remove some unneeded filepath.Join() calls 2025-02-28 18:57:53 +01:00
Jöran Karl
c2bc4688dd clean: Inform about all failed write steps 2025-02-28 18:57:53 +01:00
Jöran Karl
5aac42dbe7 bindings: Convert os.IsNotExist() into errors.Is() 2025-02-28 18:57:53 +01:00
Jöran Karl
42ae05b082 backup: Lock the buffer lines in Backup() 2025-02-28 18:57:53 +01:00
Jöran Karl
0b871e174f backup: Store the file with the endings of the buffer 2025-02-28 18:57:53 +01:00
Jöran Karl
7c659d1820 backup: Convert os.IsNotExist() into errors.Is() 2025-02-28 18:57:53 +01:00
Jöran Karl
6066c1a10e buffer: Convert os.Is() into errors.Is() 2025-02-28 18:57:53 +01:00
Jöran Karl
6bcec2100c open & write: Process regular files only 2025-02-28 18:57:53 +01:00
Jöran Karl
edc5ff75e3 save: Convert os.IsNotExist() into errors.Is() 2025-02-28 18:57:53 +01:00
Jöran Karl
3fcaf16074 actions: SaveCmd: Print the error of SaveAs to the InfoBar 2025-02-28 18:57:53 +01:00
Jöran Karl
5c21241fc4 actions: SaveAs: Print the error of os.Stat() to the InfoBar 2025-02-28 18:57:53 +01:00
Jöran Karl
272a308275 Merge pull request #3663 from niten94/sh-separate-paramexp
`sh.yaml`: Match valid parameter expansions without braces
2025-02-27 19:03:30 +01:00
Jöran Karl
c93747926d Merge pull request #3662 from JoeKar/fix/reload-settings
buffer: Fix `ReloadSettings(true)` for volatile `filetype`
2025-02-24 18:01:02 +01:00
niten94
0985d2cadd sh.yaml: Match parameter expansions with braces using \w 2025-02-23 11:39:11 +08:00
Jöran Karl
ddc6051b33 actions: Use SetOptionNative() instead of setting options directly
Setting options directly in (h.)Buf.Settings without calling SetOption() or
SetOptionNative() is generally not the best idea, since it may not
trigger the needed side effects.
In particular, after https://github.com/zyedidia/micro/pull/3343,
directly setting `diffgutter` and `ruler` causes them not being tracked as
locally overridden per buffer, so if we run the `reload` command,
it unexpectedly replaces them with the default ones.
2025-02-20 20:24:07 +01:00
Jöran Karl
2e94235905 buffer: Perform filetype callbacks on ReloadSettings()
In `ReloadSettings()` the `filetype` can change upon globbed path given by
the `settings.json` or by identifying a different `filetype` based on the
file name given or pattern present inside the file.
To prevent further recursion caused by checking the `filetype` again, its
processing stops here and isn't considered in `DoSetOptionNative()`
once again where the callbacks are usually triggered.
2025-02-20 20:24:05 +01:00
Jöran Karl
4a9058c3bd buffer: Move UpdatePathGlobLocals() before updating the filetype
Like in NewBuffer(), we need to update glob-based local settings
before updating the filetype, since the filetype itself may be among those
glob-based local settings.
2025-02-20 20:20:38 +01:00
Jöran Karl
982a4fe065 config: Prevent the update of filetype by UpdateFileTypeLocals()
This shall prevent unpredictable results caused by such a user configuration:

```
"ft:go" {
	"filetype": "c"
}
```
2025-02-20 20:18:36 +01:00
Jöran Karl
930fbea74d config: Split up InitLocalSettings() into two dedicated functions
* `UpdatePathGlobLocals()`
	* to apply the settings provided within e.g. "/etc/*": {}
* `UpdateFileTypeLocals()`
	* to apply the settings provided within e.g. "ft:shell": {}

We don't need to call `InitLocalSettings()` twice any longer.
2025-02-20 20:18:30 +01:00
Jöran Karl
00e568640c buffer: Fix ReloadSettings(true) for volatile filetype
We shall not overwrite a volatile set `filetype` provided as argument for micro:
`micro -filetype shell foo`
2025-02-17 20:30:20 +01:00
niten94
4abd966a99 sh.yaml: Match valid parameter expansions without braces
Match parameter expansions with valid name only in shell syntax file
when there are no braces.
2025-02-15 07:54:22 +08:00
matthias314
5a62a8ead4 match beginning and end of line correctly in FindNext and ReplaceRegex (#3575) 2025-02-09 15:19:43 +01:00
Jöran Karl
bf4156c490 Merge pull request #3657 from Andriamanitra/PR3656-continuation
plugin: linter: add ruff to default configuration
2025-02-08 16:19:59 +01:00
Andriamanitra
b9f1fc8da2 add missing linters to help linter 2025-02-07 23:56:25 +02:00
magneticminou
728526682e plugin: linter: add ruff to documentation 2025-02-07 14:12:29 -03:00
magneticminou
c105c940fe plugin: linter: change in ruff configuration
Use `--output-format concise` as suggested to get exact column of error

Co-authored-by: Mikko <Andriamanitra@users.noreply.github.com>
2025-02-06 19:28:47 -03:00
magneticminou
cdc9ab17f2 plugin: linter: add ruff to default configuration. 2025-02-06 17:05:04 -03:00
usfbih8u
b432bb7cfa docs: remove duplicated line (#3647) 2025-02-01 09:41:25 +01:00
Jöran Karl
e4b0ad7107 Merge pull request #3620 from JoeKar/feature/cursor-overwrite-indicator
statusline: Provide `overwrite` mode indicator
2025-01-31 17:59:36 +01:00
Jöran Karl
57a6e81ddb statusline: Provide overwrite mode indicator 2025-01-30 20:19:37 +01:00
Jöran Karl
5ee7fb6014 Merge pull request #3576 from niten94/optmd-quote-sort
`options.md`: Add, sort entries and adjust formatting
2025-01-29 17:13:53 +01:00
niten94
7aa72b6a96 Sort options in settings.go 2025-01-29 16:06:35 +08:00
Neko Box Coder
dc18642985 Add missing resize in TabMove (#3619) 2025-01-28 21:04:05 +01:00
yz778
c02036e52f Prompt to save or discard new files even with autosave enabled (#3626) 2025-01-25 20:24:31 +01:00
Neko Box Coder
698511c5b6 Fixing settings not being applied when saving as a new file (#3625) 2025-01-24 18:44:27 +01:00
Jöran Karl
c61670e86f buffer: Store the overwrite mode 2025-01-22 17:12:50 +01:00
Dmytro Maluka
6309136322 Adjust formatting of colorscheme option description 2025-01-21 17:26:42 +08:00
niten94
9e46a38536 Insert few parts in options.md in backticks 2025-01-21 17:23:44 +08:00
matthias314
f5debdf8fe ignore quoted and escaped characters when splitting keybindings into actions (#3612) 2025-01-20 20:28:38 +01:00
niten94
4377e56e7e Add, sort options in list, default JSON in options.md 2025-01-19 21:34:38 +08:00
Antoine Beaubien
9b3f7ff240 Update options.md (#3615) 2025-01-19 13:07:48 +01:00
Jöran Karl
f49487dc3a import: Use micro-editor/terminal instead of zyedidia/terminal (#3600) 2025-01-14 18:20:37 +01:00
Jöran Karl
c77ed02778 Merge pull request #3601 from JoeKar/import/go-runewidth
import: Use `mattn/go-runewidth` instead of `zyedidia/go-runewidth`
2025-01-06 07:07:41 +01:00
Jöran Karl
d9956bde38 import: Bump mattn/go-runewidth to v0.0.16 2025-01-05 13:20:53 +01:00
Jöran Karl
ab6e170ec9 import: Use mattn/go-runewidth instead of zyedidia/go-runewidth 2025-01-05 13:19:39 +01:00
Jöran Karl
4d97076479 import: Use micro-editor/go-shellquote instead of zyedidia/go-shellquote (#3596) 2025-01-05 12:19:11 +01:00
Jöran Karl
a883c14c18 Merge pull request #3595 from JoeKar/import/json5
import: Use `micro-editor/json5` instead of `zyedidia/json5`
2025-01-05 12:13:21 +01:00
Jöran Karl
ce356c7957 Build: set 1.19 as minimum supported Go version 2025-01-04 16:01:21 +01:00