aboutsummaryrefslogtreecommitdiffstats
path: root/nnn.c
AgeCommit message (Collapse)Author
2017-12-17An even faster nnn - no more copying file names!Gravatar Arun Prakash Jana
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!!!
2017-12-14Fix indentationGravatar Arun Prakash Jana
2017-12-13Use static vars in frequently used APIsGravatar Arun Prakash Jana
2017-12-13Retire redundant tmp varsGravatar Arun Prakash Jana
2017-12-13Process keypress by probable frequencyGravatar Arun Prakash Jana
2017-12-04Minor optimization, refactorGravatar Arun Prakash Jana
2017-12-03Fix -Os compilation warningsGravatar Arun Prakash Jana
2017-11-30Minor changesGravatar Arun Prakash Jana
2017-10-16Minor maintenanceGravatar Arun Prakash Jana
2017-10-09Ignore TAB in input promptGravatar Arun Prakash Jana
2017-10-09Fix a couple of warnings on BSDs (#54)Gravatar Vlad Glagolev
2017-10-08Fix segfault when SHLVL env var is not available (#52)Gravatar Vlad Glagolev
2017-10-08Correct name checking for NEW and RENAME (#53)Gravatar Vlad Glagolev
2017-10-08OpenBSD compatibility support (#48)Gravatar Vlad Glagolev
* Improve compatibility with OpenBSD * Fix indefinite blocking
2017-10-05include sys/types.h for non-glibc linux builds (#46)Gravatar maxice8
2017-10-05Prepare for release v1.5Gravatar Arun Prakash Jana
2017-10-01Remove redundant conversionGravatar Arun Prakash Jana
2017-10-01Disable noti subscription for the same dirGravatar Arun Prakash Jana
2017-10-01Change archive list shortcut to 'F'Gravatar Arun Prakash Jana
2017-09-27Revert "Archive handling on OS X using unar+lsar"Gravatar Arun Prakash Jana
This reverts commit 1e859eb1370bd67cecd06b7bc8c6f885b80554bd. We will use atool on OS X as well, it can be brewed easily.
2017-09-27Archive handling on OS X using unar+lsarGravatar Arun Prakash Jana
2017-09-27Support archive listing and extractionGravatar Arun Prakash Jana
2017-09-27Show current entry number in du modeGravatar Arun Prakash Jana
2017-09-27Show current entry number.Gravatar Arun Prakash Jana
...because you need to know where you are.
2017-09-24Fix #42Gravatar Arun Prakash Jana
2017-09-19Update NNN_NOWAIT changesGravatar Arun Prakash Jana
2017-09-19Prevent nnn from waiting on open file process (#40)Gravatar Paul
* 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
2017-09-13Skip entries in case fstatat() fails, do not exitGravatar Arun Prakash Jana
2017-09-10Support file and dir createGravatar Arun Prakash Jana
2017-09-09Convert metaviewer and color to bitfieldsGravatar Arun Prakash Jana
2017-09-09Add general info in helpGravatar Arun Prakash Jana
2017-09-04Prepare for v1.4 releaseGravatar Arun Prakash Jana
2017-09-02Reorder APIsGravatar Arun Prakash Jana
2017-09-02Disable dircolor if no sub-directoriesGravatar Arun Prakash Jana
Fix regression from 1e5a0b8c5bc78462956d01c647293a7da594c36f.
2017-09-02Move config.h to nnn.hGravatar Arun Prakash Jana
2017-09-01Use 'pin' dir instead of 'mark' dirGravatar Arun Prakash Jana
2017-09-01Calculate number of cols for name only onceGravatar Arun Prakash Jana
2017-09-01Change to light mode if < 35 columns are availableGravatar Arun Prakash Jana
2017-09-01Remove redundant variableGravatar Arun Prakash Jana
2017-09-01Adjusting number of cols is redundant with shortening.Gravatar Arun Prakash Jana
2017-09-01Fix #36: uneven splitting of codepointsGravatar Arun Prakash Jana
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.
2017-08-26Fix cursor position issue with astral symbolsGravatar Arun Prakash Jana
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
2017-08-26A shorter overwrite message (key is not echoed)Gravatar Arun Prakash Jana
2017-08-26Revert "Handle multi-byte: 2 codepoints single column"Gravatar Arun Prakash Jana
This reverts commit e8cf0dc663436e2ac30f737a17d8cc91efbdd364.
2017-08-26Handle multi-byte: 2 codepoints single columnGravatar Arun Prakash Jana
Very frequent with Devanagari scripts ('matra's)
2017-08-25More concise helpGravatar Arun Prakash Jana
2017-08-25Clear rename prompt with Ctrl-LGravatar Arun Prakash Jana
2017-08-25The '> ' as rename prompt is distractingGravatar Arun Prakash Jana
2017-08-25mbstowcs() returns the codepointsGravatar Arun Prakash Jana
2017-08-25Simplify filter handlingGravatar Arun Prakash Jana