Commit Graph

8883 Commits

Author SHA1 Message Date
Kartik K. Agaram d6866ec35d . 2021-10-10 15:52:03 -07:00
Kartik K. Agaram 3254fe5ca5 . 2021-10-10 15:50:52 -07:00
Kartik K. Agaram 365b1f855c . 2021-10-10 15:48:47 -07:00
Kartik K. Agaram ee1b0d19b6 . 2021-10-10 08:35:59 -07:00
Kartik Agaram 1fca8ee13c . 2021-10-09 21:09:21 -07:00
Kartik K. Agaram 1ff9dde13b make page-up/page-down smart to hidden items
In the process we eliminate a whole bunch of duplication and give item
navigation a single source of truth.

Page-up isn't quite _identical_ to how it used to be before. Let's see
if it bothers us.
2021-10-09 20:40:17 -07:00
Kartik K. Agaram cd207331dc standardize argument order 2021-10-09 19:40:55 -07:00
Kartik K. Agaram 67f82e3a6e bugfix
new test:
  hit enter, go to thread view, hit enter again, go into thread view again. No crash.

Just bite the bullet and make item-index robust to single-thread tabs.
2021-10-09 19:33:24 -07:00
Kartik K. Agaram bf6cf3bd4b bugfix: skip hidden items when moving cursor
Tests to create when I start creating tests:
  hide an item. Cursor moves to a new item.
  hide an item that's not the bottom-most item, hit down arrow. Cursor moves to a new item.
  hide an item that's not the top-most item, hit up arrow. Cursor moves to a new item.
  hide top-most item. Cursor on new item. Hit up arrow. No change. Scroll down. New item.
  hide bottom-most item. Cursor on new item. Hit down arrow. No change. Scroll up. New item.
  open a thread. Hit down arrow. No crash (item-index not called).
2021-10-09 14:54:35 -07:00
Kartik K. Agaram 78231d4c4b slack: hide threads from the global view
To hide all comments from the same thread as the item at cursor, press
ctrl-h.

To later unhide everything, press ctrl-u.

Currently ctrl-u works by creating a whole new tab (that you can back
out of using Esc). That gives a way to undo it.

Still some rough edges:
  update number of items in view when hiding a thread
  avoid clipping menu in channel view
  undo a single hide without giving up previous ones
