Commit Graph

231 Commits (weechat-hashes)

Author SHA1 Message Date
C. McEnroe 62a3e3699c Implement split scrolling 2020-04-06 13:46:35 -04:00
C. McEnroe 75a6aa9258 Use gnu-case-range and gnu-conditional-omitted-operand extensions
I'm sad to do this but I just can't stand writing (foo ? foo : bar)
anymore.
2020-04-03 17:10:52 -04:00
C. McEnroe a0f012c614 Do not add an extra blank line on uiLoad
Adding one for the last unread position now, so this is mostly
redundant, I think.
2020-04-02 11:00:05 -04:00
C. McEnroe 9063c656d5 Preserve the last blank line on reflow 2020-04-02 10:56:33 -04:00
C. McEnroe 6333b63224 Switch to windows with ascending unread counts on M-a 2020-04-02 10:47:17 -04:00
C. McEnroe ca751a1cdc Hide filtered messages 2020-03-31 14:31:10 -04:00
C. McEnroe fcb6e2909f Save and load buffer line heat 2020-03-31 14:12:43 -04:00
C. McEnroe bfa106b9a0 Store line heat in buffer 2020-03-31 14:07:21 -04:00
C. McEnroe ff78362826 Replace some declaration; while loops with for loops
I should have been using this for getopt loops already but the call here
is slightly too long to fit on one line as a for loop.
2020-03-30 19:44:45 -04:00
C. McEnroe a0dde10cb6 Add text macros 2020-03-30 14:56:26 -04:00
C. McEnroe ef6518a627 Add M-Enter to insert a newline 2020-03-23 15:03:55 -04:00
C. McEnroe 60b189200e Handle bracketed paste, including newlines 2020-03-23 14:55:43 -04:00
C. McEnroe 8570a62235 Implement the causal.agency/consumer capability 2020-02-29 01:03:46 -05:00
C. McEnroe d5c4e7e371 Apply word wrapping to tabs before setting align
This fixes long URLs right after the initial \t being wrapped and line
counted incorrectly.
2020-02-19 20:31:29 -05:00
C. McEnroe ab94728913 Remove bad continues in styleParse loops
Since we're sometimes manually doing spaces that need the right styling.
2020-02-19 02:11:17 -05:00
C. McEnroe 026a8ca979 Various small cleanup in ui.c 2020-02-19 01:18:09 -05:00
C. McEnroe 6be9aa9901 Increase buffer size to 1024 2020-02-17 23:06:37 -05:00
C. McEnroe 079bbda246 Accept Shift-M-0 through Shift-M-9 as well
This mostly just to accommodate my inverted keyboard layout.
2020-02-17 12:27:07 -05:00
C. McEnroe cf83e95114 Only scroll after reflow if necessary
If we've already filled up every line of the window, there is no need to
scroll.
2020-02-17 11:57:29 -05:00
C. McEnroe fa29c37911 Scroll the window only once during reflow
ncurses implements scrolling as a memmove of the array of lines
pointers, which happens each time a line is added to the bottom of the
window, causing a scroll. This would get noticeably slow if WindowLines
were increased to just 1024. Should've used a ring buffer, I think.
2020-02-17 11:49:56 -05:00
C. McEnroe b20be7cbad Various small cleanups
Haven't really gone through ui.c yet.
2020-02-16 23:05:43 -05:00
C. McEnroe ba524ed804 Replace a lot of snprintf with a catf implementation 2020-02-16 19:12:19 -05:00
C. McEnroe 700b5d5870 Replace small integers in size_t with uint 2020-02-15 22:19:55 -05:00
C. McEnroe 42d106260b Separate network info from self 2020-02-15 04:54:53 -05:00
C. McEnroe 0d23f8f1b8 Save heat, unreadTotal, unreadWarm 2020-02-14 05:20:22 -05:00
C. McEnroe fbdfb36085 Track unreadTotal and unreadWarm separately
Otherwise reflow's calculation of unreadLines is always going to be
wrong if there were Cold lines interspersed.
2020-02-14 05:19:33 -05:00
C. McEnroe 3b257a55c3 Set hidden to true initially
Otherwise uiShow in uiInit does nothing, of course.
2020-02-13 22:32:35 -05:00
C. McEnroe 4405b89f6c Only uiShow if hidden and only uiHide if shown 2020-02-13 22:09:25 -05:00
C. McEnroe 1e226593ef Rename procPipe to utilPipe 2020-02-13 21:57:55 -05:00
C. McEnroe a6bc2ea7c3 Set swap correctly when closing a window
I knew I missed something.
2020-02-13 05:10:55 -05:00
C. McEnroe 92ccabaafd Refactor windows into array and add /move
Oof.
2020-02-13 05:05:53 -05:00
C. McEnroe 180bbc7b38 Add -N flag for notifications 2020-02-12 20:12:34 -05:00
C. McEnroe 4198f67aa2 Mark and unmark on uiHide, uiShow 2020-02-12 19:40:55 -05:00
C. McEnroe 7285906298 Hide debug prompt if buffer starts with / 2020-02-12 19:36:26 -05:00
C. McEnroe 14ae13f781 Add C-t transpose
Also in emacs, weechat.
2020-02-12 01:16:40 -05:00
C. McEnroe aab9f76fa0 Add C-v and M-v
I figure there should be some way to scroll without keypad, and
apparently this is what emacs offers...
2020-02-12 01:00:39 -05:00
C. McEnroe 8d873c71ed Support monochromatic terminals
Oops, division by zero!
2020-02-11 23:01:38 -05:00
C. McEnroe 907d4b4605 Exit focus and paste modes on err exit 2020-02-11 21:56:29 -05:00
C. McEnroe 7783d89448 Call completeClear when closing a window 2020-02-11 18:18:48 -05:00
C. McEnroe c9590bab06 Use time_t for save signature
It's actually more likely to be 64-bit than size_t anyway, and it
eliminates some helper functions.

