179 Commits

Author SHA1 Message Date
Kovid Goyal
c0f17c279e
Add a generic ring buffer
Go's stdlib is very anemic
2022-11-14 15:42:05 +05:30
Kovid Goyal
7264bea8c9
Fix selector incorrectly marking fd as ready on EINTR 2022-11-14 15:42:04 +05:30
Kovid Goyal
75ead358a2
Show suggestions for options based on levenshtein distance 2022-11-14 15:42:03 +05:30
Kovid Goyal
cb2389efa5
Use the standard library deque
Drops a dependency
2022-11-14 15:42:01 +05:30
Kovid Goyal
4316018966
... 2022-11-14 15:42:01 +05:30
Kovid Goyal
a0bf6177e2
Use a LRUCache rather than an Unbounded one 2022-11-14 15:42:01 +05:30
Kovid Goyal
3078b9074a
Also report submatch positions 2022-11-14 15:42:01 +05:30
Kovid Goyal
dffb87ced9
Make the cache re-useable 2022-11-14 15:42:01 +05:30
Kovid Goyal
4adea5b7fe
Make ReplaceAll re-useable 2022-11-14 15:42:01 +05:30
Kovid Goyal
ef49634353
Fix some issues reported by staticcheck 2022-11-14 15:42:01 +05:30
Kovid Goyal
b1e08adbce
Utility function to sort with key 2022-11-14 15:42:00 +05:30
Kovid Goyal
e7f38929d9
DRYer 2022-11-14 15:42:00 +05:30
Kovid Goyal
2cacd7a64a
get rid of interface{} since we now require Go 1.18 2022-11-14 15:42:00 +05:30
Kovid Goyal
a44c89504b
More convenient interface for sorting 2022-11-14 15:42:00 +05:30
Kovid Goyal
8807f6d539
Code to get exe name for usage message 2022-11-14 15:42:00 +05:30
Kovid Goyal
a3a89b3e21
More efficient multi line scanning 2022-11-14 15:42:00 +05:30
Kovid Goyal
2ddbe2a2bc
Automatically camel-case destination 2022-11-14 15:42:00 +05:30
Kovid Goyal
cbbda23e01
Utility code to find longest common prefix/suffix and to quote strings for various shells 2022-11-14 15:41:58 +05:30
Kovid Goyal
1ff4f2df4f
Refactor the CLI markup code to make it re-useable 2022-11-14 15:41:58 +05:30
Kovid Goyal
7737369fc9
Add completion for the kittens 2022-11-14 15:41:58 +05:30
Kovid Goyal
3c29ce936b
Dont recurse for file completion
We could potentially end up recursing over the entire file system. And
for completion we only present the candidates in the immediate directory
anyway.
2022-11-14 15:41:57 +05:30
Kovid Goyal
ced741b247
More corner cases 2022-11-14 15:41:57 +05:30
Kovid Goyal
3326e9ef49
Move code to walk with symlinks to the utils module 2022-11-14 15:41:57 +05:30
Kovid Goyal
3d79eb5730
more tests for indent and wrap 2022-11-14 15:41:56 +05:30
Kovid Goyal
af7f4e97cf
More work on the new formatter 2022-11-14 15:41:56 +05:30
Kovid Goyal
40a9ab8929
Allow ignoring lines containing a sentinel 2022-11-14 15:41:56 +05:30
Kovid Goyal
e433b90297
Dont drop trailing escape codes when stripping trailing whitespace 2022-11-14 15:41:56 +05:30
Kovid Goyal
1ac7d9c10d
Basic wrap is working 2022-11-14 15:41:56 +05:30
Kovid Goyal
ef5f0025e1
Start work on more sophisticated indent+wrap implementation 2022-11-14 15:41:56 +05:30
Kovid Goyal
081390b5a2
Utility functions to allow using string/[]byte interchangeably without copies 2022-11-14 15:41:55 +05:30
Kovid Goyal
61094c6bfb
Add strikethrough formatting 2022-11-14 15:41:55 +05:30
Kovid Goyal
364533b1ed
Work on supporting streaming remote commands with passwords 2022-11-14 15:41:54 +05:30
Kovid Goyal
6f4968305a
more work on porting rc command parsing to Go 2022-11-14 15:41:54 +05:30
Kovid Goyal
ef71b071db
Automap a bunch of json fields from identically named options 2022-11-14 15:41:53 +05:30
Kovid Goyal
249df69ac9
Use the new styling API for CLI infra 2022-11-14 15:41:53 +05:30
Kovid Goyal
4a4500d56b
Dont make urls part of styling, instead have a dedicated UrlFunc API
Since urls can potentially change a lot, caching them makes no sense
2022-11-14 15:41:53 +05:30
Kovid Goyal
be22f49012
Fix usage of numbered colors for underlines 2022-11-14 15:41:53 +05:30
Kovid Goyal
f9695a7947
Add url support to styling 2022-11-14 15:41:53 +05:30
Kovid Goyal
29d9b70f0c
More ansi styling tests 2022-11-14 15:41:53 +05:30
Kovid Goyal
42a8ca0842
Write some tests for the style wrapper 2022-11-14 15:41:53 +05:30
Kovid Goyal
91c61478dd
Start work on easily generating ANSI formatted strings 2022-11-14 15:41:53 +05:30
Kovid Goyal
b2e610f9b1
Implement socket I/O 2022-11-14 15:41:52 +05:30
Kovid Goyal
a960937095
Simplify serialization code and avoid extra copy 2022-11-14 15:41:52 +05:30
Kovid Goyal
1b90c03304
Refactor loop code into its own package 2022-11-14 15:41:52 +05:30
Kovid Goyal
b1f9139ca5
Use a fully random async_id rather than a uuid 2022-11-14 15:41:52 +05:30
Kovid Goyal
4a49c3940a
Switch to using goroutines rather than a select()
More complex code since now we have to synchronize between threads,
but a good way to teach myself more about goroutines.
2022-11-14 15:41:52 +05:30
Kovid Goyal
69c847a48f
Fix failing test 2022-11-14 15:41:51 +05:30
Kovid Goyal
03705cbec0
Fix transmission of async rc commands 2022-11-14 15:41:51 +05:30
Kovid Goyal
ff2ff9c04f
Port short uuid code to Go 2022-11-14 15:41:51 +05:30
Kovid Goyal
c86f8a698c
@ ls works phew 2022-11-14 15:41:51 +05:30