]> Sergey Matveev's repositories - nnn.git/log
nnn.git
7 years agoUpdate README
Arun Prakash Jana [Thu, 21 Dec 2017 19:52:08 +0000 (01:22 +0530)]
Update README

7 years agoReplace xstricmp() with strcoll()
Arun Prakash Jana [Thu, 21 Dec 2017 19:49:32 +0000 (01:19 +0530)]
Replace xstricmp() with strcoll()

7 years agoRemove redundant variable
Arun Prakash Jana [Thu, 21 Dec 2017 19:28:02 +0000 (00:58 +0530)]
Remove redundant variable

7 years agoConsider only symbolic or only nunmeric names
Arun Prakash Jana [Thu, 21 Dec 2017 19:26:15 +0000 (00:56 +0530)]
Consider only symbolic or only nunmeric names

7 years agoNo need to test end of numeric
Arun Prakash Jana [Thu, 21 Dec 2017 13:42:12 +0000 (19:12 +0530)]
No need to test end of numeric

7 years agoIgnore punctuation marks in file name compare. Fix xstrcmp().
Arun Prakash Jana [Thu, 21 Dec 2017 12:19:31 +0000 (17:49 +0530)]
Ignore punctuation marks in file name compare. Fix xstrcmp().

1. File name comparison method:
 - initially ignore white space and punctuation characters
 - run test for numeric values
 - if the remaining substrings match in case-insensitive compare, compare case
 - if they still match, see which one has more prefix symbols
 - if they still match, run a case-sensitive compare on complete strings

2. Fixed xstrcmp() to return diff instead of 0 and -1.

7 years agoUpdate README, performance numbers
Arun Prakash Jana [Wed, 20 Dec 2017 22:31:21 +0000 (04:01 +0530)]
Update README, performance numbers

7 years agoAdd file name len to entry structure
Arun Prakash Jana [Wed, 20 Dec 2017 16:50:28 +0000 (22:20 +0530)]
Add file name len to entry structure

7 years agoOffset can be derived
Arun Prakash Jana [Wed, 20 Dec 2017 02:48:37 +0000 (08:18 +0530)]
Offset can be derived

7 years agoRetire redundant variable
Arun Prakash Jana [Tue, 19 Dec 2017 19:12:11 +0000 (00:42 +0530)]
Retire redundant variable

7 years agoA fancier func to get order of 2
Arun Prakash Jana [Tue, 19 Dec 2017 18:31:32 +0000 (00:01 +0530)]
A fancier func to get order of 2

7 years agoReplace a large buf with global g_buf
Arun Prakash Jana [Tue, 19 Dec 2017 18:03:27 +0000 (23:33 +0530)]
Replace a large buf with global g_buf

7 years agoFix #50: use -O3, disable -ftree-loop-vectorize
Arun Prakash Jana [Tue, 19 Dec 2017 17:13:49 +0000 (22:43 +0530)]
Fix #50: use -O3, disable -ftree-loop-vectorize

7 years agoLink to performance factors
Arun Prakash Jana [Tue, 19 Dec 2017 15:19:54 +0000 (20:49 +0530)]
Link to performance factors

7 years agoUse exact number of bytes for each filename.
Arun Prakash Jana [Mon, 18 Dec 2017 19:46:03 +0000 (01:16 +0530)]
Use exact number of bytes for each filename.

Results in even less memory usage. The names are appended one after another.
The offsets are reset when the location of the memory changes die to realloc().

Other changes:

1. Use a debug mode print to measure time.
2. Remove redundant prefix when printing pointers in debug mode.

7 years agoFix #64: change printf() to printw()
Arun Prakash Jana [Sun, 17 Dec 2017 19:00:48 +0000 (00:30 +0530)]
Fix #64: change printf() to printw()

7 years agoNAME_MAX does not include NULL char
Arun Prakash Jana [Sun, 17 Dec 2017 18:30:08 +0000 (00:00 +0530)]
NAME_MAX does not include NULL char

7 years agoRemove -O2 from debug build
Arun Prakash Jana [Sun, 17 Dec 2017 18:06:26 +0000 (23:36 +0530)]
Remove -O2 from debug build

7 years agoAn even faster nnn - no more copying file names!
Arun Prakash Jana [Sun, 17 Dec 2017 17:38:55 +0000 (23:08 +0530)]
An even faster nnn - no more copying file names!

nnn has been using `struct entry` to hold both file name as well as file info.

The design forces file names to be copied in the following cases:

 - swaps during file sort (nnn uses quicksort) applied after all the matching
   files are read (in no particular order; good old readdir()) into memory.
 - swaps during manual filtering. nnn moves non-matching entries below so they
   are not encountered twice resulting in fast filtering.

