about summary refs log tree commit diff stats
path: root/src/kilo.c
Commit message (Collapse)AuthorAgeFilesLines
* simplify permissions model for file operationsKartik K. Agaram2022-03-031-2/+2
| | | | | We don't care to distinguish modes like "rw" or "a+". An app is permitted to perform either just reads or both reads and writes.
* prose typos and editsKartik K. Agaram2022-02-031-3/+2
|
* fix a bug in kiloKartik K. Agaram2022-02-031-1/+1
| | | | Submitted upstream at https://github.com/antirez/kilo/pull/81.
* file permissions: decide based on calling functionKartik K. Agaram2022-02-011-2/+2
|
* try to get by with one feature macroKartik K. Agaram2022-01-291-4/+0
| | | | | | | | | | | | | | | | | I fucking hate feature macros. Egregious discharge of our division-of-labor-obsessed society. People should be able to introduce names. People should be able to give up names to lower levels of abstraction when they encounter conflicts. Feature macros seem to exist[1] to support more than two levels of abstraction. You try to build, one of your libraries fails to build because of a conflict between it and one level down. You don't want to modify this library. Just fucking https://catern.com/change_code.html already. But no, I have to litter my code with feature macros even though I just want the abstraction the original library provides. [1] https://man7.org/linux/man-pages/man7/feature_test_macros.7.html https://lwn.net/Articles/590381
* fixup! redo lua vs proseKartik K. Agaram2022-01-291-15/+17
| | | | Forgot to include some hunks.
* redo lua vs proseKartik K. Agaram2022-01-261-4/+14
| | | | | Previously we weren't dynamically selecting how to highlight a buffer after navigating with ctrl-g. That should work now.
* indentKartik K. Agaram2022-01-261-8/+8
|
* better default word at cursor for proseKartik K. Agaram2022-01-251-2/+2
|
* highlight [[wikiwords]] in proseKartik K. Agaram2022-01-251-24/+71
| | | | | These are just hints that there's something worth jumping to. The jumping still happens using ctrl-g.
* disable Lua colors in proseKartik K. Agaram2022-01-251-8/+48
|
* renameKartik K. Agaram2022-01-251-2/+2
|
* rename a functionKartik K. Agaram2022-01-251-1/+1
|
* get Teliva running on NetBSDKartik K. Agaram2022-01-241-0/+4
| | | | | | | | NetBSD still uses curses by default. One _could_ install ncurses, but I don't have access to a NetBSD box with permissions to install ncurses, so I'm experimenting to see how far we can get with just curses. So far most of the apps seem to work, with the exception of one bug that I'll commit next.
* editing apps: clean up some stale printsKartik K. Agaram2022-01-161-0/+6
|
* file access policy: support editing with >10 linesKartik K. Agaram2022-01-161-3/+5
|
* kilo: cleaner go menuKartik K. Agaram2022-01-111-0/+2
|
* feels more consistent to exit editor with ctrl-xKartik K. Agaram2022-01-041-3/+3
|
* when editing a function, show its callersKartik K. Agaram2022-01-031-1/+8
| | | | | | No way to select between them. That complicates the UI too much when we do so much with the cursor. But it's still useful to suggest things to type in after ctrl-g.
* error handling when editing file permissionsKartik K. Agaram2022-01-021-1/+21
| | | | | | | Still highly non-ideal. Lua is a dynamic language, and has low ability to detect syntax errors within functions. Perhaps I should run a test call after every edit.
* editing file permissionsKartik K. Agaram2022-01-021-1/+22
|
* make some space for callers of a functionKartik K. Agaram2022-01-021-13/+26
|
* start parameterizing viewport for editorKartik K. Agaram2022-01-021-8/+18
|
* editable file permissionsKartik K. Agaram2022-01-021-0/+11
| | | | | | | | | | | | | | | | | | | | | Extremely cruddy implementation: - I'm still unclear on how to represent the advice function: - How to handle errors when loading user configuration? Currently I refuse to start. - Whole function? More errors to handle in header and so on. What if the function is renamed? - Just body? Needs more structured editing support. - Lots of duplication, particularly between the permissions in the menu and the permissions screen. I don't know how to show the hostname at the time of connect() or bind(), so networking is going to remain a boolean for now. It's also unclear what effective constraints we can impose on what gets discussed with a specific hostname. Everything outside the computer is out of one's control. One trick I learned is for consistently grabbing ASan logs on abort: It's always safe to redirect stderr with ncurses!
* fork a new editor widget for non-codeKartik K. Agaram2022-01-021-0/+47
|
* better follow kilo's naming conventionsKartik K. Agaram2022-01-021-3/+3
|
* start peeling out an editor for non-codeKartik K. Agaram2022-01-021-14/+21
|
* reorg: pull Teliva-specific stuff out of lua.cKartik K. Agaram2021-12-251-11/+0
| | | | It should now be easier to diff against the Lua 5.1 sources upstream.
* Revert "stop leaking on the Lua stack"Kartik K. Agaram2021-12-161-1/+0
| | | | | | | This reverts commit 7c1b9d0b91295323b5ed5ec3e09b46566288bc75. The 'big hammer' isn't good enough. The recent changes view seems to need state on the stack across invocations of the editor.
* stop leaking on the Lua stackKartik K. Agaram2021-12-161-0/+1
| | | | | ..even if at the expense of leaking on the heap. Because the Lua stack has very limited space (~20 slots). When it overflows, we segfault.
* commentKartik K. Agaram2021-12-081-0/+2
|
* display line numbersKartik K. Agaram2021-12-081-12/+29
| | | | | Not my aesthetic choice, but essential at the moment for quickly interpreting Lua errors.
* fix a use-after-freeKartik K. Agaram2021-12-081-2/+2
| | | | Introduced Nov 28. Let's see if my intermittent segfaults stop now.
* .Kartik K. Agaram2021-12-071-2/+2
|
* slightly more obvious menu copyKartik K. Agaram2021-12-061-1/+15
| | | | Still sucks, though..
* improve backspace copyKartik K. Agaram2021-12-061-2/+2
|
* more configurable colorsKartik K. Agaram2021-12-061-10/+10
| | | | | Also start using 256 colors, under the assumption most people will have them.
* start showing call stack on errorsKartik K. Agaram2021-12-041-28/+10
| | | | | | | | It turns out Lua has been providing us this information all along! I'd just not created the space on screen to show it. Make it persist better. Kilo now no longer tracks its own status messages, which is a regression in a rare condition.
* support the comment/uncomment hotkey on MacsKartik K. Agaram2021-12-031-2/+2
| | | | | | | ^/ works on Linux but not on Mac ^- emits the same character code on Mac ^_ seems to be the underlying character code, and works on both ctrl-7 also emits the same character code
* less ambiguous menusKartik K. Agaram2021-12-031-4/+4
| | | | | Doesn't make sense to use '/' as a delimiter when we have hotkeys involving '/'.
* get rid of `Esc` hotkeyKartik K. Agaram2021-12-031-5/+5
| | | | | For a variety of historical reasons, terminals pause every time you press `Esc`. Let's get rid of that lag.
* typosKartik K. Agaram2021-12-031-3/+3
|
* experimenting with different keysKartik K. Agaram2021-12-031-0/+2
| | | | | | | | | | | | | | On a Thinkpad X13, the `delete` key emits `^[[3~` outside of Teliva. Within Teliva, ncurses converts it to character code 330 (0x14a), which it fails to recognize as KEY_BACKSPACE. Why? My backspace is converted to character code 263, which ncurses does recognize as KEY_BACKSPACE. ctrl-h is character code 8. Both 330 and 263 are valid Unicode code points, which feels really ugly and ambiguous.
* stop showing frequent save messagesKartik K. Agaram2021-12-031-1/+1
|
* show ^h in a couple more menusKartik K. Agaram2021-12-031-0/+2
|
* improve support for backspaceKartik K. Agaram2021-12-031-3/+7
| | | | | | | I still don't understand the entire state space here, so I'm trying to err on the side of improving discoverability of the `ctrl-h` escape hatch. Without requiring too wide a window to show all hotkeys on the menu.
* stop inserting ctrl- keys into programsKartik K. Agaram2021-11-301-4/+2
|
* kilo bugfix: syntax highlight final word in lineKartik K. Agaram2021-11-291-1/+1
| | | | | Kilo likely never ran into this because it's only been tested on C, which uses semi-colons at the end of each statement.
* gotcha: silent string concatenationKartik K. Agaram2021-11-291-1/+1
|
* redo uncommentKartik K. Agaram2021-11-281-5/+6
| | | | It was printing a phantom null at end of line on screen.