Skip to content

Commit a9f6d14

Browse files
committed
Merge adafruit/main latest
2 parents 7e529ed + 3753ea3 commit a9f6d14

File tree

115 files changed

+7516
-2863
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+7516
-2863
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Install deps
3737
run: |
3838
sudo apt-get install -y eatmydata
39-
sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64
39+
sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 latexmk texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra
4040
pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli
4141
- name: Versions
4242
run: |
@@ -73,12 +73,19 @@ jobs:
7373
with:
7474
name: stubs
7575
path: circuitpython-stubs*
76-
- name: Docs
76+
- name: Test Documentation Build (HTML)
7777
run: sphinx-build -E -W -b html -D version=${{ env.CP_VERSION }} -D release=${{ env.CP_VERSION }} . _build/html
7878
- uses: actions/upload-artifact@v2
7979
with:
8080
name: docs
8181
path: _build/html
82+
- name: Test Documentation Build (LaTeX/PDF)
83+
run: |
84+
make latexpdf
85+
- uses: actions/upload-artifact@v2
86+
with:
87+
name: docs
88+
path: _build/latex
8289
- name: Translations
8390
run: make check-translate
8491
- name: New boards check

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,6 @@
147147
[submodule "ports/esp32s2/esp-idf"]
148148
path = ports/esp32s2/esp-idf
149149
url = https://github.com/tannewt/esp-idf.git
150+
[submodule "frozen/Adafruit_CircuitPython_RFM9x"]
151+
path = frozen/Adafruit_CircuitPython_RFM9x
152+
url = https://github.com/adafruit/Adafruit_CircuitPython_RFM9x.git

.readthedocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ submodules:
1212
include:
1313
- extmod/ulab
1414

15+
formats:
16+
- pdf
17+
1518
python:
1619
version: 3
1720
install:

docs/rstjinja.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,28 @@ def rstjinja(app, docname, source):
66
Render our pages as a jinja template for fancy templating goodness.
77
"""
88
# Make sure we're outputting HTML
9-
if app.builder.format != 'html':
9+
if app.builder.format not in ("html", "latex"):
1010
return
1111

1212
# we only want our one jinja template to run through this func
1313
if "shared-bindings/support_matrix" not in docname:
1414
return
1515

16-
src = source[0]
16+
src = rendered = source[0]
1717
print(docname)
18-
rendered = app.builder.templates.render_string(
19-
src, app.config.html_context
20-
)
18+
19+
if app.builder.format == "html":
20+
rendered = app.builder.templates.render_string(
21+
src, app.config.html_context
22+
)
23+
else:
24+
from sphinx.util.template import BaseRenderer
25+
renderer = BaseRenderer()
26+
rendered = renderer.render_string(
27+
src,
28+
app.config.html_context
29+
)
30+
2131
source[0] = rendered
2232

2333
def setup(app):

lib/mp-readline/readline.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ int readline_process_char(int c) {
144144
goto right_arrow_key;
145145
} else if (c == CHAR_CTRL_K) {
146146
// CTRL-K is kill from cursor to end-of-line, inclusive
147-
vstr_cut_tail_bytes(rl.line, last_line_len - rl.cursor_pos);
147+
vstr_cut_tail_bytes(rl.line, rl.line->len - rl.cursor_pos);
148148
// set redraw parameters
149149
redraw_from_cursor = true;
150150
} else if (c == CHAR_CTRL_N) {
@@ -155,6 +155,7 @@ int readline_process_char(int c) {
155155
goto up_arrow_key;
156156
} else if (c == CHAR_CTRL_U) {
157157
// CTRL-U is kill from beginning-of-line up to cursor
158+
cont_chars = count_cont_bytes(rl.line->buf+rl.orig_line_len, rl.line->buf+rl.cursor_pos);
158159
vstr_cut_out_bytes(rl.line, rl.orig_line_len, rl.cursor_pos - rl.orig_line_len);
159160
// set redraw parameters
160161
redraw_step_back = rl.cursor_pos - rl.orig_line_len;
@@ -342,6 +343,7 @@ int readline_process_char(int c) {
342343
if (c == '~') {
343344
if (rl.escape_seq_buf[0] == '1' || rl.escape_seq_buf[0] == '7') {
344345
home_key:
346+
cont_chars = count_cont_bytes(rl.line->buf+rl.orig_line_len, rl.line->buf+rl.cursor_pos);
345347
redraw_step_back = rl.cursor_pos - rl.orig_line_len;
346348
} else if (rl.escape_seq_buf[0] == '4' || rl.escape_seq_buf[0] == '8') {
347349
end_key:
@@ -352,7 +354,12 @@ int readline_process_char(int c) {
352354
delete_key:
353355
#endif
354356
if (rl.cursor_pos < rl.line->len) {
355-
vstr_cut_out_bytes(rl.line, rl.cursor_pos, 1);
357+
size_t len = 1;
358+
while (UTF8_IS_CONT(rl.line->buf[rl.cursor_pos+len]) &&
359+
rl.cursor_pos+len < rl.line->len) {
360+
len++;
361+
}
362+
vstr_cut_out_bytes(rl.line, rl.cursor_pos, len);
356363
redraw_from_cursor = true;
357364
}
358365
} else {

0 commit comments

Comments
 (0)