aboutsummaryrefslogtreecommitdiff
path: root/vis.h
diff options
context:
space:
mode:
authorRandy Palamar <randy@rnpnr.xyz>2024-05-11 11:46:54 -0600
committerRandy Palamar <randy@rnpnr.xyz>2024-05-21 20:21:46 -0600
commitf4b26ee480b6c6af1bf27126ca7294847e9d3a79 (patch)
treee97135688a81516ddab3593939cecaf102017bd6 /vis.h
parent07b8e9d8a293d63fd9c1059968b53ad396e9f013 (diff)
downloadvis-f4b26ee480b6c6af1bf27126ca7294847e9d3a79.tar.gz
vis-f4b26ee480b6c6af1bf27126ca7294847e9d3a79.tar.xz
cleanup some single line get/set functions
Diffstat (limited to 'vis.h')
-rw-r--r--vis.h20
1 files changed, 2 insertions, 18 deletions
diff --git a/vis.h b/vis.h
index 181083d..a915c0e 100644
--- a/vis.h
+++ b/vis.h
@@ -208,10 +208,6 @@ void vis_window_prev(Vis*);
void vis_window_focus(Win*);
/** Swap location of two windows. */
void vis_window_swap(Win*, Win*);
-/** Query window width. */
-int vis_window_width_get(const Win*);
-/** Query window height. */
-int vis_window_height_get(const Win*);
/**
* @}
* @defgroup vis_info
@@ -294,8 +290,6 @@ enum VisMode {
* @endrst
*/
void vis_mode_switch(Vis*, enum VisMode);
-/** Get currently active mode. */
-enum VisMode vis_mode_get(Vis*);
/** Translate human readable mode name to constant. */
enum VisMode vis_mode_from(Vis*, const char *name);
@@ -560,14 +554,8 @@ int vis_motion_register(Vis*, void *context, VisMotionFunction*);
*/
/** No count was specified. */
#define VIS_COUNT_UNKNOWN (-1)
-/** Get count, might return `VIS_COUNT_UNKNOWN`. */
-int vis_count_get(Vis*);
-/** Get count, if none was specified, return ``def``. */
-int vis_count_get_default(Vis*, int def);
-/** Set a count. */
-void vis_count_set(Vis*, int count);
-/** Set the tabwidth */
-void vis_tabwidth_set(Vis*, int tw);
+#define VIS_COUNT_DEFAULT(count, def) ((count) == VIS_COUNT_UNKNOWN ? (def) : (count))
+#define VIS_COUNT_NORMALIZE(count) ((count) < 0 ? VIS_COUNT_UNKNOWN : (count))
/** Set the shell */
void vis_shell_set(Vis*, const char *new_shell);
@@ -974,9 +962,5 @@ void vis_file_snapshot(Vis*, File*);
/* TODO: expose proper API to iterate through files etc */
Text *vis_text(Vis*);
View *vis_view(Vis*);
-Win *vis_window(Vis*);
-
-/* Get value of autoindent */
-bool vis_get_autoindent(const Vis*);
#endif