49 Commits
Author SHA1 Message Date
Jöran Karl 2cb49c4653 buffer: Resolve symlinks in file paths
Otherwise we can't identify if we have the same file open multiple times via
different symlinks.
The test must be adapted to resolve symlinks in `findBuffer()`.
2026-04-28 19:20:51 +02:00
Jöran Karl 9a6c827880 config: Don't hardcode the fakecursor under Windows console any longer (#3959)
* config: Don't hardcode the `fakecursor` under Windows console any longer

We just set the global default and allow the user to override it.

* help: Add a concrete note for the `fakecursor` option in the Windows Console
2026-01-10 20:13:29 +01:00
Jöran Karl 02611f4ad2 backup: Keep path of stored & hashed backup files in a own $hash.path file
Since full escaped backup paths can become longer than the maximum filename size
and hashed filenames cannot be restored it is helpful to have a lookup file for
the user to resolve the hashed path.
2025-10-18 21:07:06 +02:00
Jöran Karl 1ce2202d9a util: Convert suffix added with AppendBackupSuffix() to simple constant 2025-10-18 21:06:47 +02:00
Jöran Karl 78d2c617ed util: Hash the path in DetermineEscapePath()
...in case the escaped path exceeds the file name length limit
2025-10-18 21:05:56 +02:00
deepdring b8057f28c6 refactor: use a more modern writing style to simplify code (#3834)
Signed-off-by: deepdring <[email protected]>
2025-08-26 02:00:51 +02:00
Jöran Karl 49aebe8aca save+util: Provide a meaningful error message for safe (over-)write fails 2025-02-28 18:57:53 +01:00
Jöran Karl 022ec0228a util: Provide SafeWrite() to generalize the internal file write process
SafeWrite() will create a temporary intermediate file.
2025-02-28 18:57:53 +01:00
Jöran Karl 21b7080935 util: Provide AppendBackupSuffix() for further transformations 2025-02-28 18:57:53 +01:00
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
matthias314 f5debdf8fe ignore quoted and escaped characters when splitting keybindings into actions (#3612) 2025-01-20 20:28:38 +01:00
Oleksandr Redko b881bf5606 Remove unused internal or unexported functions (#3481) 2024-11-16 21:19:37 +01:00
niten94 26ae1b95cc Move sigterm channel to internal/util 2024-06-17 18:08:18 +08:00
Massimo Mund 5dbdf8c0e8 Implemented SubWordRight, SubWordLeft, SelectSubWordRight, SelectSubWordLeft and DeleteSubWordRight, DeleteSubWordLeft 2024-05-20 23:23:33 +02:00
Massimo Mund 889a841575 Replaced IsNonAlphaNumeric() with IsNonWordChar() 2024-05-20 23:23:33 +02:00
Dmitry Maluka 104caf08dd Highlighting trailing whitespaces
Added option `hltrailingws` for highlighting trailing whitespaces
at the end of lines. Note that it behaves in a "smart" way.
It doesn't highlight newly added (transient) trailing whitespaces
that naturally occur while typing text. It would be annoying to
see transient highlighting every time we enter a space at the end
of a line while typing.
So a newly added trailing whitespace starts being highlighting
only after the cursor moves to another line. Thus the highlighting
serves its purpose: it draws our attention to annoying sloppy
forgotten trailing whitespaces.
2024-03-14 03:10:31 +01:00
Jöran Karl eedebd80d4 util: Fix opening filenames including colons with parsecursor (#3119)
The regex pattern shall search for the end of the filename first as it does
while opening with +LINE:COL.
2024-03-04 13:22:47 -08:00
Alan Hamlett 0500cc234d util.HttpRequest helper to make requests with headers (#2678) 2023-01-30 01:29:06 -08:00
Zachary Yedidia 0914f158c2 Improve comments 2021-08-21 17:58:30 -04:00
cf35b8021c Fix some quality issues (#1914)
* Add .deepsource.toml

* Fix unnecessary typecasting on `bytes.Buffer`

* Fix check for empty string

* Replace nested if block with else-if

* Replace nested if block with else-if

* Replaced string.Replace() with string.ReplaceAll where n<0

* Remove deepsource toml file

Signed-off-by: siddhant-deepsource <[email protected]>

Co-authored-by: DeepSource Bot <[email protected]>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
2021-01-09 13:39:21 -05:00
Carlos Henrique Guardão Gandarez 7a5f7e443a Make more libraries available (#1917)
* Make more libraries available to plugin dvelopment

* Add Unzip function to util
2020-11-21 01:46:17 -05:00
Zachary Yedidia f3b21362f3 Disable fake cursor for Windows Terminal
Ref #1900
2020-11-06 13:45:34 -05:00
Zachary Yedidia f5c6f66c8f Fix path escaping on Windows
Windows does not allow ':' in a path, but for some reason previous
versions still worked, except the file for storing buffer info
(which had a ':' in the name) was not viewable except by opening
it with micro.

Ref #1736
2020-06-27 17:59:28 -04:00
Philipp Emanuel Weidmann 5ce26cca71 Make determining whether a code point represents a combining mark faster (#1719) 2020-06-12 00:10:00 -04:00
Zachary Yedidia 79ee757757 Only start autocompletion for alphanumerics
Ref #1712
2020-06-08 13:54:31 -04:00
Zachary Yedidia 5c8a2332d9 Use unicode.Mark for combining unicode range 2020-05-20 18:01:10 -04:00
Zachary Yedidia ff0683d6d0 Final touches for combining character support 2020-05-20 17:00:56 -04:00
Zachary Yedidia 79c0ea17ad Use CharacterCount over RuneCount 2020-05-20 16:47:08 -04:00
Zachary Yedidia bdff221870 Use DecodeCharacter over DecodeRune 2020-05-20 16:43:12 -04:00
Zachary Yedidia ddf70953fe Support snake case autocompletion
Fixes #1655
2020-05-14 21:34:17 -04:00
Zachary Yedidia 9e8d76f2fa If stdout is a pipe, output to the pipe
If you run micro as `micro | cat` for example, micro will disallow
you from saving the file, and when you quit the buffer, the contents
will be sent to the pipe. This allows one to use micro as part of
an interactive unix pipeline.

Closes #1524
2020-02-27 12:39:19 -05:00
Zachary Yedidia d8584d1ddb Debug off using default "go build"
Ref #1469
2020-02-24 12:55:59 -05:00
Zachary Yedidia 57c34e2248 More plugin docs and improve doc formatting 2020-02-08 18:31:06 -05:00
Zachary Yedidia 35e3bddea0 Modify linter and add plugin cmd 2020-01-30 17:51:04 -05:00
Zachary Yedidia 0abe427026 Make readonly and filetype local-only 2020-01-20 22:03:32 -05:00
Zachary Yedidia 6d0128059b Finish support for a fake cursor 2020-01-01 22:40:51 -05:00
Zachary Yedidia d6dd838abd Better support for fake cursor 2020-01-01 21:29:18 -05:00
Zachary Yedidia bd0c172667 Improve mouse selection performance 2019-12-28 12:04:43 -05:00
Zachary Yedidia d29994ada9 Close file 2019-12-25 17:05:11 -05:00
Zachary Yedidia 5b18edf865 Small improvement for replace command 2019-12-25 17:05:11 -05:00
Zachary Yedidia 9eed8bc247 Remove local settings 2019-12-25 17:05:11 -05:00
Zachary Yedidia 4027081e0e Add linter plugin support 2019-12-25 17:05:10 -05:00
Zachary Yedidia e3ae38e54a Autoclose plugin support 2019-12-25 17:05:10 -05:00
Zachary Yedidia 8d85cae4c0 Add autocomplete 2019-12-25 17:05:10 -05:00
Zachary Yedidia 995e1dc704 Add tabmovement support 2019-12-25 17:05:10 -05:00
Zachary Yedidia 4497daaef1 Resolve versions in plugin manager 2019-12-25 17:05:10 -05:00
Zachary Yedidia 739dd28652 Fix test dependencies and travis build 2019-12-25 17:05:10 -05:00
Zachary Yedidia 0612af1590 Change project layout and use go.mod 2019-12-25 17:05:10 -05:00