<feed xmlns='http://www.w3.org/2005/Atom'>
<title>editor/src/term.rs, branch main</title>
<subtitle>A terrible text editor</subtitle>
<id>https://code.roseh.moe/editor/atom/src/term.rs?h=main</id>
<link rel='self' href='https://code.roseh.moe/editor/atom/src/term.rs?h=main'/>
<link rel='alternate' type='text/html' href='https://code.roseh.moe/editor/'/>
<updated>2024-01-13T20:31:42Z</updated>
<entry>
<title>Reject files with invalid utf-8.</title>
<updated>2024-01-13T20:31:42Z</updated>
<author>
<name>Rose Hogenson</name>
<email>rosehogenson@posteo.net</email>
</author>
<published>2024-01-13T20:31:42Z</published>
<link rel='alternate' type='text/html' href='https://code.roseh.moe/editor/commit/?id=1e32f5d480ecefa3a1c8fd1c43ac6b4260459266'/>
<id>urn:sha1:1e32f5d480ecefa3a1c8fd1c43ac6b4260459266</id>
<content type='text'>
It's easier to only support files with valid utf-8.
</content>
</entry>
<entry>
<title>Support the delete key.</title>
<updated>2024-01-12T16:47:02Z</updated>
<author>
<name>Rose Hogenson</name>
<email>rosehogenson@posteo.net</email>
</author>
<published>2024-01-12T16:47:02Z</published>
<link rel='alternate' type='text/html' href='https://code.roseh.moe/editor/commit/?id=b0e2ef021ce6f9c157356b896cf089b029cf8c2b'/>
<id>urn:sha1:b0e2ef021ce6f9c157356b896cf089b029cf8c2b</id>
<content type='text'>
For now it's exactly the same as backspace.
</content>
</entry>
<entry>
<title>Allow 4~ for End.</title>
<updated>2024-01-12T16:41:32Z</updated>
<author>
<name>Rose Hogenson</name>
<email>rosehogenson@posteo.net</email>
</author>
<published>2024-01-12T16:41:32Z</published>
<link rel='alternate' type='text/html' href='https://code.roseh.moe/editor/commit/?id=8fd566044e3a18110161f429a06df9dbb779815b'/>
<id>urn:sha1:8fd566044e3a18110161f429a06df9dbb779815b</id>
<content type='text'>
This seems to be what GNU screen provides, at least.
</content>
</entry>
<entry>
<title>Fix a bug where cursor_pos would return old data.</title>
<updated>2024-01-12T16:31:12Z</updated>
<author>
<name>Rose Hogenson</name>
<email>rosehogenson@posteo.net</email>
</author>
<published>2024-01-12T16:31:12Z</published>
<link rel='alternate' type='text/html' href='https://code.roseh.moe/editor/commit/?id=d333343b15aab5747ccf74c495cb085b4e32b029'/>
<id>urn:sha1:d333343b15aab5747ccf74c495cb085b4e32b029</id>
<content type='text'>
For now I'm just counting the failures, and aborting if cursor_pos
immediately failed before. We have to skip the incoming status reports
with read_key before cursor_pos will start working again. This should
flush any old status reports, and prevent reading them incorrectly.
</content>
</entry>
<entry>
<title>Implement Home, End, PgUp, and PgDn.</title>
<updated>2024-01-12T05:31:39Z</updated>
<author>
<name>Rose Hogenson</name>
<email>rosehogenson@posteo.net</email>
</author>
<published>2024-01-12T00:38:04Z</published>
<link rel='alternate' type='text/html' href='https://code.roseh.moe/editor/commit/?id=e23b1c7254aa21c0eb2fd18f720df262725c6d81'/>
<id>urn:sha1:e23b1c7254aa21c0eb2fd18f720df262725c6d81</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Apply a clippy suggestion.</title>
<updated>2024-01-12T04:08:57Z</updated>
<author>
<name>Rose Hogenson</name>
<email>rosehogenson@posteo.net</email>
</author>
<published>2024-01-12T04:08:57Z</published>
<link rel='alternate' type='text/html' href='https://code.roseh.moe/editor/commit/?id=e8685c54228ca3337060520f7fbeb5629281764c'/>
<id>urn:sha1:e8685c54228ca3337060520f7fbeb5629281764c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Don't call read immediately in cursor_pos.</title>
<updated>2024-01-12T03:08:29Z</updated>
<author>
<name>Rose Hogenson</name>
<email>rosehogenson@posteo.net</email>
</author>
<published>2024-01-12T03:08:29Z</published>
<link rel='alternate' type='text/html' href='https://code.roseh.moe/editor/commit/?id=0f01c2aa5cca178ca2c46e512931302b069886af'/>
<id>urn:sha1:0f01c2aa5cca178ca2c46e512931302b069886af</id>
<content type='text'>
I forgot that read can block. We actually don't want cursor_pos to block
for user input before querying, since it will fail nearly every time. It
did give me a good opportunity to test the error handling though.
</content>
</entry>
<entry>
<title>Don't read the wrong value in cursor_pos.</title>
<updated>2024-01-12T02:48:07Z</updated>
<author>
<name>Rose Hogenson</name>
<email>rosehogenson@posteo.net</email>
</author>
<published>2024-01-12T02:48:07Z</published>
<link rel='alternate' type='text/html' href='https://code.roseh.moe/editor/commit/?id=f842e04c4b5579342c1e74b41e867d02e1727f3d'/>
<id>urn:sha1:f842e04c4b5579342c1e74b41e867d02e1727f3d</id>
<content type='text'>
It seems like sometimes a slow terminal like lxterminal can take a
little while to respond with the cursor position, so the read can time
out. If it does, a later call to cursor_pos could read it in. To prevent
this, we can call read before even querying the position. If there are
any previous pending status responses, this should hopefully read them
in, and we can abort early without getting confused. If there is no
buffered data on stdin, then it's hopefully safe to write the status
query and read the response.
</content>
</entry>
<entry>
<title>Rewrite the entire thing.</title>
<updated>2024-01-11T08:20:11Z</updated>
<author>
<name>Rose Hogenson</name>
<email>rosehogenson@posteo.net</email>
</author>
<published>2024-01-11T08:20:11Z</published>
<link rel='alternate' type='text/html' href='https://code.roseh.moe/editor/commit/?id=db087d43659f0760a02d6c32dc7dc0baf2f914f0'/>
<id>urn:sha1:db087d43659f0760a02d6c32dc7dc0baf2f914f0</id>
<content type='text'>
They say you can always do a better job on the rewrite, and to a certain
extent that was true here. I kept a lot of it the same though, since
there was a lot I liked from the original design. The main improvements
are in efficiency and code clarity.
</content>
</entry>
<entry>
<title>Support backspace in xterm.</title>
<updated>2024-01-07T23:26:04Z</updated>
<author>
<name>Rose Hogenson</name>
<email>rosehogenson@posteo.net</email>
</author>
<published>2024-01-07T23:26:04Z</published>
<link rel='alternate' type='text/html' href='https://code.roseh.moe/editor/commit/?id=57f527f2a1d9bc4ed8c862b014867634803831ba'/>
<id>urn:sha1:57f527f2a1d9bc4ed8c862b014867634803831ba</id>
<content type='text'>
Backspace:

Cooler backspace:
</content>
</entry>
</feed>