Also don't error when reading an empty save file.
2020-02-11 18:01:50 -05:00
C. McEnroe cc80fae758 Set self.nick to * initially
Allows removing a bunch of checks that self.nick is set, and it's what
the server usually calls you before registration.

Never highlight notices as mentions.
2020-02-11 17:52:55 -05:00
C. McEnroe 2771863299 Define ColorCap instead of hardcoding 100 2020-02-11 17:43:36 -05:00
C. McEnroe 86fac7caad Cast towupper to wchar_t
For some reason it takes and returns wint_t...
2020-02-11 03:48:50 -05:00
C. McEnroe b855ec6210 Cast set but unused variables to void 2020-02-11 03:47:30 -05:00
C. McEnroe 2404e15e72 Check if VDSUSP exists 2020-02-11 03:42:06 -05:00
C. McEnroe bf86a4749f Invalidate title on uiShow 2020-02-10 22:05:02 -05:00
C. McEnroe 66fe89b84b Only write out title if it has changed 2020-02-10 21:34:23 -05:00
C. McEnroe 90eff04eda Only write out title on uiDraw 2020-02-10 21:24:30 -05:00
C. McEnroe 47a0bf7fc2 Manually raise SIGINT from C-c
This allows it to still work, but makes C-z C-c insert the color code
rather than exit, and in the future, will allow pasting in text with
color codes.
2020-02-10 21:09:32 -05:00
C. McEnroe 2c2839e6c1 Replace alignment tabs with spaces in bufferList 2020-02-10 20:54:17 -05:00
C. McEnroe 3a156540b8 Add C-o as alias of M-/
M-/ is from weechat. C-o is like in vim.
2020-02-10 20:29:19 -05:00
C. McEnroe 99480a42e5 Factor out XDG base directory code
And add warnings to configOpen, since that's the only way to be accurate
if a weird error occurs.
2020-02-10 19:57:10 -05:00
C. McEnroe e6c18403e2 Leave a blank line after loaded buffer 2020-02-10 19:44:35 -05:00
C. McEnroe b59431bb15 Add -s to save and load buffers 2020-02-10 19:40:13 -05:00
C. McEnroe 65603d5138 Show heat and other unread in title 2020-02-10 17:54:16 -05:00
C. McEnroe b9a6d35b65 Improve color fudging
Prevent fudged colors from ever being pure black. Distribute fudged
colors between normal and bold if COLORS is 8. Fudge colors before
checking if it's a pre-allocated pair.
2020-02-10 05:33:31 -05:00
C. McEnroe 218bfbac32 Support all 99 IRC colors
Corresponding ANSI colors from the table on ircdocs.
2020-02-10 04:17:07 -05:00
C. McEnroe 2c9ff1717b Recalculate unreadLines on reflow 2020-02-10 03:37:17 -05:00
C. McEnroe 7957ca0ecd Only make windows hotter
A warm message shouldn't clear a window's hotness.
2020-02-10 03:29:38 -05:00
C. McEnroe 7a8024ae3d Always increase unreadLines
So that if you switch to a window and some new activity happens before
you press M-u, it'll still jump to the right place.
2020-02-10 03:10:08 -05:00
C. McEnroe 3c89857652 Move scroll marker on resize 2020-02-10 02:55:21 -05:00
C. McEnroe b6061a70d7 Update line count for words longer than lines 2020-02-10 02:50:32 -05:00
C. McEnroe 05fc01b248 Simplify mark, heat, unread tracking 2020-02-10 01:59:08 -05:00
C. McEnroe f3fa88ef92 Fix M-a so it properly cycles back to where it started 2020-02-10 01:09:03 -05:00
C. McEnroe 7470a705b3 Add M-l 2020-02-09 18:16:01 -05:00
C. McEnroe 3a5ce4d10f Remove unnecessary uiDraw 2020-02-09 15:02:34 -05:00
C. McEnroe 5254e1035c Add /help
Now with automatic search! Also had to fix the SIGCHLD handling...
2020-02-09 14:09:27 -05:00
C. McEnroe f0e2c089c9 Add M-u 2020-02-09 12:13:51 -05:00
C. McEnroe 347fabc2fe Invert the direction of window->scroll 2020-02-09 11:50:56 -05:00
C. McEnroe 11f2de1a29 Add The Scroll Bar 2020-02-09 09:18:26 -05:00
C. McEnroe 8451543b98 Implement scrolling! 2020-02-09 08:52:17 -05:00
C. McEnroe 8ce6d4c377 Add M-/ 2020-02-09 08:17:05 -05:00
C. McEnroe 16316679a1 Add M-a 2020-02-09 08:14:22 -05:00
C. McEnroe 26eefa35c9 Add C-n and C-p 2020-02-09 07:46:30 -05:00
C. McEnroe 2aa2005339 Add C-y
This is weechat's binding for it.
2020-02-09 07:09:56 -05:00
C. McEnroe 5e637324c9 Add C-w and M-d 2020-02-09 04:32:32 -05:00
C. McEnroe 3cd830681e Rename kill ops 2020-02-09 04:22:41 -05:00
C. McEnroe b08c2d03ef Add M-b and M-f 2020-02-09 04:20:07 -05:00
C. McEnroe d7c96fc81b Add C-k
Also rename all the edit ops to something consistent.
2020-02-09 03:58:13 -05:00
C. McEnroe 282de9af30 Add C-d 2020-02-09 03:45:44 -05:00
C. McEnroe e6e2021d48 Add C-b and C-f 2020-02-09 03:41:46 -05:00
C. McEnroe 2d62ea9e30 Simplify edit buffer conversion and input rendering 2020-02-09 01:28:24 -05:00
C. McEnroe e0714a9b7e Switch to "other" window if closing active window 2020-02-09 00:39:09 -05:00
C. McEnroe 29bd788660 Simplify(?) reflow buffer loop 2020-02-08 16:56:49 -05:00
C. McEnroe 943502ea82 Add /close 2020-02-08 02:26:00 -05:00
C. McEnroe 55e721da42 Check return values of newwin/newpad 2020-02-08 02:13:02 -05:00
C. McEnroe 0705f09310 Only treat the first tab as the alignment point 2020-02-07 23:56:41 -05:00
C. McEnroe 71b0536536 Revert "Only treat the first tab as the alignment point"
This reverts commit 5881a96638.
2020-02-07 23:55:46 -05:00
C. McEnroe ef9bea6d60 Use atexit instead of err_set_exit
Unsurprisingly, err_set_exit doesn't exist in GNU's err.h, but since
it's safe to call reset_shell_mode on any kind of exit, just use atexit.
2020-02-07 22:25:09 -05:00
C. McEnroe fe5fd89705 Populate completion with commands 2020-02-07 21:39:56 -05:00
C. McEnroe a26c9ae0bc Use define_key for meta keys
This will allow distinguishing meta from escape via ESCDELAY (which
should probably be set to something quite a lot shorter than its
default).
2020-02-07 20:41:27 -05:00
C. McEnroe 5881a96638 Only treat the first tab as the alignment point 2020-02-07 20:29:32 -05:00
C. McEnroe aed762368d Show one cell to the right of the input cursor 2020-02-07 20:28:22 -05:00
C. McEnroe 4343f35f9c Add key bindings for IRC formatting 2020-02-07 02:46:40 -05:00
C. McEnroe af244ad3cd Add some real line editing operations 2020-02-07 01:56:23 -05:00
C. McEnroe 273207b19f Flush stdout after using putp 2020-02-06 23:11:48 -05:00
C. McEnroe ea7e919a1d Color notices LightGray in input 2020-02-06 23:11:35 -05:00
C. McEnroe 9cff026b5a Show input in italics for actions and set Debug prompt 2020-02-06 19:05:51 -05:00
C. McEnroe 34514cf2ee Render actions in italic
Also render italic as normal if it's unsupported, as that is what would
happen anyway if curses has A_ITALIC but the terminal has no sitm. That
format string is kinda bad.
2020-02-06 18:48:49 -05:00
C. McEnroe 68440d50c6 Beep on hot 2020-02-06 04:23:49 -05:00
C. McEnroe a5a162b9c6 Disable SUSP
Frees up C-z and suspending an IRC client is silly anyway.
2020-02-06 02:25:58 -05:00
C. McEnroe b2d35edcb2 Change prompt depending on command 2020-02-05 19:00:54 -05:00
C. McEnroe a7b0ed9907 Scroll the input window
I was wondering if I should instead make input wrap, but then wordWrap
would need to both support showing formatting and persisting styles
across to strings, and it would need to move the window pad up and down
a bunch, etc.
2020-02-05 18:18:41 -05:00
C. McEnroe eb91347308 Only reflow text when COLS changes 2020-02-05 18:01:57 -05:00
C. McEnroe 6e679bdf26 Modulo colors before comparing pairs
Otherwise a new pair is allocated every time a high color is requested.
2020-02-05 04:24:13 -05:00
C. McEnroe 42210e079b Reflow text on window resize 2020-02-05 02:03:21 -05:00
C. McEnroe 4cce893eab Add extremely basic editing and message sending 2020-02-05 00:20:39 -05:00
C. McEnroe 104b3ffd4f Model keyCtrl like keyMeta 2020-02-04 21:00:33 -05:00
C. McEnroe 55757243f4 Call inputUpdate when switching windows
Because changing windows (to <network> or <debug>) will affect the
prompt.
2020-02-04 20:46:16 -05:00
C. McEnroe 9944dc484b Split showing style codes and word wrapping 2020-02-04 20:23:55 -05:00
C. McEnroe d57df09511 Align word wrapping with tab character
Also fixes handling whitespace directly after control codes.
2020-02-04 19:50:23 -05:00
C. McEnroe a65841c3cb Switch windows with M-0 through M-9 2020-02-04 04:41:11 -05:00
C. McEnroe d57e786876 Factor out unmark 2020-02-04 04:09:54 -05:00
C. McEnroe 43845c6115 Add beginnings of input handling 2020-02-04 03:58:56 -05:00
C. McEnroe 26e9dd9adf Use time_t rather than struct tm 2020-02-03 18:41:52 -05:00
C. McEnroe c9470b59a1 Add sequences for toggling focus/paste modes 2020-02-02 23:20:19 -05:00
C. McEnroe 81ac0c59f3 Track unread and window heat 2020-02-02 20:25:12 -05:00
C. McEnroe 5398a6ac9d Rearrange some UI code 2020-02-02 19:38:37 -05:00
C. McEnroe 5c328c7a88 Remove term.c in favor of more curses APIs 2020-02-02 19:34:35 -05:00
C. McEnroe 8ec17d4f8c Use tsl/fsl capabilities for title if available
Also manually fill them if TERM=xterm* because they really should be
there.
2020-02-02 18:40:21 -05:00
C. McEnroe a507ff4073 Set title in statusUpdate 2020-02-02 17:57:07 -05:00
C. McEnroe e8d0d71775 Add option to show style codes
This will be used for the input window.
2020-02-02 16:55:45 -05:00
C. McEnroe 052cd2ed26 Remove style string macros 2020-02-02 03:34:05 -05:00
C. McEnroe 8bb9ea7b7f Add idColors 2020-02-02 03:27:50 -05:00
C. McEnroe ec83332e15 Implement window switching and status line 2020-02-02 03:13:50 -05:00
C. McEnroe 09754ed912 Call reset_shell_mode on err
This restores the terminal but doesn't clear the screen, so the error
stays visible.
2020-02-02 02:28:14 -05:00
C. McEnroe c18dc35377 Wrap before the very edge of the screen 2020-02-02 02:04:08 -05:00
C. McEnroe c799310d67 Implement wordWidth 2020-02-02 01:54:51 -05:00
C. McEnroe 05256b68fe Implement word wrap
This actually wasn't that bad?
2020-02-01 22:41:30 -05:00
C. McEnroe cd3dc4ef4c Parse IRC styling in UI
Wow the colorPair thing actually works. Have I finally cracked curses
colors?
2020-02-01 21:57:11 -05:00
C. McEnroe e5363bcae0 Implement the beginnings of UI
It takes so much code to do anything in curses...
2020-02-01 19:37:55 -05:00