Style changes, replace typedefs with usings
This commit is contained in:
parent
560b4ab0b5
commit
e6884f989c
|
@ -6,7 +6,6 @@
|
||||||
#include "option_manager.hh"
|
#include "option_manager.hh"
|
||||||
#include "keymap_manager.hh"
|
#include "keymap_manager.hh"
|
||||||
#include "string.hh"
|
#include "string.hh"
|
||||||
#include "units.hh"
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
@ -30,11 +29,11 @@ struct BufferCoord : LineAndColumn<BufferCoord, LineCount, ByteCount>
|
||||||
class BufferIterator
|
class BufferIterator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef char value_type;
|
using value_type = char;
|
||||||
typedef size_t difference_type;
|
using difference_type = size_t;
|
||||||
typedef const value_type* pointer;
|
using pointer = const value_type*;
|
||||||
typedef const value_type& reference;
|
using reference = const value_type&;
|
||||||
typedef std::random_access_iterator_tag iterator_category;
|
using iterator_category = std::random_access_iterator_tag;
|
||||||
|
|
||||||
BufferIterator() : m_buffer(nullptr) {}
|
BufferIterator() : m_buffer(nullptr) {}
|
||||||
BufferIterator(const Buffer& buffer, BufferCoord coord);
|
BufferIterator(const Buffer& buffer, BufferCoord coord);
|
||||||
|
@ -202,7 +201,7 @@ private:
|
||||||
Flags m_flags;
|
Flags m_flags;
|
||||||
|
|
||||||
struct Modification;
|
struct Modification;
|
||||||
typedef std::vector<Modification> UndoGroup;
|
using UndoGroup = std::vector<Modification>;
|
||||||
friend class UndoGroupOptimizer;
|
friend class UndoGroupOptimizer;
|
||||||
|
|
||||||
std::vector<UndoGroup> m_history;
|
std::vector<UndoGroup> m_history;
|
||||||
|
|
|
@ -1,17 +1,18 @@
|
||||||
#ifndef completion_hh_INCLUDED
|
#ifndef completion_hh_INCLUDED
|
||||||
#define completion_hh_INCLUDED
|
#define completion_hh_INCLUDED
|
||||||
|
|
||||||
#include "string.hh"
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
|
#include "units.hh"
|
||||||
|
|
||||||
namespace Kakoune
|
namespace Kakoune
|
||||||
{
|
{
|
||||||
|
|
||||||
class Context;
|
class Context;
|
||||||
|
|
||||||
typedef std::vector<String> CandidateList;
|
class String;
|
||||||
|
using CandidateList = std::vector<String>;
|
||||||
|
|
||||||
struct Completions
|
struct Completions
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,7 +18,7 @@ struct DisplayCoord : LineAndColumn<DisplayCoord, LineCount, CharCount>
|
||||||
: LineAndColumn(line, column) {}
|
: LineAndColumn(line, column) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef char Attribute;
|
using Attribute = char;
|
||||||
|
|
||||||
enum Attributes
|
enum Attributes
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,12 +20,10 @@ class Context;
|
||||||
// color, adding information text (line numbering for example) or replacing
|
// color, adding information text (line numbering for example) or replacing
|
||||||
// buffer content (folding for example)
|
// buffer content (folding for example)
|
||||||
|
|
||||||
typedef std::function<void (const Context& context, DisplayBuffer& display_buffer)> HighlighterFunc;
|
using HighlighterFunc = std::function<void (const Context& context, DisplayBuffer& display_buffer)>;
|
||||||
typedef std::pair<String, HighlighterFunc> HighlighterAndId;
|
using HighlighterAndId = std::pair<String, HighlighterFunc>;
|
||||||
typedef memoryview<String> HighlighterParameters;
|
using HighlighterParameters = memoryview<String>;
|
||||||
|
|
||||||
using HighlighterFactory = std::function<HighlighterAndId (HighlighterParameters params)>;
|
using HighlighterFactory = std::function<HighlighterAndId (HighlighterParameters params)>;
|
||||||
|
|
||||||
using HighlighterGroup = FunctionGroup<const Context&, DisplayBuffer&>;
|
using HighlighterGroup = FunctionGroup<const Context&, DisplayBuffer&>;
|
||||||
|
|
||||||
struct HighlighterRegistry : FunctionRegistry<HighlighterFactory>,
|
struct HighlighterRegistry : FunctionRegistry<HighlighterFactory>,
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace Kakoune
|
||||||
{
|
{
|
||||||
|
|
||||||
class Context;
|
class Context;
|
||||||
typedef std::function<void (const String&, Context&)> HookFunc;
|
using HookFunc = std::function<void (const String&, Context&)>;
|
||||||
|
|
||||||
class HookManager
|
class HookManager
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,10 +13,10 @@ template<typename Value>
|
||||||
class id_map
|
class id_map
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef std::pair<String, Value> value_type;
|
using value_type = std::pair<String, Value>;
|
||||||
typedef std::vector<value_type> container_type;
|
using container_type = std::vector<value_type>;
|
||||||
typedef typename container_type::iterator iterator;
|
using iterator = typename container_type::iterator;
|
||||||
typedef typename container_type::const_iterator const_iterator;
|
using const_iterator = typename container_type::const_iterator;
|
||||||
|
|
||||||
void append(const value_type& value)
|
void append(const value_type& value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -64,7 +64,7 @@ struct Key
|
||||||
{ return modifiers != other.modifiers or key != other.key; }
|
{ return modifiers != other.modifiers or key != other.key; }
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::vector<Key> KeyList;
|
using KeyList = std::vector<Key>;
|
||||||
|
|
||||||
KeyList parse_keys(const String& str);
|
KeyList parse_keys(const String& str);
|
||||||
String key_to_str(Key key);
|
String key_to_str(Key key);
|
||||||
|
|
|
@ -74,11 +74,11 @@ struct ParametersParser
|
||||||
struct iterator
|
struct iterator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef String value_type;
|
using value_type = String;
|
||||||
typedef const value_type* pointer;
|
using pointer = const value_type*;
|
||||||
typedef const value_type& reference;
|
using reference = const value_type&;
|
||||||
typedef size_t difference_type;
|
using difference_type = size_t;
|
||||||
typedef std::forward_iterator_tag iterator_category;
|
using iterator_category = std::forward_iterator_tag;
|
||||||
|
|
||||||
iterator(const ParametersParser& parser, size_t index)
|
iterator(const ParametersParser& parser, size_t index)
|
||||||
: m_parser(parser), m_index(index) {}
|
: m_parser(parser), m_index(index) {}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
namespace Kakoune
|
namespace Kakoune
|
||||||
{
|
{
|
||||||
|
|
||||||
typedef std::function<std::vector<String> (const Context&)> RegisterRetriever;
|
using RegisterRetriever = std::function<std::vector<String> (const Context&)>;
|
||||||
|
|
||||||
class RegisterManager : public Singleton<RegisterManager>
|
class RegisterManager : public Singleton<RegisterManager>
|
||||||
{
|
{
|
||||||
|
|
|
@ -56,7 +56,7 @@ inline Range utf8_range(const Utf8Iterator& first, const Utf8Iterator& last)
|
||||||
return {first.base().coord(), last.base().coord()};
|
return {first.base().coord(), last.base().coord()};
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef boost::regex_iterator<BufferIterator> RegexIterator;
|
using RegexIterator = boost::regex_iterator<BufferIterator>;
|
||||||
|
|
||||||
template<WordType word_type>
|
template<WordType word_type>
|
||||||
Selection select_to_next_word(const Buffer& buffer, const Selection& selection)
|
Selection select_to_next_word(const Buffer& buffer, const Selection& selection)
|
||||||
|
|
|
@ -10,8 +10,8 @@ namespace Kakoune
|
||||||
{
|
{
|
||||||
|
|
||||||
struct Context;
|
struct Context;
|
||||||
typedef std::function<String (const String& name, const Context&)> EnvVarRetriever;
|
using EnvVarRetriever = std::function<String (const String& name, const Context&)>;
|
||||||
typedef std::unordered_map<String, String> EnvVarMap;
|
using EnvVarMap = std::unordered_map<String, String>;
|
||||||
|
|
||||||
class ShellManager : public Singleton<ShellManager>
|
class ShellManager : public Singleton<ShellManager>
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
namespace Kakoune
|
namespace Kakoune
|
||||||
{
|
{
|
||||||
|
|
||||||
typedef boost::regex Regex;
|
using Regex = boost::regex;
|
||||||
|
|
||||||
class String : public std::string
|
class String : public std::string
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user