There were scopes for _massive_ improvements in this area. So I did what had to
be done - decouple the file names from `struct entry` and use a separate struct
to hold the names with the indices set when the files are added by opendir().

There was a hidden problem to this approach - nnn uses realloc() to allocate
memory for file information and realloc() may move the original pointer in mem
when it can't fit the new memory to the earlier pointer. To handle that the new
algorithm tracks the change in memory location and re-adjusts the existing dir
entry names when that happens; this too, without any copying!

Though the results seem pretty clean from a theoretical point of view and early
tests, we may uncover some bugs. However, the speed is just mind-blowing!

And the binary size remains the same too!!!

7 years agoAdd Slackware as packager
Arun Prakash Jana [Sat, 16 Dec 2017 17:30:23 +0000 (23:00 +0530)]
Add Slackware as packager

7 years agoFix indentation
Arun Prakash Jana [Thu, 14 Dec 2017 13:42:14 +0000 (19:12 +0530)]
Fix indentation

7 years agoUse static vars in frequently used APIs
Arun Prakash Jana [Tue, 12 Dec 2017 21:11:30 +0000 (02:41 +0530)]
Use static vars in frequently used APIs

7 years agoRetire redundant tmp vars
Arun Prakash Jana [Tue, 12 Dec 2017 21:02:45 +0000 (02:32 +0530)]
Retire redundant tmp vars

7 years agoProcess keypress by probable frequency
Arun Prakash Jana [Tue, 12 Dec 2017 20:16:50 +0000 (01:46 +0530)]
Process keypress by probable frequency

7 years agoUpdate README
Arun Prakash Jana [Sat, 9 Dec 2017 06:34:32 +0000 (12:04 +0530)]
Update README

7 years agoMinor optimization, refactor
Arun Prakash Jana [Mon, 4 Dec 2017 14:22:35 +0000 (19:52 +0530)]
Minor optimization, refactor

7 years agoFix -Os compilation warnings
Arun Prakash Jana [Sun, 3 Dec 2017 12:06:00 +0000 (17:36 +0530)]
Fix -Os compilation warnings

7 years agoswitch to formulae.brew.sh for Homebrew link
Arun Prakash Jana [Sat, 2 Dec 2017 16:59:43 +0000 (22:29 +0530)]
switch to formulae.brew.sh for Homebrew link

7 years agoUse the same o/p filename in debug mode
Arun Prakash Jana [Thu, 30 Nov 2017 16:12:17 +0000 (21:42 +0530)]
Use the same o/p filename in debug mode

7 years agoFix #50: revert to -O2 optimization
Arun Prakash Jana [Thu, 30 Nov 2017 16:10:52 +0000 (21:40 +0530)]
Fix #50: revert to -O2 optimization

The while loop in xstrlcpy() breaks when -O3 is used.

7 years agoMinor changes
Arun Prakash Jana [Thu, 30 Nov 2017 12:54:06 +0000 (18:24 +0530)]
Minor changes

7 years agoAdd Source Mage package
Vlad Glagolev [Sat, 25 Nov 2017 13:03:04 +0000 (08:03 -0500)]
Add Source Mage package

7 years agoUpdate package maintainers
Arun Prakash Jana [Fri, 24 Nov 2017 23:18:32 +0000 (04:48 +0530)]
Update package maintainers

7 years agoChange button color
Arun Prakash Jana [Fri, 17 Nov 2017 15:43:40 +0000 (21:13 +0530)]
Change button color

7 years agoAdd Void Linux as a package source
Arun Prakash Jana [Mon, 6 Nov 2017 04:50:23 +0000 (10:20 +0530)]
Add Void Linux as a package source

7 years agoUpdate readme
Arun Prakash Jana [Sat, 4 Nov 2017 04:50:39 +0000 (10:20 +0530)]
Update readme

7 years agoAdd how-to on hot plugged devices
Arun Prakash Jana [Wed, 18 Oct 2017 01:04:32 +0000 (06:34 +0530)]
Add how-to on hot plugged devices

7 years agoMinor maintenance
Arun Prakash Jana [Sun, 15 Oct 2017 23:54:56 +0000 (05:24 +0530)]
Minor maintenance

7 years agoAdd copier script
Arun Prakash Jana [Tue, 10 Oct 2017 14:59:48 +0000 (20:29 +0530)]
Add copier script

7 years agoIgnore TAB in input prompt
Arun Prakash Jana [Mon, 9 Oct 2017 17:25:44 +0000 (22:55 +0530)]
Ignore TAB in input prompt

