Commit Graph

142 Commits

Author SHA1 Message Date
Gokcehan
f672a71f3d fix confusion of 8-bit color codes and attributes 2018-05-06 18:45:18 +03:00
Gokcehan
7543b2256c add support for alt keys
Related #67
2018-05-05 16:27:32 +03:00
Gokcehan
d267bc70d4 null check directory preview before sort 2018-04-20 22:19:37 +03:00
Gokcehan
09b1daaade sort directory preview when options are changed 2018-04-18 21:57:41 +03:00
Gokcehan
8eb9055622 add 'drawbox' option to draw box around windows 2018-04-15 19:26:51 +03:00
Gokcehan
d608eb4a56 handle resize events properly 2018-04-15 18:18:39 +03:00
Gokcehan
ad4fc51805 add tilde to filename if shortened 2018-04-14 23:16:31 +03:00
Gokcehan
5a9a829252 handle 256 colors in $LS_COLORS
Related #37
2018-04-14 21:18:39 +03:00
M1rt
f92e0f53a5 LSCOLORS & LS_COLORS support (#96)
* LSCOLORS & LS_COLORS support

* Renamed lsColors to gColors

* Fixed gOptWords & setExpr.eval()
2018-04-14 14:58:29 +03:00
Gokcehan
54dbf5cbe4 use 'redraw' for resize event 2018-04-12 22:56:09 +03:00
Gokcehan
c1fc79b6ae replace 'redraw' commands with 'draw' 2018-04-12 21:54:40 +03:00
Gokcehan
68a23a10e1 show command counts in the ruler
Related #66
2018-04-12 19:14:50 +03:00
Gokcehan
03619c3cbb handle command counts efficiently
Related #66
2018-04-12 18:04:37 +03:00
Gokcehan
847c46421c fix race while drawing ui in 'shell-pipe' 2018-04-05 23:06:52 +03:00
Gokcehan
c63c8f63ac pipe stdin for 'shell-pipe' commands 2018-04-03 22:22:58 +03:00
Gokcehan
33fb6f0d47 process ansi codes also out of screen 2018-03-22 18:07:17 +03:00
Gokcehan
6e869bfa0e cleanup 2018-03-22 17:54:24 +03:00
Gokcehan
61c8b588cd add promptfmt option to configure prompt line
Related #50
2018-02-22 18:18:30 +03:00
Gokcehan
ae779ae25d show current file name in the prompt
Related #50
2018-02-10 20:56:59 +03:00
Gokcehan
9fb16f78e0 use fixed sized lengths for dircounts
Related #19
2018-02-10 19:37:37 +03:00
Gokcehan
55ef28b4c7 cache file previews in memory
Related #5 and #92
2018-02-10 18:59:19 +03:00
Gokcehan
80f43fe39c preview files asynchronously
Mentioned in #5 and #92.
2018-01-28 20:13:28 +03:00
Gokcehan
58538c8020 add a ruler to statline to show current position 2018-01-11 20:48:03 +03:00
Gokcehan
fd3a983b29 clear keybind list when not found 2018-01-11 19:44:02 +03:00
Gokcehan
2b4c0f913b load directories asynchronously
Mentioned in #92.
2018-01-11 19:25:48 +03:00
Chris Howey
ec8e75ba30 make terminal 256 color output the default (#93)
this will allow terminals that support 256 color ansi codes to have
preview applications use 256 colors
2018-01-01 01:10:00 +03:00
Gokcehan
946de57f26 keep ansi attributes at next line 2017-11-22 17:17:23 +03:00
Gokcehan
ba0a9005b1 prevent ansi code zero error 2017-11-20 18:46:00 +03:00
Gokcehan
9b7bf63096 cleanup 2017-11-19 21:55:13 +03:00
Gokcehan
1a39b00a8f replace renew with redraw while reading commands
Mentioned in #92.
2017-11-19 02:39:42 +03:00
Gokcehan
9ac32fc850 cache directory contents in memory
Mentioned in #92.
2017-11-19 01:25:41 +03:00
Gokcehan
cb577a4c3a handle user variables on all platforms 2017-08-06 11:05:46 +03:00
Gokcehan
458bc71688 use conditional compilation for windows 2017-08-05 19:23:55 +03:00
Karol Woźniak
fe05105c88 Implement directory count info (#85) 2017-06-03 14:12:43 +03:00
Gokcehan
3fd1222e4f implement cmap for command line mapping 2017-03-10 18:53:21 +03:00
Gokcehan
c55c4bf254 rename showinfo option to info
Related to #39.
2017-02-04 21:33:36 +03:00
Gokcehan
d605781d09 modify showinfo to handle multiple values
Mentioned in #39.
2017-02-04 21:28:03 +03:00
Gokcehan
a99601668a disable buggy cursor move in windows 2017-01-07 18:02:14 +03:00
Olivier Perret
a704248696 preserve mark order in f[sx] variables (#59)
* preserve mark order in f[sx] variables

* Revert "preserve mark order in f[sx] variables"

This reverts commit e02c5e8bb3ec58f7cefafc92419f14c51e6730ef.

* preserve mark order in f[sx], but more efficiently
credit to @gokcehan for the idea
2017-01-06 00:23:22 +03:00
Gokcehan
af113e71ef fill with spaces instead of null chars 2016-12-22 22:58:55 +03:00
Gokcehan
4f9515564d use fixed length file sizes for info line
Mentioned in #49.
2016-12-19 22:08:53 +03:00
Gokcehan
2085b6d797 handle ratios change at runtime 2016-12-18 22:38:28 +03:00
Gokcehan
d6bb811eef cleanup 2016-12-18 21:51:27 +03:00
Gokcehan
a717c31ca1 cleanup 2016-12-18 21:34:41 +03:00
Gokcehan
e532db082f use lowercase initials for type names 2016-12-18 00:47:37 +03:00
Gokcehan
8d42bb166b increase lookahead length for ansi codes
Mentioned in #52.
2016-12-17 15:27:27 +03:00
Gokcehan
18bf206e8c handle empty folders properly while drawing the ui 2016-12-15 16:43:29 +03:00
Gokcehan
5f87cb2542 implement asynchronous read commands
This commit changes previous reading command implementation to an
asynchronous implementation. By the nature of this change, this commit
touches many places in the ui and evaluator. Aim is to fix the following
problems:

- There is no race condition anymore when reading commands and other
commands update the ui at the same time.

- Autocompletion and keymenu is now drawn in the main draw event. This
should fix some ui glitches when a new menu is smaller than the previous
one.

- Window resize event when reading a command is now properly handled.

- Readline actions are now regular commands. This should make it
possible to change the default keybindings for these actions in the
future.

Mentioned in #36.
2016-12-15 12:26:06 +03:00
Gokcehan
f66a4a4a2e don't override error messages in statusline 2016-12-03 01:05:49 +03:00
Gokcehan
217d89ff96 handle unusual escape codes in files 2016-11-29 17:01:33 +03:00
Gokcehan
c8202bbc7a add timefmt option for time format in status line
Mentioned in #41.
2016-11-21 23:13:33 +03:00
Gokcehan
697a05cdd0 handle unicode in the prompt
Mentioned in #30.
2016-11-18 22:28:55 +03:00
Gokcehan
724422efa3 keep a copy of saved files and show in the ui
Mentioned in #13 and #36.
2016-11-07 23:32:19 +03:00
Gokcehan
6008bef959 move readExpr from ui to app 2016-11-06 23:10:42 +03:00
Gokcehan
84d066050c cleanup 2016-11-06 22:59:42 +03:00
Gokcehan
4fff4f97e2 remove redundant flush from ui.renew 2016-11-06 22:51:54 +03:00
Gokcehan
e753b5b159 evaluate push command while reading 2016-10-31 11:52:32 +03:00
Ivan Menshykov
ca090fd144 Shadowing variable (#40) 2016-10-30 23:45:11 +03:00
Gokcehan
2f574962bc implement remote ping command 2016-10-30 02:20:35 +03:00
Karol Woźniak
c9b4389c65 Refactor Nav API around symlinks handling (mostly) (#33)
* gofmt ui.go

* Refactor Nav API around symlinks handling (mostly)

1. Get both `Lstat` and `Stat` while reading the files. Stat info is
   used by default, but we still can tell it's a link if needed.
2. Remove all other `Stat` calls from different places.
3. Handle hidden files while reading.
4. `currFile` now returns error if there are no files.
5. `currEmpty` and `currPath` not longer necessary, removed.
6. `open` now returns a named error ErrNotDir, where expected.

7. Side effect: Links that point at directories are now sorted among
   "actual" directories.
2016-10-24 22:18:31 +03:00
Gokcehan
667253906b handle unicode in the ui
Mentioned in #30 and #32.
2016-10-20 23:45:06 +03:00
Gokcehan
936b1e049a leave the cursor at the beginning of the current file
Mentioned in #22.
2016-10-08 14:18:26 +03:00
Gokcehan
1cee8b9d9c handle symbolic links to directories for previews
Mentioned in #24 and #25.
2016-10-05 18:36:12 +03:00
Gokcehan
d66eb7349d clean path before changing directory 2016-10-02 00:39:03 +03:00
Gokcehan
7fe72c188f check null bytes instead to detect binaries 2016-10-02 00:29:14 +03:00
Gokcehan
27135faccd add a push command to simulate key pushes 2016-09-18 19:21:24 +03:00
Gokcehan
1e7811334e use the same goroutine to wait preview command
Mentioned in #5.
2016-09-18 12:56:13 +03:00
Gokcehan
d51e99adc1 close pipe and then wait command in a separate goroutine
Mentioned in #5.
2016-09-16 15:22:39 +03:00
Gokcehan
f82073603f clean command resources after preview script call
Mentioned in #5.
2016-09-16 13:27:38 +03:00
Gokcehan
0395f75ea9 break previewer output pipe when enough lines are read
Mentioned in #5.
2016-09-15 21:26:54 +03:00
Gokcehan
6094078185 buffer file and dir previews for drawing
Mentioned in #5.
2016-09-15 16:28:36 +03:00
Gokcehan
ee0f931db8 add command counts 2016-09-09 01:03:25 +03:00
Gokcehan
34c58b634a add basic readline shortcuts 2016-09-07 22:34:29 +03:00
Gokcehan
3d493e8271 use filepath module instead of path for portability
This should fix path separator confusion in windows.

Mentioned in #12.
2016-09-07 00:27:55 +03:00
KenjiTakahashi
ef340a533d Do binary check after calling previewer
Many files valid for previewer, such as archives, are treated as binary
and thus were not passed to the previewer.

Also sanitizes the previewer output, to some extent.
2016-09-01 21:11:03 +02:00
KenjiTakahashi
8d4a3192f1 Pass width and height to the previewer
This way, the script can do a little magic like

 head -n $2 $1 | highlight -O ansi --syntax ${1##*.}

to avoid reading whole (possibly huge) file.
2016-09-01 00:19:08 +02:00
Gokcehan
f356e6d694 handle all keys for mappings
Mentioned in #1.
2016-08-28 18:21:42 +03:00
Gokcehan
c19d3450a2 add an option to filter file content for preview
Mentioned in #5.
2016-08-28 15:04:57 +03:00
Gokcehan
e944639acf evaluate ansi escape codes while printing
Mentioned in #5.
2016-08-28 03:45:05 +03:00
Gokcehan
df6c23769f close termbox during skipping commands
Mentioned in #8.
2016-08-27 00:20:08 +03:00
Gokcehan
b90bd273f7 sort key bindings before listing
Mentioned in #1.
2016-08-24 13:08:49 +03:00
Gokcehan
fb26551693 rename redraw to renew 2016-08-24 12:36:52 +03:00
Gokcehan
19561f6531 show completion menu for multiple match 2016-08-21 18:41:03 +03:00
Gokcehan
66ce56eb6e get rid of residual escape codes after skipping shell commands
Some applications (e.g. vim) seem to leave behind escape codes in the
terminal after quitting. For some terminals (including xterm and
gnome-terminal) this is somehow interpreted as key strokes by lf. This
is a temporary fix to get rid of these escape codes by restarting
termbox until we can find a proper way to handle this.
2016-08-21 14:15:19 +03:00
Gokcehan
4b0a6d1013 cleanup 2016-08-17 23:28:42 +03:00
Gokcehan
70f8c1331d error context for nav and ui 2016-08-17 23:22:11 +03:00
Gokcehan
98839a42f2 basic shell completion for single match 2016-08-16 22:31:17 +03:00
Gokcehan
656a9c837a basic command completion for single match 2016-08-15 23:29:37 +03:00
Gokcehan
6a2bdf472b handle dir symlinks in preview and open 2016-08-14 15:15:54 +03:00
Gokcehan
84cf8e12c3 add cursor key bindings 2016-08-13 21:37:09 +03:00
Gokcehan
bdee73bc54 add error message for unhandled keys 2016-08-13 21:26:36 +03:00
Gokcehan
4b266c97e9 initial commit 2016-08-13 15:49:04 +03:00