2021-10-09 12:35:13 -07:00
Kartik K. Agaram 23fe8b0ae9 slack: start work on hiding single threads 2021-10-09 11:54:34 -07:00
Kartik K. Agaram 527aaaa3ab . 2021-10-09 11:42:49 -07:00
Kartik K. Agaram fc5341e3cb . 2021-10-09 11:24:28 -07:00
Kartik K. Agaram 834377d6e3 . 2021-10-03 08:03:15 -07:00
Kartik K. Agaram aad64de236 . 2021-09-21 15:36:14 -07:00
Kartik K. Agaram 77207192ea . 2021-09-13 04:53:38 -07:00
Kartik K. Agaram 35c8c8edba support arrow keys in apps/ex7.mu 2021-09-04 14:00:38 -07:00
Kartik K. Agaram cfdee0a6fa fix apps/ex7.mu
I'm increasingly missing CI.
2021-09-04 13:57:20 -07:00
Kartik K. Agaram 66d5a8735c . 2021-09-03 20:52:57 -07:00
Kartik K. Agaram 9bb19e03c6 a tamil example (that I can't read) 2021-09-03 10:55:34 -07:00
Kartik K. Agaram 50d8f9c852 audit remaining calls to render-code-point
By definition that function can't support combining characters.
2021-09-02 16:02:52 -07:00
Kartik K. Agaram 60a50c9245 support combining characters in streams of text
Fake screens can't handle them yet.
2021-09-02 15:38:45 -07:00
Kartik K. Agaram 3f953ea5c8 . 2021-09-02 13:19:43 -07:00
Kartik K. Agaram 6c3e541be1 . 2021-09-02 13:07:59 -07:00
Kartik K. Agaram a4bac41133 .
A more common hindi vowel.
2021-09-02 13:06:27 -07:00
Kartik K. Agaram 80378db26b .
Inline render-code-point in one of its call-sites before we add support
for combining characters.
2021-09-02 12:44:56 -07:00
Kartik K. Agaram 1e1dd6b4d5 . 2021-09-02 12:44:18 -07:00
Kartik K. Agaram 38909fbce0 . 2021-09-01 14:21:04 -07:00
Kartik K. Agaram cd9f0bb076 a few more examples of combining characters 2021-09-01 14:19:21 -07:00
Kartik Agaram 207c6ef945 . 2021-09-01 13:22:16 -07:00
Kartik K. Agaram d2f96cb0b6 rendering code-points with combining characters
There's a new example app showing this ability.

Still to go: support for combining characters when rendering text and
streams.
2021-09-01 12:46:25 -07:00
Kartik K. Agaram dca845877b tag combining character code-points
Unfortunately the Unicode database doesn't actually provide obvious
metadata for combining characters. The process I followed is as follows.
I noticed that GNU Unifont provides the following files for download:

  - unifont-13.0.06.hex: All Plane 0 glyphs
  - unifont_sample-13.0.06.hex: The above .hex file with combining circles added

Downloading and diffing the two yields all code-points with combining
circles. I assume they are exactly the combining characters I care
about.

One mechanical difficulty is cross-correlating the above files that
include the code-point in each line with font.subx which does not. I got
things to work by modifying the above files in place until they have the
same format as font.subx, using the following Vim commands on each file:

  :%s|.\{64\}|10/size^M00/is-combine^M&|
  :%s|^.\{32\}$|08/size^M00/is-combine^M&00000000000000000000000000000000|
  :%s|..|& |g
  :%s|10 /s iz e|10/size|
  :%s|08 /s iz e|08/size|
  :%s|00 /i s- co mb in e|00/is-combine|

Now I can update the metadata with a Vim macro which jumps to the next
hunk and increments /is-combine on the previous line.
2021-08-31 23:03:34 -07:00
Kartik K. Agaram b8afd4becf start hacky experiment to support combining chars
https://en.wikipedia.org/wiki/Combining_character

The plan: just draw the combining character in the same space as the
previous character. This will almost certainly not work for some Unicode
blocks (tibetan?)

This commit only changes the data/memory/disk model to make some space.
As always in Mu, we avoid bit-mask tricks even if that wastes memory.
2021-08-31 23:03:34 -07:00
Kartik K. Agaram 281f38a7c2 . 2021-08-31 22:43:08 -07:00
Kartik K. Agaram b6ba4c30cc fix a typo from commit a479f0d083
Yet another gnarly reason to start checking all arg metadata in
linux/pack.subx or something like that. With this bug most of my
programs (including browser-slack!) were working even though the
instruction stream was almost certainly misdecoded halfway through every
attempt to draw glyphs.
2021-08-31 22:42:40 -07:00
Kartik K. Agaram 39a6e6f533 slack: start rendering unicode 2021-08-30 20:55:55 -07:00
Kartik Agaram 61ec86b719 . 2021-08-30 09:21:52 -07:00
Kartik K. Agaram a479f0d083 .
Open question fixed.
2021-08-30 00:41:11 -07:00
Kartik K. Agaram c970190021 first rendering of non-latin script
Open question: why does column 0 get cropped? The spacing also seems
excessive. Are we taking up 3 grid points?
2021-08-30 00:34:40 -07:00
Kartik K. Agaram 877fbf640a . 2021-08-30 00:06:51 -07:00
Kartik K. Agaram 6e05a8fa27 fix bad terminology: grapheme -> code point
Unix text-mode terminals transparently support utf-8 these days, and so
I treat utf-8 sequences (which I call graphemes in Mu) as fundamental.

I then blindly carried over this state of affairs to bare-metal Mu,
where it makes no sense. If you don't have a terminal handling
font-rendering for you, fonts are most often indexed by code points and
not utf-8 sequences.
2021-08-29 22:20:09 -07:00
Kartik K. Agaram 4b90a26d71 . 2021-08-29 20:54:05 -07:00
Kartik K. Agaram 0633e401f9 . 2021-08-29 20:43:57 -07:00
Kartik K. Agaram b1dcfb03d0 load Font in a non-contiguous area of memory 2021-08-29 20:34:53 -07:00
Kartik K. Agaram 354c72a637 . 2021-08-29 20:33:54 -07:00
Kartik K. Agaram 14cfa3e109 . 2021-08-29 19:13:23 -07:00
Kartik K. Agaram 8306c084ad . 2021-08-29 19:12:47 -07:00
Kartik K. Agaram bd226ccb3a improve translation scripts 2021-08-29 11:25:08 -07:00
Kartik K. Agaram efae02cf11 . 2021-08-29 11:21:09 -07:00
Kartik K. Agaram 899cdcc3f3 inline SubX translation
We can't really translate purely SubX code anyway at the top-level. Stop
exposing those scripts.
2021-08-29 11:21:09 -07:00