7 years agoFix a couple of warnings on BSDs (#54)
Vlad Glagolev [Mon, 9 Oct 2017 02:17:02 +0000 (22:17 -0400)]
Fix a couple of warnings on BSDs (#54)

7 years agoarchive listing is done using atool
Arun Prakash Jana [Sun, 8 Oct 2017 21:26:25 +0000 (02:56 +0530)]
archive listing is done using atool

7 years agoFix segfault when SHLVL env var is not available (#52)
Vlad Glagolev [Sun, 8 Oct 2017 04:02:29 +0000 (00:02 -0400)]
Fix segfault when SHLVL env var is not available (#52)

7 years agoCorrect name checking for NEW and RENAME (#53)
Vlad Glagolev [Sun, 8 Oct 2017 03:47:32 +0000 (23:47 -0400)]
Correct name checking for NEW and RENAME (#53)

7 years agoAdd ExifTool URL (#51)
Vlad Glagolev [Sun, 8 Oct 2017 01:43:18 +0000 (21:43 -0400)]
Add ExifTool URL (#51)

7 years agoOpenBSD compatibility support (#48)
Vlad Glagolev [Sun, 8 Oct 2017 01:42:12 +0000 (21:42 -0400)]
OpenBSD compatibility support (#48)

* Improve compatibility with OpenBSD

* Fix indefinite blocking

7 years agoinclude sys/types.h for non-glibc linux builds (#46)
maxice8 [Thu, 5 Oct 2017 07:34:18 +0000 (04:34 -0300)]
include sys/types.h for non-glibc linux builds (#46)

7 years agoUse sudo to install packagecore v1.5
Arun Prakash Jana [Thu, 5 Oct 2017 01:51:12 +0000 (07:21 +0530)]
Use sudo to install packagecore

7 years agoPrepare for release v1.5
Arun Prakash Jana [Wed, 4 Oct 2017 18:26:59 +0000 (23:56 +0530)]
Prepare for release v1.5

7 years agoUpdate help
Arun Prakash Jana [Mon, 2 Oct 2017 17:33:45 +0000 (23:03 +0530)]
Update help

7 years agoFix alignment in examples
Arun Prakash Jana [Mon, 2 Oct 2017 02:43:36 +0000 (08:13 +0530)]
Fix alignment in examples

7 years agoRemove redundant conversion
Arun Prakash Jana [Sun, 1 Oct 2017 13:29:43 +0000 (18:59 +0530)]
Remove redundant conversion

7 years agoDisable noti subscription for the same dir
Arun Prakash Jana [Sun, 1 Oct 2017 10:43:35 +0000 (16:13 +0530)]
Disable noti subscription for the same dir

7 years agoChange archive list shortcut to 'F'
Arun Prakash Jana [Sat, 30 Sep 2017 22:58:48 +0000 (04:28 +0530)]
Change archive list shortcut to 'F'

7 years agoFix #44: document PAGER usage in certain screens
Arun Prakash Jana [Sat, 30 Sep 2017 00:17:38 +0000 (05:47 +0530)]
Fix #44: document PAGER usage in certain screens

7 years agoEnable O3 optimization
Arun Prakash Jana [Wed, 27 Sep 2017 17:18:46 +0000 (22:48 +0530)]
Enable O3 optimization

7 years agoRevert "Archive handling on OS X using unar+lsar"
Arun Prakash Jana [Wed, 27 Sep 2017 16:37:04 +0000 (22:07 +0530)]
Revert "Archive handling on OS X using unar+lsar"

This reverts commit 1e859eb1370bd67cecd06b7bc8c6f885b80554bd.
We will use atool on OS X as well, it can be brewed easily.

7 years agoArchive handling on OS X using unar+lsar
Arun Prakash Jana [Wed, 27 Sep 2017 16:26:02 +0000 (21:56 +0530)]
Archive handling on OS X using unar+lsar

7 years agoSupport archive listing and extraction
Arun Prakash Jana [Wed, 27 Sep 2017 14:49:42 +0000 (20:19 +0530)]
Support archive listing and extraction

7 years agoShow current entry number in du mode
Arun Prakash Jana [Wed, 27 Sep 2017 12:07:36 +0000 (17:37 +0530)]
Show current entry number in du mode

7 years agoShow current entry number.
Arun Prakash Jana [Tue, 26 Sep 2017 20:38:58 +0000 (02:08 +0530)]
Show current entry number.

...because you need to know where you are.

7 years agoFix #42
Arun Prakash Jana [Sun, 24 Sep 2017 17:58:27 +0000 (23:28 +0530)]
Fix #42

7 years agoAdd badge to PPA for Ubuntu variants
Arun Prakash Jana [Sat, 23 Sep 2017 17:32:35 +0000 (23:02 +0530)]
Add badge to PPA for Ubuntu variants

7 years agonnn is on Ubuntu 17.10
Arun Prakash Jana [Sat, 23 Sep 2017 14:08:56 +0000 (19:38 +0530)]
nnn is on Ubuntu 17.10

7 years agoAdd step to set NNN_NOWAIT in Quickstart
Arun Prakash Jana [Wed, 20 Sep 2017 03:08:55 +0000 (08:38 +0530)]
Add step to set NNN_NOWAIT in Quickstart

7 years agoUpdate NNN_NOWAIT changes
Arun Prakash Jana [Tue, 19 Sep 2017 14:25:02 +0000 (19:55 +0530)]
Update NNN_NOWAIT changes

7 years agoPrevent nnn from waiting on open file process (#40)
Paul [Tue, 19 Sep 2017 06:30:54 +0000 (02:30 -0400)]
Prevent nnn from waiting on open file process (#40)

* Prevent nnn from waiting on open file process

* Add env var flag to not wait for child process when opening file

* Set nowait flag once to skip bit-or every time we open a file

* Add documentation for NNN_NOWAIT

7 years agoSkip entries in case fstatat() fails, do not exit
Arun Prakash Jana [Wed, 13 Sep 2017 13:14:27 +0000 (18:44 +0530)]
Skip entries in case fstatat() fails, do not exit

7 years agoNew video
Arun Prakash Jana [Sun, 10 Sep 2017 20:50:35 +0000 (02:20 +0530)]
New video

7 years agoSupport file and dir create
Arun Prakash Jana [Sun, 10 Sep 2017 07:35:25 +0000 (13:05 +0530)]
Support file and dir create

7 years agoConvert metaviewer and color to bitfields
Arun Prakash Jana [Fri, 8 Sep 2017 20:46:10 +0000 (02:16 +0530)]
Convert metaviewer and color to bitfields

7 years agoAdd general info in help
Arun Prakash Jana [Fri, 8 Sep 2017 19:40:21 +0000 (01:10 +0530)]
Add general info in help

7 years agoAdd package information
Arun Prakash Jana [Tue, 5 Sep 2017 12:37:45 +0000 (18:07 +0530)]
Add package information

7 years agoChange donation button
Arun Prakash Jana [Mon, 4 Sep 2017 20:50:08 +0000 (02:20 +0530)]
Change donation button

7 years agoAdd gcc, pkg-config as build deps v1.4
Arun Prakash Jana [Mon, 4 Sep 2017 05:05:43 +0000 (10:35 +0530)]
Add gcc, pkg-config as build deps

7 years agoUpdate README
Arun Prakash Jana [Mon, 4 Sep 2017 04:57:23 +0000 (10:27 +0530)]
Update README

7 years agoPrepare for v1.4 release
Arun Prakash Jana [Mon, 4 Sep 2017 04:53:02 +0000 (10:23 +0530)]
Prepare for v1.4 release

7 years agoClean up after compilation
Arun Prakash Jana [Sun, 3 Sep 2017 03:36:05 +0000 (09:06 +0530)]
Clean up after compilation

7 years agoAdd pin directory in cool list
Arun Prakash Jana [Sat, 2 Sep 2017 14:04:02 +0000 (19:34 +0530)]
Add pin directory in cool list

7 years agoMake test script more aggressive
Arun Prakash Jana [Sat, 2 Sep 2017 12:39:47 +0000 (18:09 +0530)]
Make test script more aggressive

7 years agoReorder APIs
Arun Prakash Jana [Sat, 2 Sep 2017 08:39:34 +0000 (14:09 +0530)]
Reorder APIs

7 years agoDisable dircolor if no sub-directories
Arun Prakash Jana [Sat, 2 Sep 2017 08:32:29 +0000 (14:02 +0530)]
Disable dircolor if no sub-directories

Fix regression from 1e5a0b8c5bc78462956d01c647293a7da594c36f.

7 years agoAdd tests for Unicode and astral codepoints
Arun Prakash Jana [Sat, 2 Sep 2017 07:58:58 +0000 (13:28 +0530)]
Add tests for Unicode and astral codepoints

7 years agoNote Makefile.native differences
Arun Prakash Jana [Sat, 2 Sep 2017 07:17:02 +0000 (12:47 +0530)]
Note Makefile.native differences

7 years agoRe-arrange artifacts
Arun Prakash Jana [Sat, 2 Sep 2017 07:04:29 +0000 (12:34 +0530)]
Re-arrange artifacts

7 years agoMake mktest.sh an executable
Arun Prakash Jana [Sat, 2 Sep 2017 06:54:40 +0000 (12:24 +0530)]
Make mktest.sh an executable

7 years agoAdd auto-completion scripts
Arun Prakash Jana [Sat, 2 Sep 2017 06:53:19 +0000 (12:23 +0530)]
Add auto-completion scripts

7 years agoMove config.h to nnn.h
Arun Prakash Jana [Sat, 2 Sep 2017 06:09:44 +0000 (11:39 +0530)]
Move config.h to nnn.h

7 years agoChange name to scripts directory
Arun Prakash Jana [Sat, 2 Sep 2017 05:45:10 +0000 (11:15 +0530)]
Change name to scripts directory

7 years agoIntegrate PackageCore to generate packages
Arun Prakash Jana [Fri, 1 Sep 2017 16:46:14 +0000 (22:16 +0530)]
Integrate PackageCore to generate packages

7 years agoUse 'pin' dir instead of 'mark' dir
Arun Prakash Jana [Fri, 1 Sep 2017 14:27:36 +0000 (19:57 +0530)]
Use 'pin' dir instead of 'mark' dir

7 years agoCalculate number of cols for name only once
Arun Prakash Jana [Fri, 1 Sep 2017 14:00:25 +0000 (19:30 +0530)]
Calculate number of cols for name only once

7 years agoChange to light mode if < 35 columns are available
Arun Prakash Jana [Fri, 1 Sep 2017 13:28:32 +0000 (18:58 +0530)]
Change to light mode if < 35 columns are available

7 years agoRemove redundant variable
Arun Prakash Jana [Fri, 1 Sep 2017 12:20:14 +0000 (17:50 +0530)]
Remove redundant variable

7 years agoAdjusting number of cols is redundant with shortening.
Arun Prakash Jana [Fri, 1 Sep 2017 05:05:04 +0000 (10:35 +0530)]
Adjusting number of cols is redundant with shortening.

7 years agoFix #36: uneven splitting of codepoints
Arun Prakash Jana [Fri, 1 Sep 2017 04:52:44 +0000 (10:22 +0530)]
Fix #36: uneven splitting of codepoints

Check if the number of columns needed to print name exceeds the number of cols.
If it does, split the name str at the max number of columns available for name.
Conversion to wide char ensures the split is done at a valid codepoint.

The current patch adds some optimization as well:

- No more copying to an intermediate (global) string.
- If the name is shortened, escape chars are replaced only till the terminator.

7 years agoUndocumented keys: F2, F5
Arun Prakash Jana [Sun, 27 Aug 2017 18:10:43 +0000 (23:40 +0530)]
Undocumented keys: F2, F5

7 years agoFix cursor position issue with astral symbols
Arun Prakash Jana [Sat, 26 Aug 2017 08:04:43 +0000 (13:34 +0530)]
Fix cursor position issue with astral symbols

In case of astral symbols like Devanagari matras multiple wide-char codepoints
occupy a single position/column. Positioning the cursor wrt. the actual number
of wide-characters in a wide-char string gets "visually incorrect".  The trick
is to calculate the correct number of columns needed to represent a fixed-size
wide-character string.

Relevant man pages:

1. wcswidth(3)
2. wctomb(3)
3. mblen(3)

Interesting links:

1. https://www.gnu.org/software/libc/manual/html_node/Non_002dreentrant-Character-Conversion.html
2. https://www.gnu.org/software/libc/manual/html_node/Shift-State.html
3. https://10hash.com/c-programming/uchar/
4. https://mathiasbynens.be/notes/javascript-unicode#accounting-for-astral-symbols

Example file names for test:

1. Malgudi Days - मालगुडी डेज - E05. Swami and Friends - स्वामी और उसके दोस्त (Part 5)
2. Eso eso aamar ghare eso ♫ এসো এসো আমার ঘরে এসো ♫ Swagatalakshmi Dasgupta
3. Führer

7 years agoA shorter overwrite message (key is not echoed)
Arun Prakash Jana [Sat, 26 Aug 2017 04:07:04 +0000 (09:37 +0530)]
A shorter overwrite message (key is not echoed)

7 years agoRevert "Handle multi-byte: 2 codepoints single column"
Arun Prakash Jana [Fri, 25 Aug 2017 21:12:33 +0000 (02:42 +0530)]
Revert "Handle multi-byte: 2 codepoints single column"

This reverts commit e8cf0dc663436e2ac30f737a17d8cc91efbdd364.