Skip to content

Commit 0912b51

Browse files
committedNov 15, 2017
Add .clang-format
1 parent 1887248 commit 0912b51

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed
 

‎.clang-format

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Language: Cpp
2+
BasedOnStyle: LLVM

‎vterm-module.c

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#include "vterm-module.h"
22
#include <fcntl.h>
33
#ifdef __APPLE__
4-
# include <util.h>
4+
#include <util.h>
55
#else
6-
# include <pty.h>
6+
#include <pty.h>
77
#endif
88
#include <pthread.h>
99
#include <signal.h>
@@ -154,11 +154,12 @@ static emacs_value render_text(emacs_env *env, char *buffer, int len,
154154
emacs_value strike = cell->attrs.strike ? Qt : Qnil;
155155

156156
// TODO: Blink, font, dwl, dhl is missing
157-
emacs_value properties = list(
158-
env, (emacs_value[]){Qforeground, foreground, Qbackground, background,
157+
emacs_value properties =
158+
list(env,
159+
(emacs_value[]){Qforeground, foreground, Qbackground, background,
159160
Qweight, bold, Qunderline, underline, Qslant, italic,
160161
Qreverse, reverse, Qstrike, strike},
161-
14);
162+
14);
162163

163164
put_text_property(env, text, Qface, properties);
164165

@@ -193,7 +194,8 @@ static void goto_char(emacs_env *env, int pos) {
193194
env->funcall(env, Fgoto_char, 1, (emacs_value[]){point});
194195
}
195196

196-
static void vterm_put_caret(VTerm *vt, emacs_env *env, int row, int col, int offset) {
197+
static void vterm_put_caret(VTerm *vt, emacs_env *env, int row, int col,
198+
int offset) {
197199
int rows, cols;
198200
vterm_get_size(vt, &rows, &cols);
199201
// row * (cols + 1) because of newline character
@@ -292,7 +294,7 @@ static void vterm_flush_output(struct Term *term) {
292294
}
293295

294296
static void term_finalize(void *object) {
295-
struct Term *term = (struct Term*)object;
297+
struct Term *term = (struct Term *)object;
296298
pthread_cancel(term->thread);
297299
pthread_join(term->thread, NULL);
298300
vterm_free(term->vt);
@@ -416,7 +418,7 @@ static emacs_value Fvterm_update(emacs_env *env, ptrdiff_t nargs,
416418
if (nargs > 1) {
417419
ptrdiff_t len = string_bytes(env, args[1]);
418420
unsigned char key[len];
419-
env->copy_string_contents(env, args[1], (char*)key, &len);
421+
env->copy_string_contents(env, args[1], (char *)key, &len);
420422
VTermModifier modifier = VTERM_MOD_NONE;
421423
if (env->is_not_nil(env, args[2]))
422424
modifier = modifier | VTERM_MOD_SHIFT;

‎vterm-module.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ static void erase_buffer(emacs_env *env);
5555
static void insert(emacs_env *env, emacs_value string);
5656
static void goto_char(emacs_env *env, int pos);
5757

58-
static void vterm_put_caret(VTerm *vt, emacs_env *env, int row, int col, int offset);
58+
static void vterm_put_caret(VTerm *vt, emacs_env *env, int row, int col,
59+
int offset);
5960
static void vterm_redraw(VTerm *vt, emacs_env *env);
6061
static void vterm_flush_output(struct Term *term);
6162
static void term_finalize(void *object);

0 commit comments

Comments
 (0)
Please sign in to comment.