Age | Commit message (Collapse) | Author |
|
for a while it has used only spaces when no-tab-mode is enabled and respected
the current buffer tab width.
|
|
|
|
|
|
|
|
Since the import of mg in the tree, space_to_tabstop used curbp->w_doto
(the byte offset in the current line) as mean to deduce the current
column for indentation. This is wrong because it doesn't account for
tab, control characters and octets > 127 (which are all rendered with
more than one column.) Use instead getcolpos().
ok tb@
|
|
This makes the tab width customizable per-buffer. The new function
`set-tab-width' changes it for the current buffer or the default value
for new buffers if called with a prefix argument (or from the startup
file.)
The default tab width is still 8 column.
Together with the newly resurrected no-tab-mode, allows to use mg for a
variety of programming languages and coding styles.
Note that it's not possible to call set-tab-width with auto-execute in
the startup file due to limitations in how auto-execute and the parser
work.
ok tb@
|
|
|
|
ok tb@
|
|
|
|
It's a mode that makes mg insert spaces up to the next tab stop upon
pressing TAB, along with the various tweaks needed in other places so
for e.g. auto-indent-mode also uses spaces.
This is not just an unifdef NOTAB: even under no-tab-mode mg should
consider literal TAB characters wide up to the next tab stop, while the
hidden code considered hard tabs to be just control character (i.e. ^I)
with width of two columns. I'm also introducing the helper function
doindent() in utils.c to de-obfuscate the insertion of tabs/spaces until
the given column.
ok tb@
|
|
|
|
|
|
|
|
This removes a few access(2) calls in the configuration file handling.
startupfile() now opens and return the file and to avoid surprises it
also uses a caller-provided buffer to store the filename. This also
removes the extra adjustpath() that load() did: it has been moved to
evalfile() only.
with help, fixes and ok tb@
|
|
|
|
otherwise paths longer than NFILEN (1024) given with -u won't
NUL-terminate `file'.
|
|
|
|
mg kept the path to the last loaded tag file in tagsfn which was used
for both the lazy loading (now removed) and as a flag to know if any
tags are currently loaded. It's redundant and complicates the code:
just check if the tree is empty instead.
ok tb@
|
|
before it used to only record the path to the tag file which was loaded
on demand upon find-tag (M-.). tagvisit did to do a stat + access dance
to know if the path was pointing to a regular, readable file and
loadtags (called lazily by find-tag) trusted those checks...
Instead, just load the tags in tagvisit and drop the lazy mechanics.
ok tb@
|
|
Instead of erroring out ignore duplicates. Fixes using /var/db/libc.tags
again.
ok op
|
|
Suggested by and ok millert@, thanks!
|
|
Original diff from lux (lx [at] shellcodes [dot] org) thanks!
tweaked by me; ok millert@
|
|
|
|
|
|
|
|
the l pointer is advanced, so if the line is malformed `goto cleanup'
will free(NULL) or a pointer inside l.
semplification and ok tb@
|
|
based on a diff by lux (lx [at] shellcodes [dot] org), thanks!
Diff via, tweak and ok tb@
|
|
|
|
ok miod@ millert@
|
|
amendments to his diff are noted on tech
|
|
ok florian@
|
|
ok florian@
|
|
|
|
|
|
dobeep_msgs isn't printf-like: it just prints the two arguments
separated by a space. When it was introduced, some calls from ewprintf
were incorrectly translated and the "%s" remained.
ok florian@
|
|
auto-indent-mode (only after computing the auto indent.)
tested also by Mikhail (thanks!). ok tb@
|
|
jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.
ok jmc@
|
|
apostrophe.
|
|
strtonum() is only called to verify that a string is numerical, the
return value is unused.
inlist is no longer used after the code was refactored.
ok millert@ guenther@
|
|
through the expression. To be used in checking function parameter
profiles later.
|
|
moment. This diff works the two checks for them into the main for
parsing loop.
|
|
|
|
'('.
|
|
submitted to excline().
|
|
|
|
|
|
|
|
|
|
to be accomodated for.
|
|
\" to be accomodated for. Also, move the variable structure to be
global in scope within mg.
|