~kiwec/ke

4e0a6570b5c10ffd1830ab776619aa0a2f95ddfb — Wolf Clément 3 years ago ee4e4e8
Change file style
39 files changed, 65 insertions(+), 65 deletions(-)

M Makefile
R src/{Buffer.cpp => Buffer.cc}
R src/{Buffer.hpp => Buffer.h}
R src/{Canvas.cpp => Canvas.cc}
R src/{Canvas.hpp => Canvas.h}
R src/{Conversion.cpp => Conversion.cc}
R src/{Conversion.hpp => Conversion.h}
R src/{Document.cpp => Document.cc}
R src/{Document.hpp => Document.h}
R src/{Editor.cpp => Editor.cc}
R src/{Editor.hpp => Editor.h}
R src/{Event.cpp => Event.cc}
R src/{Event.hpp => Event.h}
R src/{File.cpp => File.cc}
R src/{File.hpp => File.h}
R src/{Gutter.cpp => Gutter.cc}
R src/{Gutter.hpp => Gutter.h}
R src/{History.cpp => History.cc}
R src/{History.hpp => History.h}
R src/{Input.cpp => Input.cc}
R src/{Input.hpp => Input.h}
R src/{Line.cpp => Line.cc}
R src/{Line.hpp => Line.h}
R src/{Prompt.cpp => Prompt.cc}
R src/{Prompt.hpp => Prompt.h}
R src/{Section.hpp => Section.h}
R src/{StatusBar.cpp => StatusBar.cc}
R src/{StatusBar.hpp => StatusBar.h}
R src/{Syntax.cpp => Syntax.cc}
R src/{Syntax.hpp => Syntax.h}
R src/{main.cpp => main.cc}
R test/{Document.cpp => Document.cc}
R test/{Document.hpp => Document.h}
R test/{Line.cpp => Line.cc}
R test/{Line.hpp => Line.h}
R test/{Syntax.cpp => Syntax.cc}
R test/{Syntax.hpp => Syntax.h}
R test/{TestUtils.hpp => TestUtils.h}
R test/{tests.cpp => tests.cc}
M Makefile => Makefile +5 -5
@@ 1,8 1,8 @@
SRC      = $(wildcard src/*.cpp)
OBJ      = $(SRC:.cpp=.o)
SRC      = $(wildcard src/*.cc)
OBJ      = $(SRC:.cc=.o)
DEP      = $(OBJ:.o=.d)
TESTS    = $(wildcard test/*.cpp)
TOBJ     = $(TESTS:.cpp=.o)
TESTS    = $(wildcard test/*.cc)
TOBJ     = $(TESTS:.cc=.o)
TDEP     = $(TOBJ:.o=.d)
CXX      = clang
CXXFLAGS = -std=c++1z


@@ 21,7 21,7 @@ $(TESTTGT): $(filter-out src/main.o, $(OBJ)) $(TOBJ)
-include $(DEP)
-include $(TDEP)

%.d: %.cpp
%.d: %.cc
	@$(CXX) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@

.PHONY: clean

R src/Buffer.cpp => src/Buffer.cc +5 -5
@@ 1,10 1,10 @@
#include <sstream>
#include <termbox.h>
#include "Buffer.hpp"
#include "Event.hpp"
#include "Line.hpp"
#include "Gutter.hpp"
#include "Syntax.hpp"
#include "Buffer.h"
#include "Event.h"
#include "Line.h"
#include "Gutter.h"
#include "Syntax.h"

void Buffer::set_relative_position(uint new_x) {
	assert(new_x <= current_line().length());

R src/Buffer.hpp => src/Buffer.h +4 -4
@@ 3,10 3,10 @@
#include <stack>
#include <string>
#include <termbox.h>
#include "Canvas.hpp"
#include "File.hpp"
#include "Input.hpp"
#include "History.hpp"
#include "Canvas.h"
#include "File.h"
#include "Input.h"
#include "History.h"

class Action;
class Line;

R src/Canvas.cpp => src/Canvas.cc +1 -1
@@ 1,5 1,5 @@
#include <termbox.h>
#include "Canvas.hpp"
#include "Canvas.h"

void Canvas::print(const wchar_t* text, int x, int y, int fg, int bg) {
	for(int i = 0; *text != L'\0'; i++) {

R src/Canvas.hpp => src/Canvas.h +0 -0
R src/Conversion.cpp => src/Conversion.cc +1 -1
@@ 1,4 1,4 @@
#include "Conversion.hpp"
#include "Conversion.h"

namespace Convert {
	std::unique_ptr<char[]> from_wide_string(const wchar_t* wide_string) {

R src/Conversion.hpp => src/Conversion.h +0 -0
R src/Document.cpp => src/Document.cc +2 -2
@@ 1,7 1,7 @@
#include <cmath>
#include <cwchar>
#include "Document.hpp"
#include "Line.hpp"
#include "Document.h"
#include "Line.h"

Line Text::find_line(wchar_t* pos) {
	auto line = Line(this, 0, 1);

R src/Document.hpp => src/Document.h +1 -1
@@ 1,7 1,7 @@
#pragma once
#include <assert.h>
#include <stdint.h>
#include "Syntax.hpp"
#include "Syntax.h"

class Line;
using uint = uint32_t;

R src/Editor.cpp => src/Editor.cc +5 -5
@@ 1,10 1,10 @@
#include <stdlib.h>
#include <termbox.h>
#include "Conversion.hpp"
#include "Editor.hpp"
#include "Prompt.hpp"
#include "Gutter.hpp"
#include "StatusBar.hpp"
#include "Conversion.h"
#include "Editor.h"
#include "Prompt.h"
#include "Gutter.h"
#include "StatusBar.h"

void Editor::draw() {
	tb_clear();

R src/Editor.hpp => src/Editor.h +2 -2
@@ 1,7 1,7 @@
#pragma once
#include <memory>
#include "Buffer.hpp"
#include "StatusBar.hpp"
#include "Buffer.h"
#include "StatusBar.h"

class Editor : public InputHandler {
private:

R src/Event.cpp => src/Event.cc +3 -3
@@ 1,7 1,7 @@
#include "Event.hpp"
#include "Event.h"

#include "Buffer.hpp"
#include "Syntax.hpp"
#include "Buffer.h"
#include "Syntax.h"

void WriteEvent::write(Buffer& buf) {
	buf.move_to(line);

R src/Event.hpp => src/Event.h +0 -0
R src/File.cpp => src/File.cc +4 -4
@@ 1,8 1,8 @@
#include <stdio.h>
#include "Document.hpp"
#include "File.hpp"
#include "Line.hpp"
#include "Syntax.hpp"
#include "Document.h"
#include "File.h"
#include "Line.h"
#include "Syntax.h"

void File::open() {
	m_text.erase(0, m_text.size());

R src/File.hpp => src/File.h +1 -1
@@ 1,7 1,7 @@
#pragma once
#include <memory>
#include <string>
#include "Document.hpp"
#include "Document.h"

class File {
public:

R src/Gutter.cpp => src/Gutter.cc +3 -3
@@ 1,7 1,7 @@
#include <cmath>
#include "Buffer.hpp"
#include "Line.hpp"
#include "Gutter.hpp"
#include "Buffer.h"
#include "Line.h"
#include "Gutter.h"

void Gutter::draw(Buffer& buf) {
	const uint fg = TB_DEFAULT;

R src/Gutter.hpp => src/Gutter.h +0 -0
R src/History.cpp => src/History.cc +2 -2
@@ 1,5 1,5 @@
#include "History.hpp"
#include "Buffer.hpp"
#include "History.h"
#include "Buffer.h"

void History::log_event(Event* ev) {
	// Don't log events caused by undo/redo

R src/History.hpp => src/History.h +1 -1
@@ 1,7 1,7 @@
#pragma once
#include <memory>
#include <stack>
#include "Event.hpp"
#include "Event.h"

class Buffer;


R src/Input.cpp => src/Input.cc +1 -1
@@ 1,5 1,5 @@
#include <termbox.h>
#include "Input.hpp"
#include "Input.h"

InputHandler* Input::m_head = nullptr;


R src/Input.hpp => src/Input.h +0 -0
R src/Line.cpp => src/Line.cc +5 -5
@@ 1,8 1,8 @@
#include "Line.hpp"
#include "Buffer.hpp"
#include "Document.hpp"
#include "Editor.hpp"
#include "Gutter.hpp"
#include "Line.h"
#include "Buffer.h"
#include "Document.h"
#include "Editor.h"
#include "Gutter.h"
#include <cmath>

void Line::calc_size() {

R src/Line.hpp => src/Line.h +1 -1
@@ 1,7 1,7 @@
#pragma once
#include <stdint.h>
#include <memory>
#include "Syntax.hpp"
#include "Syntax.h"

class Buffer;
class Text;

R src/Prompt.cpp => src/Prompt.cc +3 -3
@@ 1,8 1,8 @@
#include <sstream>
#include <wchar.h>
#include "Editor.hpp"
#include "Line.hpp"
#include "Prompt.hpp"
#include "Editor.h"
#include "Line.h"
#include "Prompt.h"

void Prompt::draw(int rwidth) {
	if(!m_prompting) return;

R src/Prompt.hpp => src/Prompt.h +2 -2
@@ 3,8 3,8 @@
#include <memory>
#include <termbox.h>
#include <wchar.h>
#include "Document.hpp"
#include "Input.hpp"
#include "Document.h"
#include "Input.h"

class Prompt : public InputHandler {
private:

R src/Section.hpp => src/Section.h +0 -0
R src/StatusBar.cpp => src/StatusBar.cc +6 -6
@@ 1,9 1,9 @@
#include "StatusBar.hpp"
#include "Buffer.hpp"
#include "Conversion.hpp"
#include "Editor.hpp"
#include "File.hpp"
#include "Line.hpp"
#include "StatusBar.h"
#include "Buffer.h"
#include "Conversion.h"
#include "Editor.h"
#include "File.h"
#include "Line.h"
#include <sstream>
#include <termbox.h>


R src/StatusBar.hpp => src/StatusBar.h +1 -1
@@ 1,6 1,6 @@
#pragma once
#include <memory>
#include "Prompt.hpp"
#include "Prompt.h"

class Buffer;


R src/Syntax.cpp => src/Syntax.cc +4 -4
@@ 1,8 1,8 @@
#include <vector>
#include "Document.hpp"
#include "Line.hpp"
#include "Section.hpp"
#include "Syntax.hpp"
#include "Document.h"
#include "Line.h"
#include "Section.h"
#include "Syntax.h"

static const std::wstring operators[] = {
  L"auto",

R src/Syntax.hpp => src/Syntax.h +0 -0
R src/main.cpp => src/main.cc +2 -2
@@ 3,8 3,8 @@
#include <stdlib.h>
#include <termbox.h>
#include <unistd.h>
#include "Buffer.hpp"
#include "Editor.hpp"
#include "Buffer.h"
#include "Editor.h"

void seghandle(int sn) {
	tb_shutdown();

R test/Document.cpp => test/Document.cc +0 -0
R test/Document.hpp => test/Document.h +0 -0
R test/Line.cpp => test/Line.cc +0 -0
R test/Line.hpp => test/Line.h +0 -0
R test/Syntax.cpp => test/Syntax.cc +0 -0
R test/Syntax.hpp => test/Syntax.h +0 -0
R test/TestUtils.hpp => test/TestUtils.h +0 -0
R test/tests.cpp => test/tests.cc +0 -0