diff options
| -rw-r--r-- | main.c | 6 | ||||
| -rw-r--r-- | vis.c | 4 | ||||
| -rw-r--r-- | vis.h | 3 |
3 files changed, 12 insertions, 1 deletions
@@ -1947,7 +1947,11 @@ static const char *openline(Vis *vis, const char *keys, const Arg *arg) { vis_motion(vis, VIS_MOVE_LINE_END); vis_keys_feed(vis, "<insert-newline>"); } else { - vis_motion(vis, VIS_MOVE_LINE_BEGIN); + if (vis_get_autoindent(vis)) { + vis_motion(vis, VIS_MOVE_LINE_START); + } else { + vis_motion(vis, VIS_MOVE_LINE_BEGIN); + } vis_keys_feed(vis, "<insert-newline><Up>"); } return keys; @@ -1363,3 +1363,7 @@ View *vis_view(Vis *vis) { Win *vis_window(Vis *vis) { return vis->win; } + +bool vis_get_autoindent(const Vis *vis) { + return vis->autoindent; +}
\ No newline at end of file @@ -449,4 +449,7 @@ Win *vis_window(Vis*); bool vis_theme_load(Vis*, const char *name); +/* Get value of autoindent */ +bool vis_get_autoindent(const Vis*); + #endif |
