diff --git a/src/buffer.hh b/src/buffer.hh index 13b958c5..9c648625 100644 --- a/src/buffer.hh +++ b/src/buffer.hh @@ -6,7 +6,6 @@ #include "option_manager.hh" #include "keymap_manager.hh" #include "string.hh" -#include "units.hh" #include #include @@ -30,11 +29,11 @@ struct BufferCoord : LineAndColumn class BufferIterator { public: - typedef char value_type; - typedef size_t difference_type; - typedef const value_type* pointer; - typedef const value_type& reference; - typedef std::random_access_iterator_tag iterator_category; + using value_type = char; + using difference_type = size_t; + using pointer = const value_type*; + using reference = const value_type&; + using iterator_category = std::random_access_iterator_tag; BufferIterator() : m_buffer(nullptr) {} BufferIterator(const Buffer& buffer, BufferCoord coord); @@ -202,7 +201,7 @@ private: Flags m_flags; struct Modification; - typedef std::vector UndoGroup; + using UndoGroup = std::vector; friend class UndoGroupOptimizer; std::vector m_history; diff --git a/src/completion.hh b/src/completion.hh index 84e08dcb..70241f42 100644 --- a/src/completion.hh +++ b/src/completion.hh @@ -1,17 +1,18 @@ #ifndef completion_hh_INCLUDED #define completion_hh_INCLUDED -#include "string.hh" - #include #include +#include "units.hh" + namespace Kakoune { class Context; -typedef std::vector CandidateList; +class String; +using CandidateList = std::vector; struct Completions { diff --git a/src/display_buffer.hh b/src/display_buffer.hh index 8ea88cec..f366bda9 100644 --- a/src/display_buffer.hh +++ b/src/display_buffer.hh @@ -18,7 +18,7 @@ struct DisplayCoord : LineAndColumn : LineAndColumn(line, column) {} }; -typedef char Attribute; +using Attribute = char; enum Attributes { diff --git a/src/highlighter.hh b/src/highlighter.hh index beba2403..ee476fa9 100644 --- a/src/highlighter.hh +++ b/src/highlighter.hh @@ -20,12 +20,10 @@ class Context; // color, adding information text (line numbering for example) or replacing // buffer content (folding for example) -typedef std::function HighlighterFunc; -typedef std::pair HighlighterAndId; -typedef memoryview HighlighterParameters; - +using HighlighterFunc = std::function; +using HighlighterAndId = std::pair; +using HighlighterParameters = memoryview; using HighlighterFactory = std::function; - using HighlighterGroup = FunctionGroup; struct HighlighterRegistry : FunctionRegistry, diff --git a/src/hook_manager.hh b/src/hook_manager.hh index 8b0d7e2d..1c86bfb1 100644 --- a/src/hook_manager.hh +++ b/src/hook_manager.hh @@ -10,7 +10,7 @@ namespace Kakoune { class Context; -typedef std::function HookFunc; +using HookFunc = std::function; class HookManager { diff --git a/src/id_map.hh b/src/id_map.hh index 9c80d776..32462fa5 100644 --- a/src/id_map.hh +++ b/src/id_map.hh @@ -13,10 +13,10 @@ template class id_map { public: - typedef std::pair value_type; - typedef std::vector container_type; - typedef typename container_type::iterator iterator; - typedef typename container_type::const_iterator const_iterator; + using value_type = std::pair; + using container_type = std::vector; + using iterator = typename container_type::iterator; + using const_iterator = typename container_type::const_iterator; void append(const value_type& value) { diff --git a/src/keys.hh b/src/keys.hh index 133363a0..de775552 100644 --- a/src/keys.hh +++ b/src/keys.hh @@ -64,7 +64,7 @@ struct Key { return modifiers != other.modifiers or key != other.key; } }; -typedef std::vector KeyList; +using KeyList = std::vector; KeyList parse_keys(const String& str); String key_to_str(Key key); diff --git a/src/parameters_parser.hh b/src/parameters_parser.hh index 698230af..2f7e5477 100644 --- a/src/parameters_parser.hh +++ b/src/parameters_parser.hh @@ -74,11 +74,11 @@ struct ParametersParser struct iterator { public: - typedef String value_type; - typedef const value_type* pointer; - typedef const value_type& reference; - typedef size_t difference_type; - typedef std::forward_iterator_tag iterator_category; + using value_type = String; + using pointer = const value_type*; + using reference = const value_type&; + using difference_type = size_t; + using iterator_category = std::forward_iterator_tag; iterator(const ParametersParser& parser, size_t index) : m_parser(parser), m_index(index) {} diff --git a/src/register_manager.hh b/src/register_manager.hh index d12d0a94..7021c53b 100644 --- a/src/register_manager.hh +++ b/src/register_manager.hh @@ -11,7 +11,7 @@ namespace Kakoune { -typedef std::function (const Context&)> RegisterRetriever; +using RegisterRetriever = std::function (const Context&)>; class RegisterManager : public Singleton { diff --git a/src/selectors.hh b/src/selectors.hh index 0cfa7a68..0ffdc745 100644 --- a/src/selectors.hh +++ b/src/selectors.hh @@ -56,7 +56,7 @@ inline Range utf8_range(const Utf8Iterator& first, const Utf8Iterator& last) return {first.base().coord(), last.base().coord()}; } -typedef boost::regex_iterator RegexIterator; +using RegexIterator = boost::regex_iterator; template Selection select_to_next_word(const Buffer& buffer, const Selection& selection) diff --git a/src/shell_manager.hh b/src/shell_manager.hh index 6748b609..cee125bf 100644 --- a/src/shell_manager.hh +++ b/src/shell_manager.hh @@ -10,8 +10,8 @@ namespace Kakoune { struct Context; -typedef std::function EnvVarRetriever; -typedef std::unordered_map EnvVarMap; +using EnvVarRetriever = std::function; +using EnvVarMap = std::unordered_map; class ShellManager : public Singleton { diff --git a/src/string.hh b/src/string.hh index 176c7269..75f2e8b0 100644 --- a/src/string.hh +++ b/src/string.hh @@ -11,7 +11,7 @@ namespace Kakoune { -typedef boost::regex Regex; +using Regex = boost::regex; class String : public std::string {