azuline / nnn Goto Github PK
View Code? Open in Web Editor NEWThis project forked from jarun/nnn
n³ The unorthodox terminal file manager
License: BSD 2-Clause "Simplified" License
This project forked from jarun/nnn
n³ The unorthodox terminal file manager
License: BSD 2-Clause "Simplified" License
notes on variables:
cfg.*
globals, which is used in entrycmp
to sort entries. the cfg.*
globals are per-context.cfgsort
controls the sort config across multiple contextscd
variable is true whenever the directory changes? something like that... it's set to false in special cases prior to goto begin:
notes on special mechanics of cfgsort:
savecurctx
, which does some magic on cfgsort
, and then we go to begin:
, which does additional magic on cfgsort
cfgsort[CTX_MAX]
is a carrier that sometimes transports the new context's state to begin:
for that logic to act on it. when cfgsort[curctx] == '0'
, that means we want to use the carried sort and ignore any other logic. this occurs when we switch to a pre-existing context in an order != null
environment.
\0
is also a default value for each cfgsort. so we hit this when a new session is created.cfgsort[curctx] == 'z'
, that means:
z
converts to c
in begin:
order kv
. the sort flags have been set, and the cfgsort is nullified (aka set to z
) so that it isn't persistent.bugged scenario:
NNN_ORDER
must be set.
cfgsort[0] = '0'
, cfg0.reverse = 0
, entrycmpfn = &entrycmp
r
cfgsort[0] = 'r'
, cfg0.reverse = 1
, entrycmpfn = &reventrycmp
r
.
cfgsort[0] = 'r'
, cfgsort[1] = 'r'
, cfg0.reverse = 1
, cfg1.reverse = 1
, entrycmpfn = &reventrycmp
r
in context 2.
cfgsort[0] = 'r'
, cfgsort[1] = 'c'
, cfg0.reverse = 1
, cfg1.reverse = 0
, entrycmpfn = &entrycmp
r
.
cfgsort[0] = 'r'
, cfgsort[1] = 'c'
, cfg0.reverse = 1
, cfg1.reverse = 0
, entrycmpfn = &entrycmp
r
again. no-ops when it should op.
cfgsort[0] = 'r'
, cfgsort[1] = 'c'
, cfg0.reverse = 0
, cfg1.reverse = 0
, entrycmpfn = &entrycmp
root cause: &entrycmpfn is out of sync with cfg/cfgsort
soln: restore fn pointers when restoring cfg
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.