More trailing space removal

This commit is contained in:
Kovid Goyal
2017-12-20 08:50:09 +05:30
parent 0fcce6ec58
commit b8faba2a16
8 changed files with 79 additions and 79 deletions

View File

@@ -5,10 +5,10 @@
#define bottom -1.0f
const vec2 pos_map[] = vec2[4](
vec2(right, top),
vec2(right, bottom),
vec2(left, bottom),
vec2(left, top)
vec2(right, top),
vec2(right, bottom),
vec2(left, bottom),
vec2(left, top)
);
out vec2 texcoord;

View File

@@ -11,10 +11,10 @@ const int RIGHT = 2;
const int BOTTOM = 3;
const uvec2 pos_map[] = uvec2[4](
uvec2(RIGHT, TOP),
uvec2(RIGHT, BOTTOM),
uvec2(LEFT, BOTTOM),
uvec2(LEFT, TOP)
uvec2(RIGHT, TOP),
uvec2(RIGHT, BOTTOM),
uvec2(LEFT, BOTTOM),
uvec2(LEFT, TOP)
);
vec2 to_opengl(uint x, uint y) {

View File

@@ -34,7 +34,7 @@ vec4 alpha_blend(vec3 over, float over_alpha, vec3 under, float under_alpha) {
// Alpha blend two colors returning the resulting color pre-multiplied by its alpha
// and its alpha.
// See https://en.wikipedia.org/wiki/Alpha_compositing
float alpha = mix(under_alpha, 1.0f, over_alpha);
float alpha = mix(under_alpha, 1.0f, over_alpha);
vec3 combined_color = mix(under * under_alpha, over, over_alpha);
return vec4(combined_color, alpha);
}
@@ -45,7 +45,7 @@ vec3 premul_blend(vec3 over, float over_alpha, vec3 under) {
vec4 alpha_blend_premul(vec3 over, float over_alpha, vec3 under, float under_alpha) {
// Same as alpha_blend() except that it assumes over and under are both premultiplied.
float alpha = mix(under_alpha, 1.0f, over_alpha);
float alpha = mix(under_alpha, 1.0f, over_alpha);
return vec4(premul_blend(over, over_alpha, under), alpha);
}
// }}}
@@ -70,7 +70,7 @@ void main() {
final_color = vec4(background.rgb * bg_alpha, bg_alpha);
#else
final_color = vec4(background.rgb, 1.0f);
#endif
#endif
#endif
#ifdef SPECIAL
@@ -78,10 +78,10 @@ void main() {
final_color = vec4(background.rgb * bg_alpha, bg_alpha);
#else
final_color = vec4(background.rgb, bg_alpha);
#endif
#endif
#endif
#if defined(FOREGROUND) || defined(SIMPLE)
#if defined(FOREGROUND) || defined(SIMPLE)
// FOREGROUND or SIMPLE
vec4 fg = calculate_foreground(); // pre-multiplied foreground

View File

@@ -12,7 +12,7 @@ layout(std140) uniform CellRenderData {
uint xnum, ynum, cursor_x, cursor_y, cursor_w;
uint color_table[256];
uint color_table[256];
};
// Have to use fixed locations here as all variants of the cell program share the same VAO
@@ -21,7 +21,7 @@ layout(location=1) in uvec4 sprite_coords;
layout(location=2) in uint is_selected;
const uvec2 cell_pos_map[] = uvec2[4](
uvec2(1, 0), // right, top
uvec2(1, 1), // right, bottom
@@ -118,27 +118,27 @@ float is_cursor(uint x, uint y) {
void main() {
// set cell vertex position {{{
uint instance_id = uint(gl_InstanceID);
uint instance_id = uint(gl_InstanceID);
/* The current cell being rendered */
uint r = instance_id / xnum;
uint c = instance_id - r * xnum;
uint r = instance_id / xnum;
uint c = instance_id - r * xnum;
/* The position of this vertex, at a corner of the cell */
float left = xstart + c * dx;
float top = ystart - r * dy;
vec2 xpos = vec2(left, left + dx);
vec2 ypos = vec2(top, top - dy);
uvec2 pos = cell_pos_map[gl_VertexID];
/* The position of this vertex, at a corner of the cell */
float left = xstart + c * dx;
float top = ystart - r * dy;
vec2 xpos = vec2(left, left + dx);
vec2 ypos = vec2(top, top - dy);
uvec2 pos = cell_pos_map[gl_VertexID];
gl_Position = vec4(xpos[pos.x], ypos[pos.y], 0, 1);
// }}}
// set cell color indices {{{
uvec2 default_colors = uvec2(default_fg, default_bg);
ivec2 color_indices = ivec2(color1, color2);
uint text_attrs = sprite_coords[3];
int fg_index = color_indices[(text_attrs >> 6) & REVERSE_MASK];
int bg_index = color_indices[1 - fg_index];
uvec2 default_colors = uvec2(default_fg, default_bg);
ivec2 color_indices = ivec2(color1, color2);
uint text_attrs = sprite_coords[3];
int fg_index = color_indices[(text_attrs >> 6) & REVERSE_MASK];
int bg_index = color_indices[1 - fg_index];
float cursor = is_cursor(c, r);
vec3 bg = to_color(colors[bg_index], default_colors[bg_index]);
// }}}
@@ -150,7 +150,7 @@ void main() {
sprite_pos = to_sprite_pos(pos, sprite_coords.x, sprite_coords.y, sprite_coords.z & Z_MASK);
colored_sprite = float((sprite_coords.z & COLOR_MASK) >> 14);
// Foreground
// Foreground
uint resolved_fg = resolve_color(colors[fg_index], default_colors[fg_index]);
foreground = color_to_vec(resolved_fg);
// Selection
@@ -165,7 +165,7 @@ void main() {
foreground = choose_color(cursor, bg, foreground);
decoration_fg = choose_color(cursor, bg, decoration_fg);
#endif
// }}}
// }}}
// Background {{{
#ifdef NEEDS_BACKROUND

View File

@@ -8,7 +8,7 @@
# bold_font Operator Mono Medium
# italic_font Operator Mono Book Italic
# bold_italic_font Operator Mono Medium Italic
#
#
# You can get a list of full family names available on your computer by running
# kitty list-fonts
font_family monospace
@@ -24,7 +24,7 @@ font_size 11.0
font_size_delta 2
# Adjust the line height.
# Adjust the line height.
# You can use either numbers, which are interpreted as pixels or percentages
# (number followed by %), which are interpreted as percentages of the
# unmodified line height. You can use negative pixels or percentages less than
@@ -32,7 +32,7 @@ font_size_delta 2
adjust_line_height 0
# Change the sizes of the lines used for the box drawing unicode characters
# These values are in pts. They will be scaled by the monitor DPI to arrive at
# These values are in pts. They will be scaled by the monitor DPI to arrive at
# a pixel value. There must be four values corresponding to thin, normal, thick,
# and very thick lines;
box_drawing_scale 0.001, 1, 1.5, 2
@@ -73,7 +73,7 @@ cursor #cccccc
cursor_shape block
# The interval (in seconds) at which to blink the cursor. Set to zero to
# disable blinking. Note that numbers smaller than repaint_delay will be
# disable blinking. Note that numbers smaller than repaint_delay will be
# limited to repaint_delay.
cursor_blink_interval 0.5
@@ -226,10 +226,10 @@ color15 #ffffff
# Key mapping
# For a list of key names, see: http://www.glfw.org/docs/latest/group__keys.html
# For a list of modifier names, see: http://www.glfw.org/docs/latest/group__mods.html
#
#
# You can use the special action no_op to unmap a keyboard shortcut that is
# assigned in the default configuration.
#
#
# You can combine multiple actions to be triggered by a single shortcut, using the
# syntax below:
# map key combine <separator> action1 <separator> action2 <separator> action3 ...
@@ -246,7 +246,7 @@ map shift+insert paste_from_selection
# pass_selection_to_program. By default, the system's open program is used, but
# you can specify your own, for example:
# map ctrl+shift+o pass_selection_to_program firefox
map ctrl+shift+o pass_selection_to_program
map ctrl+shift+o pass_selection_to_program
# Scrolling
map ctrl+shift+up scroll_line_up
@@ -260,8 +260,8 @@ map ctrl+shift+end scroll_end
map ctrl+shift+h show_scrollback
# Window management
map ctrl+shift+enter new_window
map ctrl+shift+n new_os_window
map ctrl+shift+enter new_window
map ctrl+shift+n new_os_window
map ctrl+shift+w close_window
map ctrl+shift+] next_window
map ctrl+shift+[ previous_window
@@ -334,11 +334,11 @@ map ctrl+shift+f11 toggle_fullscreen
# in hexadecimal>. You can specify multiple code points, separated by commas
# and ranges separated by hyphens. symbol_map itself can be specified multiple times.
# Syntax is:
#
#
# symbol_map codepoints Font Family Name
#
#
# For example:
#
#
# symbol_map U+E0A0-U+E0A2,U+E0B0-U+E0B3 PowerlineSymbols
@@ -347,7 +347,7 @@ map ctrl+shift+f11 toggle_fullscreen
# Hide the kitty window's title bar on macOS.
macos_hide_titlebar no
# Use the option key as an alt key. With this set to no, kitty will use
# Use the option key as an alt key. With this set to no, kitty will use
# the macOS native Option+Key = unicode character behavior. This will
# break any Alt+key keyboard shortcuts in your terminal programs, but you
# can use the macOS unicode input technique.