Commit graph

26 commits

Author SHA1 Message Date
seem
78fab914ab Make Buffer iterable 2020-09-12 20:30:05 +02:00
seem
33b7fd62b0 Lots of updates
Features:
- `move_beginning_of_line`
- `move_end_of_line`
- `newline`
- `delete_char`
- `delete_forward_char`
- `add_char`
- `left` and `right` now wrap lines
2020-09-12 20:27:35 +02:00
seem
7766f95556 Trying out a main Editor class
Also may have greatly simplified "clamping" logic to a single if
statement. The key was to reset x_hint on any horizontal motion.
2020-09-09 21:33:28 +02:00
seem
e80aaa1395 Window scrolling on vertical movement
Changed the way we specify where the window vs file position. Instead of
specifying where the file is in the window "space", we do the inverse.
Seems more intuitive this way.

Also now only redraw the screen if we've scrolled. That was primarily to
fix the annoying flicker I was seeing. Will probably need something more
capable than that when we get to editing text.

Also added another flake8 ignore rule to play nice with black.
2020-09-07 21:50:59 +02:00
seem
24a2492b8e Refactor: Merge Buffer into Window
Think it'll make scrolling a lot simpler.
2020-09-06 17:55:58 +02:00
seem
e76e5a9785 Add Window class 2020-09-06 16:35:30 +02:00
seem
3fbabef5c5 Extract Buffer to its own module 2020-09-06 12:34:01 +02:00
seem
b8b3dc2d75 Home and end movement 2020-09-06 12:28:41 +02:00
seem
3c4d6d57ad Set cursor x after vertical movement 2020-09-06 12:12:38 +02:00
seem
d45f1ca96d Fix broken test 2020-09-06 10:58:58 +02:00
seem
8cc8662cde Restrict horizontal movement 2020-09-06 10:58:38 +02:00
seem
2421679967 Fix c_main 2020-09-06 10:54:21 +02:00
seem
9370a20df3 Fix broken test 2020-09-06 10:52:35 +02:00
seem
271bb9ddbc Stop cursor at last line 2020-09-06 10:52:11 +02:00
seem
e5f0bd6188 Make Buffer tests prettier with method chaining
Feel like I'm gonna regret this but YOLO.
2020-09-06 10:47:21 +02:00
seem
cf41848edb Extract Buffer class + add tests 2020-09-06 10:39:26 +02:00
seem
db9bd5ba7a Basic cursor movement 2020-09-06 10:36:17 +02:00
seem
5ec0cfd43c Read a file 2020-09-06 10:22:11 +02:00
seem
960722eb21 Remove hook that conflicts with black 2020-09-06 10:21:38 +02:00
seem
32615807a4 Add dev requirements file 2020-09-06 10:11:11 +02:00
seem
c6a25cf491 Update pre-commit tool versions 2020-09-06 10:09:50 +02:00
seem
1d810ee39b Basic curses setup 2020-09-06 10:04:45 +02:00
seem
c889203492 License 2020-09-06 10:01:22 +02:00
seem
9cb8dcf8bf Git ignore 2020-09-06 10:00:42 +02:00
seem
e6eabd8211 Tools 2020-09-06 09:59:49 +02:00
seem
32f5d426b6 Initial commit 2020-09-06 09:48:15 +02:00